void Select
Resets the selection.
Result: stored in self (calling object)
This method is the same as the Dew.Math.TOpenCLMtxVec.SelectAll method.
Indexed: void Select(Int32 Index, Int32 Len)
Selects a set of elements from the vector.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Int32 | start index |
| 2 | Len | Int32 | element count |
Result: stored in self (calling object)
The method will define a subarray starting at Index and ending at Index+Len-1. No copying will occur, only pointers will be shifted.
All values of the original Dew.Math.TMtxVec will be preserved. An exception will be raised if an attempt is made to change the size of the calling object after a selection has been made.
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 Dew.Math.TOpenCLMtxVec.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: TOpenCLVector;
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;