22 #ifndef _vctDynamicConstNArrayRef_h
23 #define _vctDynamicConstNArrayRef_h
88 template <
class _elementType, vct::
size_type _dimension>
110 this->
SetRef(0, nsize_type(0), nstride_type(0));
125 this->
SetRef(dataPointer, sizes, strides);
133 this->
SetRef(dataPointer, sizes, strides);
139 template <
class __ownerType>
142 this->
SetRef(otherNArray);
148 template <
class __ownerType>
157 template <
size_type __size, str
ide_type __str
ide,
typename __dataPtrType>
166 template <
class __ownerType>
175 template <
size_type __rows,
size_type __cols, str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
typename __dataPtrType>
177 __rowStride, __colStride,
178 value_type, __dataPtrType>
190 this->
NArray.
SetRef( const_cast<pointer>(dataPointer), sizes, strides );
196 template <
class __ownerType>
209 template <
class __ownerType>
211 const nsize_type & startPosition,
212 const nsize_type & lengths)
225 template <
class __ownerType>
227 const ndimension_type & dimensions)
232 const typename ndimension_type::const_iterator dimensionsBegin = dimensions.begin();
233 const typename ndimension_type::const_iterator dimensionsEnd = dimensions.end();
234 typename ndimension_type::const_iterator dimensionsIter;
235 typename nsize_type::iterator sizesIter = sizes.begin();
236 typename nstride_type::iterator stridesIter = strides.begin();
237 for (dimensionsIter = dimensionsBegin;
238 dimensionsIter != dimensionsEnd;
239 ++dimensionsIter, ++sizesIter, ++stridesIter) {
240 *sizesIter = otherNArray.
size(*dimensionsIter);
241 *stridesIter = otherNArray.
stride(*dimensionsIter);
255 template <
class __ownerType>
266 typedef typename OtherArrayType::nsize_type other_nsize_type;
267 typedef typename OtherArrayType::nstride_type other_nstride_type;
270 const typename other_nsize_type::const_iterator otherSizesBegin = otherNArray.
sizes().begin();
271 typename other_nsize_type::const_iterator otherSizesIter;
272 const typename other_nstride_type::const_iterator otherStridesBegin = otherNArray.
strides().begin();
273 typename other_nstride_type::const_iterator otherStridesIter;
274 const typename nsize_type::iterator sizesBegin = sizes.begin();
275 const typename nsize_type::iterator sizesEnd = sizes.end();
276 typename nsize_type::iterator sizesIter;
277 const typename nstride_type::iterator stridesBegin = strides.begin();
278 typename nstride_type::iterator stridesIter;
281 otherSizesIter = otherSizesBegin;
282 otherStridesIter = otherStridesBegin;
283 sizesIter = sizesBegin;
284 stridesIter = stridesBegin;
286 while (sizesIter != sizesEnd) {
287 if (i == dimension) {
292 *sizesIter = *otherSizesIter;
293 *stridesIter = *otherStridesIter;
304 other_nsize_type startPosition(static_cast<size_type>(0));
312 template <
class __ownerType>
321 template <
size_type __size, str
ide_type __str
ide,
typename __dataPtrType>
324 this->
SetRef( vector.
Pointer(), nsize_type(__size), nstride_type(__stride) );
330 template <
class __ownerType>
334 nsize_type(matrix.
rows(), matrix.
cols()),
341 template <
size_type __rows,
size_type __cols, str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
typename __dataPtrType>
344 this->
SetRef(matrix.Pointer(),
345 nsize_type(__rows, __cols),
346 nstride_type(__rowStride, __colStride));
351 #endif // _vctDynamicConstNArrayRef_h
A template for a fixed size matrix with fixed spacing in memory.
Definition: vctFixedSizeConstMatrixBase.h:103
#define CMN_ASSERT(expr)
Definition: cmnAssert.h:90
dimension_type dimension(void) const
Definition: vctDynamicConstNArrayBase.h:332
vctDynamicConstNArrayRef(const vctDynamicConstNArrayBase< __ownerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicConstNArrayRef.h:140
const nsize_type & sizes(void) const
Definition: vctDynamicConstNArrayBase.h:308
NArrayOwnerType::const_reverse_iterator const_reverse_iterator
Definition: vctDynamicConstNArrayRef.h:105
void SetRef(const vctDynamicConstNArrayBase< __ownerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicConstNArrayRef.h:197
void SliceOf(const vctDynamicConstNArrayBase< __ownerType, value_type, DIMENSION+1 > &otherNArray, dimension_type dimension, size_type index)
Definition: vctDynamicConstNArrayRef.h:256
vctDynamicConstNArrayRef(const vctDynamicConstMatrixBase< __ownerType, value_type > &matrix)
Definition: vctDynamicConstNArrayRef.h:167
Definition: vctDynamicConstNArrayRef.h:94
const_pointer Pointer(void) const
Definition: vctDynamicConstNArrayBase.h:436
vctDynamicConstNArrayBase< vctDynamicNArrayRefOwner< _elementType, DIMENSION >, _elementType, DIMENSION > BaseType
Definition: vctDynamicConstNArrayRef.h:101
Definition: vctDynamicConstNArrayBase.h:155
vctDynamicConstNArrayRef(pointer dataPointer, const nsize_type &sizes, const nstride_type &strides)
Definition: vctDynamicConstNArrayRef.h:131
void SetRef(const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &vector)
Definition: vctDynamicConstNArrayRef.h:322
vctDynamicConstNArrayRef(const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
Definition: vctDynamicConstNArrayRef.h:176
size_t size_type
Definition: vctContainerTraits.h:35
bool LesserOrEqual(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
Definition: vctDynamicConstNArrayBase.h:816
vctDynamicConstNArrayRef(const_pointer dataPointer, const nsize_type &sizes, const nstride_type &strides)
Definition: vctDynamicConstNArrayRef.h:123
void SetRef(const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
Definition: vctDynamicConstNArrayRef.h:342
void SetRef(const_pointer dataPointer, const nsize_type &sizes, const nstride_type &strides)
Definition: vctDynamicConstNArrayRef.h:188
Dynamic nArray referencing existing memory (const)
Definition: vctDynamicConstNArrayRef.h:89
Definition: vctDynamicConstMatrixBase.h:77
Definition: vctDynamicNArrayRefOwner.h:36
NArrayOwnerType::const_iterator const_iterator
Definition: vctDynamicConstNArrayRef.h:103
size_type size(void) const
Definition: vctDynamicConstVectorBase.h:164
Definition: vctForwardDeclarations.h:77
void SetRef(const vctDynamicConstVectorBase< __ownerType, value_type > &vector)
Definition: vctDynamicConstNArrayRef.h:313
size_type rows() const
Definition: vctDynamicConstMatrixBase.h:238
size_type cols() const
Definition: vctDynamicConstMatrixBase.h:243
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
const_pointer Pointer(size_type index=0) const
Definition: vctFixedSizeConstVectorBase.h:268
difference_type stride() const
Definition: vctDynamicConstVectorBase.h:169
const_pointer Pointer(index_type rowIndex, index_type colIndex) const
Definition: vctDynamicConstMatrixBase.h:306
vctDynamicConstNArrayRef< _elementType, DIMENSION > ThisType
Definition: vctDynamicConstNArrayRef.h:99
vctDynamicConstNArrayRef(const ThisType &other)
Definition: vctDynamicConstNArrayRef.h:114
void SetRef(const vctDynamicConstMatrixBase< __ownerType, value_type > &matrix)
Definition: vctDynamicConstNArrayRef.h:331
void PermutationOf(const vctDynamicConstNArrayBase< __ownerType, value_type, DIMENSION > &otherNArray, const ndimension_type &dimensions)
Definition: vctDynamicConstNArrayRef.h:226
const_pointer Pointer(index_type index=0) const
Definition: vctDynamicConstVectorBase.h:221
void SubarrayOf(const vctDynamicConstNArrayBase< __ownerType, value_type, DIMENSION > &otherNArray, const nsize_type &startPosition, const nsize_type &lengths)
Definition: vctDynamicConstNArrayRef.h:210
NArrayOwnerType::iterator iterator
Definition: vctDynamicConstNArrayRef.h:102
vctDynamicConstNArrayRef()
Definition: vctDynamicConstNArrayRef.h:108
Definition: vctForwardDeclarations.h:74
size_type size(void) const
Definition: vctDynamicConstNArrayBase.h:302
Definition: vctDynamicConstVectorBase.h:77
difference_type row_stride() const
Definition: vctDynamicConstMatrixBase.h:263
const nstride_type & strides(void) const
Definition: vctDynamicConstNArrayBase.h:320
A template for a fixed length vector with fixed spacing in memory.
Definition: vctFixedSizeConstVectorBase.h:107
difference_type col_stride() const
Definition: vctDynamicConstMatrixBase.h:268
VCT_NARRAY_TRAITS_TYPEDEFS(DIMENSION)
OwnerType NArray
Definition: vctDynamicConstNArrayBase.h:227
vctDynamicConstNArrayRef(const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &vector)
Definition: vctDynamicConstNArrayRef.h:158
difference_type stride(dimension_type dimension) const
Definition: vctDynamicConstNArrayBase.h:326
void SetRef(pointer data, const nsize_type &sizes, const nstride_type &strides)
Definition: vctDynamicNArrayRefOwner.h:67
vctDynamicNArrayRefOwner< _elementType, DIMENSION > NArrayOwnerType
Definition: vctDynamicConstNArrayRef.h:100
NArrayOwnerType::reverse_iterator reverse_iterator
Definition: vctDynamicConstNArrayRef.h:104
vctDynamicConstNArrayRef(const vctDynamicConstVectorBase< __ownerType, value_type > &vector)
Definition: vctDynamicConstNArrayRef.h:149
Declaration of vctDynamicConstNArrayBase.
Declaration of vctDynamicNArrayRefOwner.