Class
TMtxVec
A selection will behave exactly as if the object always contained only the selected values. When a selection is made from another object the source object and all operations done on either of the two objects will affect the same elements. The use of selections increases CPU cache reuse, lower's memory requirements, increases application performance and improves code readability.
To again obtain a view of the full vector/matrix use the SelectAll method.
When selecting elements from other objects, care must be given not to use the selections after the source object has been freed:
var a,b: TVec; begin CreateIt(a,b); try a.SetIt(False,[1,2,3,4]); b.Select(a,2,2); FreeIt(a); //free the source object b.Values[0] := b.Valuess[1]; //b does not point to valid memory anymore finally FreeIt(a); end; end;
| Copyright 2008 Dew Research |