20 #ifndef _vctDynamicMatrixRef_h
21 #define _vctDynamicMatrixRef_h
73 template <
class _elementType>
114 SetRef(rows, cols, rowStride, colStride, dataPointer);
120 SetRef(matrixSize, rowStride, colStride, dataPointer);
126 SetRef(matrixSize, matrixStride, dataPointer);
138 SetRef(rows, cols, dataPointer, storageOrder);
143 SetRef(matrixSize, dataPointer, storageOrder);
153 template <
size_type __rows,
size_type __cols, str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
typename __dataPtrType>
169 template <
size_type __rows,
size_type __cols, str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
typename __dataPtrType>
173 SetRef(otherMatrix, startRow, startCol, rows, cols);
181 template <
class __ownerType>
198 template <
class __ownerType>
202 SetRef(otherMatrix, startRow, startCol, rows, cols);
205 template <
class __ownerType>
207 const nsize_type & start,
const nsize_type & matrixSize)
209 SetRef(otherMatrix, start, matrixSize);
219 pointer dataPointer) {
220 this->
Matrix.
SetRef(rows, cols, rowStride, colStride, dataPointer);
223 void SetRef(
const nsize_type & matrixSize,
225 pointer dataPointer) {
226 this->
Matrix.
SetRef(matrixSize, rowStride, colStride, dataPointer);
229 void SetRef(
const nsize_type & matrixSize,
230 const nstride_type & matrixStride,
231 pointer dataPointer) {
232 this->
Matrix.
SetRef(matrixSize, matrixStride, dataPointer);
244 this->
Matrix.
SetRef(rows, cols, dataPointer, storageOrder);
257 template <
size_type __rows,
size_type __cols, str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
typename __dataPtrType>
260 SetRef(otherMatrix.rows(), otherMatrix.cols(), otherMatrix.row_stride(), otherMatrix.col_stride(),
276 template <
size_type __rows,
size_type __cols, str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
typename __dataPtrType>
280 if ( (startRow + rows > otherMatrix.rows()) || (startCol + cols > otherMatrix.cols()) ) {
281 cmnThrow(std::out_of_range(
"vctDynamicMatrixRef SetRef out of range"));
283 SetRef(rows, cols, otherMatrix.row_stride(), otherMatrix.col_stride(), otherMatrix.
Pointer(startRow, startCol));
289 template <
class __ownerType>
309 template <
class __ownerType>
313 if ( (startRow + rows > otherMatrix.
rows()) || (startCol + cols > otherMatrix.
cols()) ) {
314 cmnThrow(std::out_of_range(
"vctDynamicMatrixRef SetRef out of range"));
317 otherMatrix.
Pointer(startRow, startCol));
320 template <
class __ownerType>
322 const nsize_type & start,
const nsize_type & matrixSize)
325 start.
Element(0), start.Element(1), matrixSize.Element(0), matrixSize.Element(1));
343 template <
class __matrixOwnerType,
typename __elementType>
348 template <
size_type __rows,
size_type __cols, str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
typename __dataPtrType>
371 if ((myRows != this->
rows()) || (myCols != this->
cols())) {
372 cmnThrow(std::runtime_error(
"vctDynamicMatrixRef::DeSerializeRaw: Sizes of matrices don't match"));
377 for (indexRow = 0; indexRow < myRows; ++indexRow) {
378 for (indexCol = 0; indexCol < myCols; ++indexCol) {
392 template <
class _resultVectorOwnerType,
class _matrixOwnerType,
class _vectorOwnerType,
class _elementType>
403 resultRef.
ProductOf(matrix, inputVectorRef);
407 template <
class _resultVectorOwnerType,
class _vectorOwnerType,
class _matrixOwnerType,
class _elementType>
418 resultRef.
ProductOf(inputVectorRef, matrix);
422 #endif // _vctDynamicMatrixRef_h
A template for a fixed size matrix with fixed spacing in memory.
Definition: vctFixedSizeConstMatrixBase.h:103
void vctMultiplyVectorMatrix(vctDynamicVectorBase< _resultVectorOwnerType, _elementType > &result, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix)
Definition: vctDynamicMatrixRef.h:409
void vctMultiplyMatrixVector(vctDynamicVectorBase< _resultVectorOwnerType, _elementType > &result, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector)
Definition: vctDynamicMatrixRef.h:394
VCT_NARRAY_TRAITS_TYPEDEFS(DIMENSION)
vctDynamicMatrixRef(size_type rows, size_type cols, pointer dataPointer, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition: vctDynamicMatrixRef.h:136
Definition: vctDynamicMatrixBase.h:42
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
vctDynamicMatrixBase< vctDynamicMatrixRefOwner< _elementType >, _elementType > BaseType
Definition: vctDynamicMatrixRef.h:84
vctDynamicMatrixRef(const ThisType &other)
Definition: vctDynamicMatrixRef.h:100
void SetRef(vctFixedSizeMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > &otherMatrix)
Definition: vctDynamicMatrixRef.h:258
vctDynamicMatrixRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix, size_type startRow, size_type startCol, size_type rows, size_type cols)
Definition: vctDynamicMatrixRef.h:199
OwnerType Matrix
Definition: vctDynamicConstMatrixBase.h:167
size_t size_type
Definition: vctContainerTraits.h:35
const bool VCT_DEFAULT_STORAGE
Definition: vctForwardDeclarations.h:49
const nstride_type & strides(void) const
Definition: vctDynamicConstMatrixBase.h:258
Dynamic matrix referencing existing memory.
Definition: vctDynamicMatrixRef.h:74
Declaration of vctDynamicConstMatrixRef.
ThisType & operator=(const ThisType &other)
Definition: vctDynamicMatrixRef.h:335
ThisType & ProductOf(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type scalar)
Definition: vctDynamicMatrixBase.h:971
Definition: vctDynamicConstMatrixBase.h:77
vctDynamicMatrixRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix, const nsize_type &start, const nsize_type &matrixSize)
Definition: vctDynamicMatrixRef.h:206
vctDynamicMatrixRef()
Definition: vctDynamicMatrixRef.h:90
vctDynamicMatrixRef(size_type rows, size_type cols, stride_type rowStride, stride_type colStride, pointer dataPointer)
Definition: vctDynamicMatrixRef.h:111
void SetRef(size_type rows, size_type cols, pointer dataPointer, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition: vctDynamicMatrixRef.h:242
size_type size(void) const
Definition: vctDynamicConstVectorBase.h:164
void SetRef(size_type rows, size_type cols, stride_type rowStride, stride_type colStride, pointer dataPointer)
Definition: vctDynamicMatrixRef.h:217
A template for a fixed size matrix with fixed spacings in memory.
Definition: vctFixedSizeMatrixBase.h:58
MatrixOwnerType::reverse_iterator reverse_iterator
Definition: vctDynamicMatrixRef.h:87
vctDynamicMatrixRef(const nsize_type &matrixSize, const nstride_type &matrixStride, pointer dataPointer)
Definition: vctDynamicMatrixRef.h:123
MatrixOwnerType::const_iterator const_iterator
Definition: vctDynamicMatrixRef.h:86
vctDynamicMatrixRef(const nsize_type &matrixSize, pointer dataPointer, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition: vctDynamicMatrixRef.h:141
Definition: vctDynamicMatrixRef.h:79
pointer Pointer(size_type rowIndex, size_type colIndex)
Definition: vctDynamicMatrixBase.h:143
void DeSerializeRaw(std::istream &inputStream)
Definition: vctDynamicMatrixRef.h:363
Dynamic matrix referencing existing memory (const)
Definition: vctDynamicConstMatrixRef.h:79
void SetRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix, size_type startRow, size_type startCol, size_type rows, size_type cols)
Definition: vctDynamicMatrixRef.h:310
value_type SetAll(const value_type value)
Definition: vctDynamicMatrixBase.h:452
void SetRef(const nsize_type &matrixSize, const nstride_type &matrixStride, pointer dataPointer)
Definition: vctDynamicMatrixRef.h:229
vctDynamicMatrixRef(vctFixedSizeMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > &otherMatrix, size_type startRow, size_type startCol, size_type rows, size_type cols)
Definition: vctDynamicMatrixRef.h:170
void cmnDeSerializeRaw(std::istream &inputStream, _elementType &data)
Definition: cmnDeSerializer.h:82
size_type rows() const
Definition: vctDynamicConstMatrixBase.h:238
size_type cols() const
Definition: vctDynamicConstMatrixBase.h:243
Declaration of vctDynamicMatrixBase.
difference_type stride() const
Definition: vctDynamicConstVectorBase.h:169
const_pointer Pointer(index_type rowIndex, index_type colIndex) const
Definition: vctDynamicConstMatrixBase.h:306
#define cmnThrow(a)
Definition: MinimalCmn.h:4
reference Element(size_type rowIndex, size_type colIndex)
Definition: vctDynamicMatrixBase.h:214
vctDynamicMatrixRef< _elementType > ThisType
Definition: vctDynamicMatrixRef.h:82
const_pointer Pointer(index_type index=0) const
Definition: vctDynamicConstVectorBase.h:221
pointer Pointer(index_type index=0)
Definition: vctDynamicVectorBase.h:155
Definition: vctDynamicMatrixRefOwner.h:39
MatrixOwnerType::const_reverse_iterator const_reverse_iterator
Definition: vctDynamicMatrixRef.h:88
ThisType & Assign(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &other)
Definition: vctDynamicMatrixBase.h:509
void SetRef(const nsize_type &sizes, pointer dataPointer, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition: vctDynamicMatrixRef.h:247
void SetRef(vctFixedSizeMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > &otherMatrix, size_type startRow, size_type startCol, size_type rows, size_type cols)
Definition: vctDynamicMatrixRef.h:277
ptrdiff_t stride_type
Definition: vctContainerTraits.h:37
Definition: vctDynamicConstVectorBase.h:77
difference_type row_stride() const
Definition: vctDynamicConstMatrixBase.h:263
difference_type col_stride() const
Definition: vctDynamicConstMatrixBase.h:268
void SetRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix)
Definition: vctDynamicMatrixRef.h:290
vctDynamicMatrixRef(const nsize_type &matrixSize, stride_type rowStride, stride_type colStride, pointer dataPointer)
Definition: vctDynamicMatrixRef.h:117
void SetRef(size_type rows, size_type cols, pointer dataPointer, bool storageOrder)
Definition: vctDynamicMatrixRefOwner.h:74
Definition: vctVarStrideMatrixIterator.h:40
void SetRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix, const nsize_type &start, const nsize_type &matrixSize)
Definition: vctDynamicMatrixRef.h:321
vctDynamicMatrixRefOwner< _elementType > MatrixOwnerType
Definition: vctDynamicMatrixRef.h:83
const nsize_type & sizes(void) const
Definition: vctDynamicConstMatrixBase.h:233
MatrixOwnerType::iterator iterator
Definition: vctDynamicMatrixRef.h:85
Definition: vctVarStrideMatrixIterator.h:287
vctDynamicMatrixRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix)
Definition: vctDynamicMatrixRef.h:182
pointer Pointer(size_type rowIndex, size_type colIndex)
Definition: vctFixedSizeMatrixBase.h:161
void SetRef(const nsize_type &matrixSize, stride_type rowStride, stride_type colStride, pointer dataPointer)
Definition: vctDynamicMatrixRef.h:223
Definition: vctDynamicVectorBase.h:61
vctDynamicMatrixRef(vctFixedSizeMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > &otherMatrix)
Definition: vctDynamicMatrixRef.h:154