[eigen] solve with and without check

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi,

In various decompositions (LU, rank-revealing QR,...) we have a
solve() method that checks for the existence of a solution; if no
solution exists, it returns false and leaves the result undefined.

This is really needed as trying to get a solution nevertheless can
result in inf/nan values making the solve() function taking much
longer to return.

But in most cases, the user just knows that a solution is meant to
exist and he wants to get a solution even if it's only half-decent,
rather than having to check the return value of solve() and deal with
error cases. This is especially true as it's very difficult to check
for existence without paying a very high price, basically our
triangular solvers do not do any check (required, i guess, to make
them fast) so the check we do is rather fragile.

This also isn't addressed by letting the user set manually the
precision level: the solve() method would need a separate precision
level than the compute() method, this is very cumbersome.

--> i propose the following change:
in all decompositions that have a solve() checking for existence,
let's rename solve() to solveWithCheck()   (or whatever native English
speakers prefer... perhaps trySolve() ? checkSolve() ? )
then let's add a method solve() that doesn't do any check, making it
the responsibility of the caller that a decent solution exists.

Cheers,
Benoit



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/