AboutDownloadsDocumentsForumsSource CodeIssuesNews
Date:
2005-07-14 04:19
Priority:
4
State:
Open
Submitted by:
Michael Sherman (sherm)
Assigned to:
Michael Sherman (sherm)
Summary:
assignment to data-shared Vector can incorrectly re-allocate memory

Detailed description
A Vector or Matrix which has been defined borrowing memory from somewhere else should never reallocate upon assignment; it should act like a view onto the borrowed data. The following code segment resulted in locAsScalar showing loc's data before assignment, and the correct value after assignment, but loc did not change.

Vector_<Vec3>& loc = locEntry.updValue();
Vector locAsScalar(3*loc.size(), &loc[0][0], true); // share space
locAsScalar = getQ(s);

Add A Comment: Notepad

No Comments Have Been Posted

No Changes Have Been Made to This Item

Feedback