Re: [eigen] cache-friendly matrix inverse

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


2009/5/13, Christian Mayer <mail@xxxxxxxxxxxxxxxxx>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Benoit Jacob schrieb:
>> whenever they show up; then the best thing you can do is to precompute
>> A^-1 so you only have a matrix-vector product to compute whenever a
>> "b" vector shows up.
>
> That's *exacly* what LU decomposition is for. Compute it once and use it
> to solve the equation many times.
> Note: the amount of operations to calculate A^-1 and an LU decomposition
> is the same. *AND* using a LU to solve the equation (foreward and
> backward substitution) takes also as many operations as a matrix
> multiplication (i.e. exactly the same as a multiplication with the inverse)

Good point. I think you're right for very large sizes, asymptotically
they're the same.
But matrix-vector product is far easier to optimize than triangular
solver, and incurs less "startup" overhead, i'm thinking e.g. about
the pivoting permutation that you have to apply when using the LU with
partial pivoting to solve the equation, and also regarding
vectorization the triangular solver has more "unaligned boundaries" to
deal with. For large enough sizes that should be negligible.

But for a size like 10x10, the matrix-vector product will be much faster.

Cheers,
Benoit



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