[GiNaC-list] Collect() with a list of variables doesn't work in ginsh

Richard B. Kreckel kreckel at in.terlu.de
Sun Mar 21 13:10:49 CET 2021


Dear Vitaly,

On 17.03.21 14:57, Vitaly Magerya wrote:
> Hi, all. In section 5.7.2 of the docs (Expanding and collecting)
> there is this example of ginsh usage:
> 
>     > a=expand((sin(x)+sin(y))*(1+p+q)*(1+d));
>     > collect(a,{p,q});
> 
> The docs say I should get this:
> 
>     d*sin(x)+(d*sin(x)+sin(y)+d*sin(y)+sin(x))*p
> 
> ... but actually:
> 
>     cannot modify multiply referenced object
> 
> This is with GiNaC V1.7.6, V1.7.8, and the latest commit of
> V1.8.0.
> 
> How do I make this work?

Does the attached patch work for you?

  -richy.
-- 
Richard B. Kreckel
<https://in.terlu.de/~kreckel/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: collect.patch
Type: text/x-patch
Size: 435 bytes
Desc: not available
URL: <http://www.ginac.de/pipermail/ginac-list/attachments/20210321/1d130afe/attachment.bin>


More information about the GiNaC-list mailing list