<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi all<br>
<br>
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. <br>
Please could someone offer me some suggestions on how to fix the
following?<br>
<br>
<blockquote type="cite"><tt>[xxx@xxx nla-ginac]$ cat print.cpp<br>
#include &lt;ginac/ginac.h&gt;<br>
#include &lt;iostream&gt;<br>
  <br>
using namespace GiNaC;<br>
  <br>
int main(){<br>
&nbsp;&nbsp;&nbsp; symbol x("x");<br>
&nbsp;&nbsp;&nbsp; ex f = log(pow(x,2));<br>
&nbsp;&nbsp;&nbsp; print_csrc(std::cout);<br>
&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; f &lt;&lt; std::endl;<br>
}<br>
  <br>
[xxx@xxx nla-ginac]$ g++ print.cpp -lginac -lcln<br>
[xxx@xxx nla-ginac]$ ./a.out<br>
  <b>log(x^2)</b></tt><br>
</blockquote>
<br>
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?<br>
<br>
Cheers,<br>
<br>
JP<br>
<pre class="moz-signature" cols="72">-- 
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
<a class="moz-txt-link-freetext" href="mailto:john.pye_AT_student_DOT_unsw.edu.au">mailto:john.pye_AT_student_DOT_unsw.edu.au</a>
<a class="moz-txt-link-freetext" href="http://pye.dyndns.org/">http://pye.dyndns.org/</a></pre>
</body>
</html>