summaryrefslogtreecommitdiff
path: root/src/main/Complex.c
Commit message (Collapse)AuthorAge
* This patch makes complex arithmetic in C and C++ more efficient, andschnetter2007-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | makes it much more convenient for C++, expecially when templates are used. The flesh functions for complex arithmetic are defined (not only declared) by including Complex.c from the header file cctk_Complex.h. They are declared "static inline", so the the compiler can inline them, but does not have to create an out-of-line copy for every source file. Complex.c is also compiled stand-alone without the "static inline" prefix, so that out-of-line copies exist as well. Add some new complex arithmetic functions, e.g. ComplexNeg to change the sign. Make some complex arithmetic functions more efficient by using algorithms from glibc. These algorithms are LGPL. They should be faster and/or more accurate than the existing implementations. 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. The patch also appends a type postfix to the names of math functions called in the inlined routines: 'f' for HAVE_CCTK_REAL4, nothing for HAVE_CCTK_REAL8, and 'l' for HAVE_CCTK_REAL16. This avoids compiler warnings about conversions from "double" to "float" which may lose significant bits. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4418 17b73243-c579-4c4c-a9d2-2d5706c11dac
* As discussed in today's Cactus call, applying a couple of the patchesswhite2006-03-02
| | | | | | | | | | from 14 Feb Patches list. As discussed, will further investigate the validity and origin of the Complex sqrt function later. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4262 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Untabifying.goodale2005-10-03
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4163 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Prevent unnecessary overflow or underflow in complex division byschnetter2005-05-15
| | | | | | | rescaling the arguments. This is a standard algorithm. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4050 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Patch from Yaakoub to add a complex version of the 'pow' function.goodale2005-01-24
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3966 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Putting semicolons at the end of CCTK_FILEVERSIONs.goodale2002-11-12
| | | | | | | Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@3029 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixed the complex div() and abs() routines to conform to the GNU Scientific ↵tradke2001-12-12
| | | | | | | | | | | Library. This closes PR Cactus/335. Also added complex exp(), sin(), cos(), and sqrt() routines according to GSL. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2499 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Making rcsid strings constant - PR 669.goodale2001-05-10
| | | | | | | Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2159 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added CCTK complex functions for all possible precisions.tradke2001-02-20
| | | | | | | This closes PR Cactus 411. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2032 17b73243-c579-4c4c-a9d2-2d5706c11dac
* grdoc, style-guidelines, ...goodale2000-10-05
| | | | | | | Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1854 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixed typo in CCTK_CmplxReal() which always returned the imaginary part.tradke2000-07-06
| | | | | | | Now output for complex numbers should be okay. git-svn-id: http://svn.cactuscode.org/flesh/trunk@1709 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Adding prototypesallen2000-06-24
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@1700 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Removing warnings from rcsid variables.allen2000-04-17
| | | | | | | Tidied include files a bit, removing a few cctk.h's, so I've introduced a few more warnings to fix git-svn-id: http://svn.cactuscode.org/flesh/trunk@1550 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Replacing CCTK_WARN with CCTK_Warnallen2000-01-17
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@1271 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Capitalising include file namesallen2000-01-16
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@1265 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Included <math.h> because T3E's compiler was missing a prototype for sqrt().tradke2000-01-10
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@1220 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added Gab's complex number stuff.goodale1999-12-14
Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1190 17b73243-c579-4c4c-a9d2-2d5706c11dac