20#ifndef _vctDynamicMatrixRef_h
21#define _vctDynamicMatrixRef_h
73template <
class _elementType>
103 SetRef(other.sizes(), other.strides(),
const_cast<pointer
>(other.
Pointer()));
120 SetRef(matrixSize, rowStride, colStride, dataPointer);
126 SetRef(matrixSize, matrixStride, dataPointer);
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>
171 size_type startRow, size_type startCol, size_type
rows, size_type
cols)
181 template <
class __ownerType>
198 template <
class __ownerType>
200 size_type startRow, size_type startCol, size_type
rows, size_type
cols)
205 template <
class __ownerType>
207 const nsize_type & start,
const nsize_type & matrixSize)
209 SetRef(otherMatrix, start, matrixSize);
218 stride_type rowStride, stride_type colStride,
219 pointer dataPointer) {
223 void SetRef(
const nsize_type & matrixSize,
224 stride_type rowStride, stride_type colStride,
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);
257 template <
size_type __rows,
size_type __cols, str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
typename __dataPtrType>
276 template <
size_type __rows,
size_type __cols, str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
typename __dataPtrType>
278 size_type startRow, size_type startCol, size_type
rows, size_type
cols)
280 if ( (startRow +
rows > otherMatrix.
rows()) || (startCol +
cols > otherMatrix.
cols()) ) {
281 cmnThrow(std::out_of_range(
"vctDynamicMatrixRef SetRef out of range"));
289 template <
class __ownerType>
292 SetRef(otherMatrix.rows(), otherMatrix.cols(), otherMatrix.row_stride(), otherMatrix.col_stride(),
309 template <
class __ownerType>
311 size_type startRow, size_type startCol, size_type
rows, size_type
cols)
313 if ( (startRow +
rows > otherMatrix.rows()) || (startCol +
cols > otherMatrix.cols()) ) {
314 cmnThrow(std::out_of_range(
"vctDynamicMatrixRef SetRef out of range"));
316 SetRef(
rows,
cols, otherMatrix.row_stride(), otherMatrix.col_stride(),
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"));
376 size_type indexRow, indexCol;
377 for (indexRow = 0; indexRow < myRows; ++indexRow) {
378 for (indexCol = 0; indexCol < myCols; ++indexCol) {
392template <
class _resultVectorOwnerType,
class _matrixOwnerType,
class _vectorOwnerType,
class _elementType>
403 resultRef.
ProductOf(matrix, inputVectorRef);
407template <
class _resultVectorOwnerType,
class _vectorOwnerType,
class _matrixOwnerType,
class _elementType>
418 resultRef.
ProductOf(inputVectorRef, matrix);
Definition vctForwardDeclarations.h:145
Dynamic matrix referencing existing memory (const).
Definition vctDynamicConstMatrixRef.h:81
Definition vctForwardDeclarations.h:119
Definition vctDynamicMatrixBase.h:43
pointer Pointer(size_type rowIndex, size_type colIndex)
Definition vctDynamicMatrixBase.h:143
ThisType & Assign(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &other)
Definition vctDynamicMatrixBase.h:509
reference Element(size_type rowIndex, size_type colIndex)
Definition vctDynamicMatrixBase.h:214
value_type SetAll(const value_type value)
Definition vctDynamicMatrixBase.h:452
ThisType & ProductOf(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type scalar)
Definition vctDynamicMatrixBase.h:971
Dynamic matrix referencing existing memory.
Definition vctDynamicMatrixRef.h:75
vctDynamicMatrixRef(const ThisType &other)
Definition vctDynamicMatrixRef.h:100
vctDynamicMatrixBase< vctDynamicMatrixRefOwner< value_type >, value_type > BaseType
Definition vctDynamicMatrixRef.h:84
vctDynamicMatrixRef(size_type rows, size_type cols, pointer dataPointer, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition vctDynamicMatrixRef.h:136
void DeSerializeRaw(std::istream &inputStream) CISST_THROW(std
Definition vctDynamicMatrixRef.h:363
void SetRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix, size_type startRow, size_type startCol, size_type rows, size_type cols)
Definition vctDynamicMatrixRef.h:310
vctDynamicMatrixRefOwner< value_type > MatrixOwnerType
Definition vctDynamicMatrixRef.h:83
void SetRef(const nsize_type &matrixSize, stride_type rowStride, stride_type colStride, pointer dataPointer)
Definition vctDynamicMatrixRef.h:223
VCT_NARRAY_TRAITS_TYPEDEFS(DIMENSION)
void SetRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix, const nsize_type &start, const nsize_type &matrixSize)
Definition vctDynamicMatrixRef.h:321
vctDynamicMatrixRef(size_type rows, size_type cols, stride_type rowStride, stride_type colStride, pointer dataPointer)
Definition vctDynamicMatrixRef.h:111
@ DIMENSION
Definition vctDynamicMatrixRef.h:79
MatrixOwnerType::const_iterator const_iterator
Definition vctDynamicMatrixRef.h:86
MatrixOwnerType::const_reverse_iterator const_reverse_iterator
Definition vctDynamicMatrixRef.h:88
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
vctDynamicMatrixRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix)
Definition vctDynamicMatrixRef.h:182
vctDynamicMatrixRef(const nsize_type &matrixSize, stride_type rowStride, stride_type colStride, pointer dataPointer)
Definition vctDynamicMatrixRef.h:117
MatrixOwnerType::iterator iterator
Definition vctDynamicMatrixRef.h:85
void SetRef(size_type rows, size_type cols, stride_type rowStride, stride_type colStride, pointer dataPointer)
Definition vctDynamicMatrixRef.h:217
vctDynamicMatrixRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix, size_type startRow, size_type startCol, size_type rows, size_type cols)
Definition vctDynamicMatrixRef.h:199
void SetRef(const nsize_type &sizes, pointer dataPointer, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition vctDynamicMatrixRef.h:247
void SetRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix)
Definition vctDynamicMatrixRef.h:290
vctDynamicMatrixRef()
Definition vctDynamicMatrixRef.h:90
ThisType & operator=(const ThisType &other)
Definition vctDynamicMatrixRef.h:335
void SetRef(vctFixedSizeMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > &otherMatrix)
Definition vctDynamicMatrixRef.h:258
vctDynamicMatrixRef< value_type > ThisType
Definition vctDynamicMatrixRef.h:82
vctDynamicMatrixRef(vctFixedSizeMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > &otherMatrix)
Definition vctDynamicMatrixRef.h:154
void SetRef(size_type rows, size_type cols, pointer dataPointer, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition vctDynamicMatrixRef.h:242
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
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
MatrixOwnerType::reverse_iterator reverse_iterator
Definition vctDynamicMatrixRef.h:87
vctDynamicMatrixRef(const nsize_type &matrixSize, pointer dataPointer, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition vctDynamicMatrixRef.h:141
vctDynamicMatrixRef(const nsize_type &matrixSize, const nstride_type &matrixStride, pointer dataPointer)
Definition vctDynamicMatrixRef.h:123
void SetRef(const nsize_type &matrixSize, const nstride_type &matrixStride, pointer dataPointer)
Definition vctDynamicMatrixRef.h:229
vctDynamicMatrixRef(vctDynamicMatrixBase< __ownerType, _elementType > &otherMatrix, const nsize_type &start, const nsize_type &matrixSize)
Definition vctDynamicMatrixRef.h:206
Definition vctDynamicMatrixRefOwner.h:40
vctVarStrideMatrixIterator< value_type > reverse_iterator
Definition vctDynamicMatrixRefOwner.h:53
vctVarStrideMatrixConstIterator< value_type > const_reverse_iterator
Definition vctDynamicMatrixRefOwner.h:51
vctVarStrideMatrixConstIterator< value_type > const_iterator
Definition vctDynamicMatrixRefOwner.h:50
vctVarStrideMatrixIterator< value_type > iterator
Definition vctDynamicMatrixRefOwner.h:52
void SetRef(size_type rows, size_type cols, pointer dataPointer, bool storageOrder)
Definition vctDynamicMatrixRefOwner.h:74
Definition vctDynamicVectorBase.h:62
pointer Pointer(index_type index=0)
Definition vctDynamicVectorBase.h:155
A template for a fixed size matrix with fixed spacing in memory.
Definition vctFixedSizeConstMatrixBase.h:104
size_type cols() const
Definition vctFixedSizeConstMatrixBase.h:282
difference_type row_stride() const
Definition vctFixedSizeConstMatrixBase.h:303
size_type rows() const
Definition vctFixedSizeConstMatrixBase.h:277
difference_type col_stride() const
Definition vctFixedSizeConstMatrixBase.h:309
A template for a fixed size matrix with fixed spacings in memory.
Definition vctFixedSizeMatrixBase.h:60
pointer Pointer(size_type rowIndex, size_type colIndex)
Definition vctFixedSizeMatrixBase.h:161
void cmnDeSerializeRaw(std::istream &inputStream, _elementType &data) CISST_THROW(std
Definition cmnDeSerializer.h:82
#define CISST_THROW(exceptionParameter)
Somewhat portable compilation warning message. This works with very recent versions of gcc (4....
Definition cmnPortability.h:559
void cmnThrow(const _exceptionType &except, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR)
Definition cmnThrow.h:76
size_type cols() const
Definition vctDynamicConstMatrixBase.h:243
OwnerType Matrix
Definition vctDynamicConstMatrixBase.h:167
const nsize_type & sizes(void) const
Definition vctDynamicConstMatrixBase.h:233
size_type rows() const
Definition vctDynamicConstMatrixBase.h:238
Declaration of vctDynamicConstMatrixRef.
Declaration of vctDynamicMatrixBase.
void vctMultiplyMatrixVector(vctDynamicVectorBase< _resultVectorOwnerType, _elementType > &result, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector)
Definition vctDynamicMatrixRef.h:394
void vctMultiplyVectorMatrix(vctDynamicVectorBase< _resultVectorOwnerType, _elementType > &result, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix)
Definition vctDynamicMatrixRef.h:409
const bool VCT_DEFAULT_STORAGE
Definition vctForwardDeclarations.h:47