[GiNaC-list] print_csrc, print_csrc_double... how to use?

John Pye john.pye at student.unsw.edu.au
Mon Jul 25 09:47:44 CEST 2005


Hi all

Probably a silly question here. I'm trying to work out how to use the 
'print_csrc' functionality in GiNaC. I don't seem to be able to make it 
work.
Please could someone offer me some suggestions on how to fix the following?

> [xxx at xxx nla-ginac]$ cat print.cpp
> #include <ginac/ginac.h>
> #include <iostream>
>
> using namespace GiNaC;
>
> int main(){
>     symbol x("x");
>     ex f = log(pow(x,2));
>     print_csrc(std::cout);
>     std::cout << f << std::endl;
> }
>
> [xxx at xxx nla-ginac]$ g++ print.cpp -lginac -lcln
> [xxx at xxx nla-ginac]$ ./a.out
> *log(x^2)*


Notice that it's outputing 'x^2' and not 'pow(x,2)' or 'x*x'. It seems 
that the print_csrc call isn't doing anything. What am I doing wrong?

Cheers,

JP

-- 
John Pye
School of Mechanical and Manufacturing Engineering
The University of New South Wales
Sydney  NSW 2052  Australia
t +61 2 9385 5127
f +61 2 9663 1222
mailto:john.pye_AT_student_DOT_unsw.edu.au
http://pye.dyndns.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.cebix.net/pipermail/ginac-list/attachments/20050725/fe12b922/attachment.html


More information about the GiNaC-list mailing list