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
2193
Karma
15
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: alake, Baidu [Spider], Bing [Bot], boudewijn, donK23, eddiej, Essence of Orange, Exabot [Bot], garthecho, Google [Bot], google01103, GreatEmerald, Hans, jstaniek, ken300, koriun, mutlu, odysseus-art, parzt, rasyalarasati, Sogatori, tadassu, TheraHedwig, Tuukka, Yahoo [Bot]