Re: [eigen] Avoiding memory allocations with triangular solves

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


You should really use .col(l).segment(k,n) on both size to tell Eigen
you are dealing with vectors, and not matrices. A huge speedup as to
be expected :)

gael

On Wed, Jan 4, 2012 at 3:17 AM, Wenzel Jakob <wenzel@xxxxxxxxxx> wrote:
> Hi,
>
> I've run into performance issues when using Eigen to solve linear
> systems with PartialPivLU.
>
> Despite having pre-allocated all memory, the PartialPivLU::solve()
> function appears to perform dynamic memory allocation, which creates a
> bottleneck in my application. The code is structured as follows:
>
> /// Initialization
> Eigen::PartialPivLU<Eigen::MatrixXf>  lu(n);
> lu.compute(...);
>
> while (...) { // main computation done here
>     ...
>     output.block(i, j, n, 1) = lu.solve(input.block(k, l, n, 1));
>     ...
> }
>
> When profiling this code, most time is spent in malloc() and free()
> calls inside Eigen::internal::triangular_solve_matrix.
>
> Hence, I would like to ask how it is possible to avoid dynamic memory
> allocation when solving linear systems using Eigen's decompositions.
>
> Thanks!
> Wenzel
>
>
>



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