|
LTL
2.0.x
|
Memory and data access interface for ltl::FVMemory. More...
Inherited by ltl::FVector< bool, NPAR >, ltl::FVector< double, N >, ltl::FVector< TPAR, NPAR >, and ltl::FVector< T, N, S >.
Public Member Functions | |
| FVMemory () | |
| FVMemory (T *const data) | |
construct as a reference to the memory pointed to by data. More... | |
| T * | data () |
| Return a pointer to the data. More... | |
| T * | data () const |
| Return a const pointer to the data. More... | |
| T | operator[] (const int i) const |
Access elements with zero-based index i. More... | |
| T & | operator[] (const int i) |
Access elements with zero-based index i. More... | |
| T | operator() (const int i) const |
Access elements with one-based index i. More... | |
| T & | operator() (const int i) |
Access elements with one-based index i. More... | |
Protected Attributes | |
| T * | __data_ |
| points to first element of data block for 0-based access More... | |
Memory and data access interface for ltl::FVMemory.
The ltl::FVMemory objects implement the memory access interface of the ltl::FVector object, i.e. operator() for 1-based access and operator[] for 0-based access. References N objects of type T accessible through a T* with stride S.
The template parameter S is the stride which may be != 1, such that column vectors of ltl::FVMatrix can be referenced as ltl::FVector objects.
There is a general implementation (this one) and a specialization for S=0. S!=0 indicates that this instance is a reference to foreign storage. S is then the stride used to access the memory elements. The specialization for S=0 below is used for instances that hold there own memory (i.e. ltl::FVector objects) that have their own memory, not references to other ltl::FVector objects. In this case the physical stride is one.
FVMemory does not require more memory than is necessary to store the N elements of the vector if S=0. If S>0, the size is exactly sizeof(T*).
|
inline |
|
inline |
construct as a reference to the memory pointed to by data.
|
inline |
Access elements with zero-based index i.
|
inline |
Access elements with zero-based index i.
|
inline |
Access elements with one-based index i.
|
inline |
Access elements with one-based index i.
|
inline |
Return a pointer to the data.
|
inline |
Return a const pointer to the data.
|
protected |
points to first element of data block for 0-based access
Referenced by ltl::FVMemory< bool, N, S >::data(), ltl::FVMemory< T, N, 0 >::data(), ltl::FVMemory< bool, N, S >::operator()(), ltl::FVMemory< T, N, 0 >::operator()(), ltl::FVMemory< bool, N, S >::operator[](), and ltl::FVMemory< T, N, 0 >::operator[]().
1.8.5