Hello I attach a program which compiles and runs and asks to be reported. A copy of that message is as a comment in the code. System: Red Hat 9.0 with gcc 3.2 cln 1.1.5 and GiNaC 1.1.4 installed with no extra options (recently installed). A word about what I am trying to do. I want to use the ex class as a template parameter something<ex> and the class something< > makes use of Boost and deep inside wants to convert GiNaC::ex to double and cannot find a way to do this. I want to provide a default way to satisfy that request EVEN IF IT DOES NOT MAKE SENSE to get under way the use of GiNaC for symbolic calculation inside the template class. This is very much a "first action". The later action includes a more thorough use of GiNaC to replace the Boost library within the template class. I have already done something similar with a different symbolic algebra in C++. Thanks John Fletcher ------------------------------------------------------------------- Dr John P. Fletcher Tel: (44) 121 359 3611 ext 4625 Chemical Engineering and Applied Chemistry (CEAC), School of Engineering and Applied Science (SEAS), Aston University, Fax: (44) 121 359 4094 Aston Triangle, Email: J.P.Fletcher@aston.ac.uk BIRMINGHAM B4 7ET U.K. CEAC Web site http://www.ceac.aston.ac.uk/ The following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any other MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance. ---- File information ----------- File: test.cpp Date: 23 Oct 2003, 23:56 Size: 539 bytes. Type: Program-source
Hi! On Fri, Oct 24, 2003 at 11:01:15AM +0100, John Fletcher wrote:
symbol x("x"); ex example("x+1",lst(x));
// This produces a compile time message // Internal error: statement in file real/conv/cl_R_to_double.cc, // line 55 has been reached!! // Please send the authors of the program a description // how you produced this error!
double val = ( ex_to<numeric>( example ) ).to_double();
You call ex_to<numeric>(example), but 'example' is a sum, not a numeric. When you call ex_to<T> on an expression that isn't a T, you're in deep doodoo. You should check the type of the expression first, like this: double val; if (is_a<numeric>(example)) val = ex_to<numeric>(example).to_double(); else // report error, load 'val' with default value, or something else Bye, Christian -- / Physics is an algorithm \/ http://www.uni-mainz.de/~bauec002/
participants (2)
-
Christian Bauer
-
John Fletcher