Re: [eigen] Why no LU::solveInPlace()?

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


We definitely have to uniformize that, but actually we could also
consider removing all the solveInPlace functions...

Indeed, when you write:

X = A.lu().solve(X);

Eigen automatically performs the solve operation inplace, just like it
would do with :

A.lu().solveInPlace(X);

Advantages:
- simpler API: only one function
- works fine with writable temporary objects, e.g., X.col(j) =
A.lu().solve(X.col(j));

Drawbacks:
- need to write the "source" and "destination" object twice
- requires one runtime test (one pointer comparison which is disabled
at compile time if the types do not match).

Recall that to make the solveInPlace() function to work with writable
temporary objects we either have to declare the argument as a const
reference or enforce the user to name the temporary that can be a real
pain without the C++1x auto keyword.

What other people think about it?

gael

On Mon, Aug 16, 2010 at 4:21 PM, Manoj Rajagopalan <rmanoj@xxxxxxxxx> wrote:
> Hi,
>
>   I see LLT::solveInPlace() and ei_inplace_solve() for LU but no
> LU::solveInPlace(). Could this member function be considered for inclusion at
> least for a uniform API?
>
> cheers!
> Manoj
>
>
>



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