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

Memory Allocation

Tags: None
(comma "," separated)
johnsiner
Registered Member
Posts
1
Karma
0

Memory Allocation

Mon Nov 12, 2012 12:47 pm
I was wondering how to deallocate the memory used in Eigen. For example if I create the following matrix:

MatrixXd test = MatrixXd(1000,1000);

How would I free the memory allocated to test? Thanks!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Memory Allocation

Tue Nov 13, 2012 8:13 pm
The memory will be automatically freed when "test" will be deleted, e.g.:
Code: Select all
void foo() {
  ....
  {
      MatrixXd test = MatrixXd(1000,1000);
      ....
   }
   // at this stage test has been automatically deleted and freed
   ....
}


You can also call test.resize(0,0);


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]