>Hi,
>I'm new to this group, so sorry if this question is off-topic.
>How can I do fast mathmatics in C++? I have to improve a program for simulation
>which is coded in C. That program needs a GUI, so I want to recode it in C++. At
>the moment I have to include the original C calculation routines, because C++,
>so I was told, is not fast enough.
>Is this true. Is there no way, like optimized math libraries etc. to get C++ as
>fast as C?
I find this hard to beleive. The original calculation routines
should compile under c++ with little or no modifaction. Unless they do
something very unusual (for math routines it would have to be
something extermely unusual), they should produce almost identical
machine code. As far as I know, for example, if a structure and all
its compenets and subcomponents etc do not have a constructor declared
then no constructer will be called for that structure.
Or do you mean you want to do a major rewrite (redesign) of the
calculation routines in a more object oriented manner? Even then I
would make a (very) uneducated guess that as long as you avoid doing
things in an object oriented way it critical places, they won't run
much slower.
Also it is not essential to use c++ for a GUI although it may be a
good idea. (I am not very knowledgable about this area. Are motif or
qt c++ oriented?)
You may want to ask about this on comp.lang.c++.moderated.
Quote:>Greetings, Christoph
Hope this helps, Martin