Reply to topic

Memory Allocation

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
2678
Karma
16
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);

 
Reply to topic

Bookmarks



Who is online

Registered users: almateo, Baidu [Spider], Bing [Bot], Exabot [Bot], glorianharman, Google [Bot], joaob, ken300, koriun, Majestic-12 [Bot], MSNbot Media, paulus3005, petehuffington, quickkk, sdh, siegmundwolf, Yahoo [Bot]