Re: [eigen] Reusing a sparse matrix for SparseLU

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


Hi Alberto,

Thanks for the answer. Unfortunately, this still makes me create another array, I'd rather populate the elements directly.

Cheers,

Matthieu

Le lun. 3 déc. 2018 à 10:26, Alberto Luaces <alberto.luaces@xxxxxxxxx> a écrit :
Matthieu Brucher writes:
> Now,, I'd like to reuse the matrix instead of creating a new one, as I'm doing real-time computations and don't want any allocation there.
>
> Can I use the comma operator? Or is there another operator that I can use to update the matrix existing entries? I tried to find information online but couldn't find the best practice for this.
>

Hi, as per

https://stackoverflow.com/questions/40593324/how-to-avoid-memory-allocations-in-sparse-expressions-with-eigen

you can use m.coeffs() to update the non-zero elements of the matrix as
a large array.

--
Alberto




--
Quantitative analyst, Ph.D.
Blog: http://blog.audio-tk.com/
LinkedIn: http://www.linkedin.com/in/matthieubrucher


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