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... Fred
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
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@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
Hi, Am 19.03.2010 01:44, schrieb Frederic:
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" ?
there is no build-in facility in GiNaC to do such a thing. You would have to write your own code for that, for example, a function that takes an relational, manipulates the rhs and lhs and returns the new relational. The relational class can indeed represent a inequality, but nothing more. Regards, Jens
participants (3)
-
Frederic
-
Harish Narayanan
-
Jens Vollinga