c++ - uBLAS matrix clear memory -


i have ublas matrix, so:

boost::numeric::ublas::matrix<double> mat(50000,50000); 

once i'm done set of calculations on matrix, want memory freed.

i have been using mat.clear() which, according docs, "clears matrix". program keeps running out of memory.

digging headers, find this:

void clear () {   std::fill (data ().begin (), data ().end (), value_type/*zero*/()); } 

so there's clear semantics problem clear().

the question is, how ensure memory freed?

an inelegant way return memory resizing matrix:

mat.resize(0,0,false);   

though have not tried using 0 size value myself...


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -