[Developers] Patch: Make complex arithmetic more efficient and convenient
schnetter at cct.lsu.edu
Fri Jan 12 09:16:12 CST 2007
On Jan 12, 2007, at 08:59:04, schnetter at cct.lsu.edu wrote:
> For C++, define the usual arithmetic operators (+-*/ etc.) as
> inline functions calling the corresponding complex arithmetic
> functions. This makes it possible to use complex numbers in the
> same way as real numbers, which makes it possible to instantiate
> templates for both CCTK_REAL and CCTK_COMPLEX. This leads to much
> code reduction in Carpet.
This would, of course, be much simpler if we defined CCTK_COMPLEX to
be complex<CCTK_REAL> in C++. Last time this was proposed there was
the fear that not all C++ compilers would implement the corresponding
part of the STL. Does anybody know of such a C++ compiler on a
system where C++ code in Cactus is used?
Erik Schnetter <schnetter at cct.lsu.edu>
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from www.keyserver.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://www.cactuscode.org/pipermail/developers/attachments/20070112/573fc613/attachment.bin
More information about the Developers