[GiNaC-list] can ginac solve inequalities ?

Frederic fmdp at free.fr
Fri Mar 19 01:44:35 CET 2010


> How does one "solve" an inequality?

hum, maybe 'solve' is not the right word, sorry...

for now, using lsolve(), I can make GiNaC answer "x == -y" for
equality "x+y  == 0" (looking at 'x').

My question is :  if I'm looking for 'x', in the inequality " x+y <
0", how can GiNaC give me "x < -y" ?

cheers
Fred


2010/3/19 Harish Narayanan <harish.mlists at gmail.com>:
> On 3/19/10 12:31 AM, Frederic wrote:
>> Hi,
>>
>> I'm new here, I only test GiNaC to see how it can help me.
>> What I've seen of it so far with is very nice, especially C++ objects
>> (no need to parse strings).
>>
>> But I don't see how to solve inequalities :
>> x+y < 0
>>
>> lsolve tells me :
>> terminate called after throwing an instance of 'std::invalid_argument'
>>   what():  lsolve(): 1st argument must be a list of equations
>>
>> it works just fine with real equalities (replaced the '<' by '==' ):
>> x+y == 0
>>
>> I use GiNaC 1.5.2 on a 64b ubuntu system.
>> But I haven't seen anything related on newer version's changelog.
>>
>> can GiNaC solve inequalities ? If yes, how ?!?
>> and if no, why ? is it planned ?
>>
>> thanks in advance for any input...
>
> How does one "solve" an inequality?
>
> Harish
>
>


More information about the GiNaC-list mailing list