No subject


Sat Aug 28 21:51:13 CEST 2010


-----
symbol::symbol() : serial(next_serial++), name(""), TeX_name("")
{
        setflag(status_flags::evaluated | status_flags::expanded);
}
-----
So the default name is an empty string.

But in version 1.4.4:
-----
symbol::symbol()
 : inherited(&symbol::tinfo_static), asexinfop(new assigned_ex_info),
serial(next_serial++), name(autoname_prefix() + ToString(serial)),
TeX_name(name), domain(domain::complex),
ret_type(return_types::commutative), ret_type_tinfo(&symbol::tinfo_static)
{
        setflag(status_flags::evaluated | status_flags::expanded);
}
-----

It looks like several things were changed.  Was it intentional that the
default name is no longer "symbolNNN"?

Warren

--0015174c45b20117bc048ee7ebe6
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><div class=3D"gmail_quote">On Sat, Aug 28, 2010 at 2:43 PM, Warren Weck=
esser <span dir=3D"ltr">&lt;<a href=3D"mailto:warren.weckesser at gmail.com">w=
arren.weckesser at gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gma=
il_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(20=
4, 204, 204); padding-left: 1ex;">
Hi,<br><br>According to the documentation (section 4.5 of the online tutori=
al), the following code should produce something like<br><br>z.get_name() =
=3D &quot;symbol1&quot;<br><br>but with ginac 1.5.8, I get an empty string.=
<br>

<br>-----<br>#include &lt;iostream&gt;<br>#include &lt;ginac/ginac.h&gt;<br=
>using namespace std;<br>using namespace GiNaC;<br>=A0<br>int main()<br>{<b=
r>=A0=A0=A0 symbol z;<br>=A0=A0=A0 cout &lt;&lt; &quot;z.get_name() =3D \&q=
uot;&quot; &lt;&lt; z.get_name() &lt;&lt; &quot;\&quot;&quot; &lt;&lt; endl=
;<br>

=A0=A0=A0 return 0;<br>}<br>-----<br><br>In an older version of ginac, this=
 used to work as documented.=A0 Is this a bug, or an expected change in beh=
avior? (Or is it just my installation that is broken?)<br><br></blockquote>=
<div>
<br>Partly answering my own question...=A0 it looks like the change was<br>=
introduced in version 1.5.0.<br><br>From symbol.cpp in version 1.5.0:<br>--=
---<br>symbol::symbol() : serial(next_serial++), name(&quot;&quot;), TeX_na=
me(&quot;&quot;)<br>
{<br>=A0=A0=A0=A0=A0=A0=A0 setflag(status_flags::evaluated | status_flags::=
expanded);<br>}<br>-----<br>So the default name is an empty string.<br><br>=
But in version 1.4.4:<br>-----<br>symbol::symbol()<br>=A0: inherited(&amp;s=
ymbol::tinfo_static), asexinfop(new assigned_ex_info), serial(next_serial++=
), name(autoname_prefix() + ToString(serial)), TeX_name(name), domain(domai=
n::complex), ret_type(return_types::commutative), ret_type_tinfo(&amp;symbo=
l::tinfo_static)<br>
{<br>=A0=A0=A0=A0=A0=A0=A0 setflag(status_flags::evaluated | status_flags::=
expanded);<br>}<br>-----<br><br>It looks like several things were changed.=
=A0 Was it intentional that the default name is no longer &quot;symbolNNN&q=
uot;?<br><br>
Warren<br><br></div></div>

--0015174c45b20117bc048ee7ebe6--


More information about the GiNaC-list mailing list