[GiNaC-list] Randomness when using lsolve

Federico Bergero fedebergero at gmail.com
Thu Jan 16 20:20:31 CET 2014

Hello everybody I'm new to GiNaC.

I'm trying to use it to solve linear algebraic system of equations and
running the example from the tutorial

 symbol a("a"), b("b"), x("x"), y("y");
         lst eqns, vars;
         eqns = a*x+b*y==3, x-y==b;
         vars = x, y;
         cout << lsolve(eqns, vars) << endl;

While it works perfectly when I run it several times I get different
solutions (they are all equivalent though). For example:

what is going on there? Is there a way to have a deterministic solution?

Thanks in advance.

I find television very educational. Every time someone switches it on,
I go into another room and read a good book.

More information about the GiNaC-list mailing list