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

Eigen Matrix destructor (freeing the memory)

Tags: None
(comma "," separated)
mehrdadh
Registered Member
Posts
26
Karma
0
I would like to deallocate the memory for a matrix before the scope of that variable is ended. I have seen that there is no free() or clear() or erase() or any other explicit function available in Eigen to do that ?

I think the solution to that is to do myMatrix.resize(0,0)

but I would like to know if there is another better way ? and if NOT, then I hope nothing bad happens when the variable goes out of scope with size=0 !!?

Thanks
User avatar
bjacob
Registered Member
Posts
658
Karma
3
resize(0,0) is the only way to do that, and nothing bad happens when the matrix goes out of scope.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]