[Insight-users] memory overlapping with vnl_vector !
Devalkeneer Arnaud
arnauddebelgique at yahoo.com
Mon May 23 05:30:20 EDT 2005
Hi,
I have a memory allocation problem when I use
vnl_vector class. The created vector overlaps a array
allocated dynamically. Here are actions of my program
:
"
// allocation of array
bf.mask_z = new unsigned [NbOfSlices];
// For example, NbOfSlices = 88;
// Then I fill in this array. For example,
// bf.mask_z[1] is egal to 120
// Creation of vnl_vector
vnl_vector<double> rhs(bf.mask_tot,0.0);
// bf.mask_tot is an "unsigned" and for exemple is
// egal to 102600 (unsigned is coded through 4 bytes
// in my system...)
// then if I test for example bf.mask_z[1], and it is
// egal to 0, the initialization value of rhs !
// Evidently I don't change the values of bf.mask_z
"
My question is this one : is there a control memory
mecanism when a vnl_vector is created? I hope that
yes! Also, is there a problem in my program?
Thanks a lot in advance for your help.
Arnaud Devalkeneer.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Insight-users
mailing list