This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Repetitive initialization of the same sparse matrix

Tags: None
(comma "," separated)
Tarek
Registered Member
Posts
12
Karma
0
My program requires repetitive initialization of the same sparse matrix. What is the best method to reset a sparse matrix in terms of minimizing the leftover memory footprint ? For example, is it a good practice to destroy it, and re-initialize every time?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
It's surprising but it's often the fastest approach. Which method do you use to set the nonzero values: setFromTriplets()? or something else?
Tarek
Registered Member
Posts
12
Karma
0
My main concern is not the speed, but minimizing the memory leakage. By the way, how can I destroy an Eigen sparse matrix?
I don't set the number of nonzero elements apriori, (would it be better to set it in terms of memory leakage?)
Thanks


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot]