geometry-processing-mesh-reconstruction icon indicating copy to clipboard operation
geometry-processing-mesh-reconstruction copied to clipboard

Sparse Matrix filling efficiency

Open liupeiLu opened this issue 7 years ago • 2 comments

Hello,

I would like to know is there any speed difference between coeffRef(i,j) and mat.setFromTriplets(tripletList.begin(), tripletList.end()) for filling eigen sparse matrices? Currently I am using the former but it took a very long time to run the interpolate function.

Thanks for the help!

liupeiLu avatar Sep 27 '18 04:09 liupeiLu

setFromTriplets should be faster.

You can also run in release mode to speed things up.

alecjacobson avatar Sep 27 '18 13:09 alecjacobson

setFromTriplets is mush faster, thank you!

liupeiLu avatar Sep 27 '18 21:09 liupeiLu