[GiNaC-list] get_name() doesn't returned a name like "symbolNNN"?

Alexei Sheplyakov alexei.sheplyakov at gmail.com
Thu Sep 2 18:34:42 CEST 2010


Hello,

On Sat, Aug 28, 2010 at 10:17 PM, Warren Weckesser
<warren.weckesser at gmail.com> wrote:

> Partly answering my own question...  it looks like the change was
> introduced in version 1.5.0.
>
> From symbol.cpp in version 1.5.0:
> -----
> symbol::symbol() : serial(next_serial++), name(""), TeX_name("")
> {
>         setflag(status_flags::evaluated | status_flags::expanded);
> }
> -----
> So the default name is an empty string.
>

[skipped]

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

Yes. This way there's no need to allocate memory for the string "symbolNNN"
(unless you print the expression involving that symbol). This improves
performance
a little bit if there are a lot of short-leaving symbols.

get_name() misbehaviour you've noticed is definitely a bug, I'll fix that.

Best regards,
        Alexei


More information about the GiNaC-list mailing list