How to use sqrt for input expression?
Dear GiNaC developers, I'm using GiNaC for making numerical simulation tools. My problem with GiNaC is how to handle 'sqrt' function in expression input. The simplest example is, ======================================= #include <ginac/ginac.h> using namespace GiNaC; #include <iostream.h> int main() { symbol x("x"); ex e("sqrt(x)",lst(x)); cout << e <<endl; } ======================================= When it runs, it makes core dump. When I use 'sin' instead of 'sqrt', the result is what I expected with GiNaC library. Is it a bug or normal? If normal, how to input expression that contains 'sqrt' function? Best regards, Hidehiro Fujio NEC Corporation, Internet System Laboratory Kawasaki, Japan 216-8555 E-mail: fujio@ccm.cl.nec.co.jp
Hello, On Thu, 13 Dec 2001, Hidehiro FUJIO wrote:
I'm using GiNaC for making numerical simulation tools.
My problem with GiNaC is how to handle 'sqrt' function in expression input. The simplest example is,
======================================= #include <ginac/ginac.h>
using namespace GiNaC; #include <iostream.h> int main() { symbol x("x"); ex e("sqrt(x)",lst(x)); cout << e <<endl; } =======================================
When it runs, it makes core dump.
Rather it throws an (uncaught) exception telling you that there is no function 'sqrt' included in the parser.
When I use 'sin' instead of 'sqrt', the result is what I expected with GiNaC library.
Is it a bug or normal? If normal, how to input expression that contains 'sqrt' function?
Till this is fixed, just use "x^(1/2)" instead of "sqrt(x)" when constructing an ex from a string. Regards -richy. -- Richard B. Kreckel <Richard.Kreckel@Uni-Mainz.DE> <http://wwwthep.physik.uni-mainz.de/~kreckel/>
participants (2)
-
Hidehiro FUJIO
-
Richard B. Kreckel