[GiNaC-list] How can I get the values of the solved vars from the returned expression from lsolve?

Zach refinedcode at gmail.com
Fri Oct 12 16:28:58 CEST 2012


That worked great thank you!

On Fri, Oct 12, 2012 at 4:29 AM, Vladimir V. Kisil <kisilv at maths.leeds.ac.uk
> wrote:

> Hi,
> I usually do as follow: first store the list produced by lsolve as L, then
> use a.subs(L) as the value of a. For a cleaner code you may wish to add a
> check that the result is indeed a numeric and no exception occured.
> Best wishes.
> Vladimir
> On Oct 11, 2012 11:19 PM, "Zach" <refinedcode at gmail.com> wrote:
>
>> Hi I stumbled across this incredibly useful library and I wanted to use
>> the lsolve function.  I was reading the tutorial pdf to figure out how to
>> use it.  So from lsolve i end up with an expression like:
>>
>> *{a==3,b==4}
>>> *
>>
>>
>> I was wondering how I could get a value of the a and b symbols from
>> this?  I would ideally like to store them in an int to use in another
>> library.  I have been looking for an answer for a while so I would really
>> appreciate if anyone knows?  I could parse it like a string but Im assuming
>> there is a better way?
>>
>> Thank you for your time,
>> Zach
>>
>>
>> _______________________________________________
>> GiNaC-list mailing list
>> GiNaC-list at ginac.de
>> https://www.cebix.net/mailman/listinfo/ginac-list
>>
>>
> _______________________________________________
> GiNaC-list mailing list
> GiNaC-list at ginac.de
> https://www.cebix.net/mailman/listinfo/ginac-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cebix.net/pipermail/ginac-list/attachments/20121012/e25c8090/attachment.html>


More information about the GiNaC-list mailing list