Help with Complex numbers

"John Fletcher" <[email protected]> Tue, 03 Jan 2006 12:04:01 -0000
Newsgroups gmane.comp.lib.daixtrose.help
Message-ID <43BA6831.15028.89FAD2@localhost>
Happy New Year

I am having some success with adapting the Solver example.

I want to run some cases where the variables are complex 
numbers.  I have adapted the solver code to be templated and 
have defined complex as follows

typedef _Complex double complex;

using the G++ defined extensions to provide complex numbers 
(see
http://gcc.gnu.org/onlinedocs/gcc-
4.0.2/gcc/Complex.html#Complex )

This runs on older g++ e.g. 3.3.3

When I move it to g++ 4.0.2 it will no longer compile.  It says that a 
cast from double to double __complex__ is illegal and I have not 
been able to find any way to initialise a complex variable from an 
expression.

This also throws up the fact that Daixt::Scalar has an internal type 
of double, and I think I will need a complex version of that.

Do you know of any way around these problems?

Thanks

John
-- 
Dr John P. Fletcher   Tel: (44) 121 204 3389 (direct line)
Chemical Engineering and Applied Chemistry (CEAC),
School of Engineering and Applied Science (SEAS),
Aston University, Aston Triangle, BIRMINGHAM B4 7ET  U.K.               
CEAC Web site http://www.ceac.aston.ac.uk/
FAX: (44) 121 204 3679




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click