#include <vctDynamicMatrixRef.h>
Inheritance diagram for vctDynamicMatrixRef< _elementType >:


The class vctDynamicMatrixRef allows to create a matrix overlaying an existing block of memory. It can be used to manipulate a container created by another toolkit (i.e. OpenGL, vtk, ...) or a cisstVector container using different parameters (different size, storage order or stride).
To setup the overlay, one can use either the constructors or the SetRef methods. When used with a cisst container, the SetRef methods can infer some of the memory layout information (pointer on first element, sizes, strides). When used to overlay existing memory referenced by a pointer, the user has to provide all the required information. In any case, the Ref object doesn't allocate nor free memory.
For example to manipulate the first five elements of a matrix, one can do:
vctDynamicMatrix<double> wholeMatrix(10, 10); vctRandom(wholeMatrix, -10.0, 10.0); vctDynamicMatrixRef<double> first5x5; first5x5.SetRef(wholeMatrix, 0, 0, 5, 5); first5x5.SetAll(5.0);
vctDynamicMatrixRef can perform const and non-const operations. It can be initialized with a non-const object only (value_type *). For a const Ref, see vctDynamicConstMatrixRef.
| _elementType | Type of elements referenced. Also defined as value_type. |
Definition at line 77 of file vctDynamicMatrixRef.h.
| other | The matrix to be copied. |
| typedef vctDynamicMatrixRef<_elementType> vctDynamicMatrixRef< _elementType >::ThisType |
Type of the matrix itself.
Reimplemented from vctDynamicMatrixBase< vctDynamicMatrixRefOwner< _elementType >, _elementType >.
Definition at line 85 of file vctDynamicMatrixRef.h.
| typedef vctDynamicMatrixBase<vctDynamicMatrixRefOwner<_elementType>, _elementType> vctDynamicMatrixRef< _elementType >::BaseType |
Type of the base class.
Reimplemented from vctDynamicMatrixBase< vctDynamicMatrixRefOwner< _elementType >, _elementType >.
Definition at line 87 of file vctDynamicMatrixRef.h.
| typedef MatrixOwnerType::iterator vctDynamicMatrixRef< _elementType >::iterator |
Iterator on the elements of the matrix.
Reimplemented from vctDynamicMatrixBase< vctDynamicMatrixRefOwner< _elementType >, _elementType >.
Definition at line 88 of file vctDynamicMatrixRef.h.
| typedef MatrixOwnerType::const_iterator vctDynamicMatrixRef< _elementType >::const_iterator |
Const iterator on the elements of the matrix.
Reimplemented from vctDynamicMatrixBase< vctDynamicMatrixRefOwner< _elementType >, _elementType >.
Definition at line 89 of file vctDynamicMatrixRef.h.
| typedef MatrixOwnerType::reverse_iterator vctDynamicMatrixRef< _elementType >::reverse_iterator |
Reverse iterator on the elements of the matrix.
Reimplemented from vctDynamicMatrixBase< vctDynamicMatrixRefOwner< _elementType >, _elementType >.
Definition at line 90 of file vctDynamicMatrixRef.h.
| typedef MatrixOwnerType::const_reverse_iterator vctDynamicMatrixRef< _elementType >::const_reverse_iterator |
Const reverse iterator on the elements of the matrix.
Reimplemented from vctDynamicMatrixBase< vctDynamicMatrixRefOwner< _elementType >, _elementType >.
Definition at line 91 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | const ThisType & | other | ) | [inline] |
Copy constructor. This copy constructor takes a const reference on the object to copy but has to remove the const-ness of the point to create a vctDynamicMatrixRef and allow it to manipulate elements. The explict use of a const_cast is far from great but there is no easy solution as C++ requires the copy constructor to take a const reference.
Definition at line 103 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | size_type | rows, | |
| size_type | cols, | |||
| stride_type | rowStride, | |||
| stride_type | colStride, | |||
| pointer | dataPointer | |||
| ) | [inline] |
Constructor requiring the user to provide all the necessary information, i.e. the size (number of rows and columns), the strides (increment from row to row and from column to column) as well as a pointer on the first element.
Definition at line 114 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | const nsize_type & | matrixSize, | |
| stride_type | rowStride, | |||
| stride_type | colStride, | |||
| pointer | dataPointer | |||
| ) | [inline] |
Constructor requiring the user to provide all the necessary information, i.e. the size (number of rows and columns), the strides (increment from row to row and from column to column) as well as a pointer on the first element.
Definition at line 120 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | const nsize_type & | matrixSize, | |
| const nstride_type & | matrixStride, | |||
| pointer | dataPointer | |||
| ) | [inline] |
Constructor requiring the user to provide all the necessary information, i.e. the size (number of rows and columns), the strides (increment from row to row and from column to column) as well as a pointer on the first element.
Definition at line 126 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | size_type | rows, | |
| size_type | cols, | |||
| pointer | dataPointer, | |||
| bool | storageOrder = VCT_DEFAULT_STORAGE | |||
| ) | [inline] |
Constructor requiring the user to provide the size of the matrix (number of rows and columns), a pointer on the first element and the desired storage order. If the storage order is omitted, the default is used (row major).
Definition at line 139 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | const nsize_type & | matrixSize, | |
| pointer | dataPointer, | |||
| bool | storageOrder = VCT_DEFAULT_STORAGE | |||
| ) | [inline] |
Constructor requiring the user to provide the size of the matrix (number of rows and columns), a pointer on the first element and the desired storage order. If the storage order is omitted, the default is used (row major).
Definition at line 144 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | vctFixedSizeMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > & | otherMatrix | ) | [inline] |
Construct a dynamic reference to a fixed-size matrix.
Definition at line 157 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | vctFixedSizeMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > & | otherMatrix, | |
| size_type | startRow, | |||
| size_type | startCol, | |||
| size_type | rows, | |||
| size_type | cols | |||
| ) | [inline] |
Construct a dynamic reference to a fixed-size matrix.
| otherMatrix | a fixed size matrix to which a reference is created. | |
| startRow | row index of the position where the reference will start. | |
| startCol | column index of the position where the reference will start. | |
| rows | the number of rows being referenced | |
| cols | the number of columns being referenced |
Definition at line 173 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | vctDynamicMatrixBase< __ownerType, _elementType > & | otherMatrix | ) | [inline] |
Construct a dynamic reference to a dynamic matrix.
Definition at line 185 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | vctDynamicMatrixBase< __ownerType, _elementType > & | otherMatrix, | |
| size_type | startRow, | |||
| size_type | startCol, | |||
| size_type | rows, | |||
| size_type | cols | |||
| ) | [inline] |
Construct a dynamic reference to a submatrix of a dynamic matrix.
| otherMatrix | a dynamic matrix to which a reference is created. | |
| startRow | row index of the position where the reference will start. | |
| startCol | column index of the position where the reference will start. | |
| rows | the number of rows being referenced | |
| cols | the number of columns being referenced |
Definition at line 202 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | size_type | rows, | |
| size_type | cols, | |||
| stride_type | rowStride, | |||
| stride_type | colStride, | |||
| pointer | dataPointer | |||
| ) | [inline] |
Constructor requiring the user to provide all the necessary information, i.e. the size (number of rows and columns), the strides (increment from row to row and from column to column) as well as a pointer on the first element.
Definition at line 114 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | const nsize_type & | matrixSize, | |
| stride_type | rowStride, | |||
| stride_type | colStride, | |||
| pointer | dataPointer | |||
| ) | [inline] |
Constructor requiring the user to provide all the necessary information, i.e. the size (number of rows and columns), the strides (increment from row to row and from column to column) as well as a pointer on the first element.
Definition at line 120 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | const nsize_type & | matrixSize, | |
| const nstride_type & | matrixStride, | |||
| pointer | dataPointer | |||
| ) | [inline] |
Constructor requiring the user to provide all the necessary information, i.e. the size (number of rows and columns), the strides (increment from row to row and from column to column) as well as a pointer on the first element.
Definition at line 126 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | size_type | rows, | |
| size_type | cols, | |||
| pointer | dataPointer, | |||
| bool | storageOrder = VCT_DEFAULT_STORAGE | |||
| ) | [inline] |
Constructor requiring the user to provide the size of the matrix (number of rows and columns), a pointer on the first element and the desired storage order. If the storage order is omitted, the default is used (row major).
Definition at line 139 of file vctDynamicMatrixRef.h.
| vctDynamicMatrixRef< _elementType >::vctDynamicMatrixRef | ( | const nsize_type & | matrixSize, | |
| pointer | dataPointer, | |||
| bool | storageOrder = VCT_DEFAULT_STORAGE | |||
| ) | [inline] |
Constructor requiring the user to provide the size of the matrix (number of rows and columns), a pointer on the first element and the desired storage order. If the storage order is omitted, the default is used (row major).
Definition at line 144 of file vctDynamicMatrixRef.h.
| void vctDynamicMatrixRef< _elementType >::SetRef | ( | size_type | rows, | |
| size_type | cols, | |||
| stride_type | rowStride, | |||
| stride_type | colStride, | |||
| pointer | dataPointer | |||
| ) | [inline] |
Set a dynamic reference to a memory location. The user should specify all the parameters of the referenced memory, including a start memory address.
Definition at line 220 of file vctDynamicMatrixRef.h.
Referenced by nmrSVDEconomyDynamicData::AllocateOutputWorkspace(), nmrSVDDynamicData::AllocateOutputWorkspace(), nmrPInverseEconomyDynamicData::AllocateOutputWorkspace(), nmrPInverseDynamicData::AllocateOutputWorkspace(), nmrNNLSDynamicData::AllocateOutputWorkspaces(), nmrIsOrthonormal(), vctDynamicMatrixRef< CISSTNETLIB_DOUBLE >::SetRef(), nmrSVDEconomyDynamicData::SetRef(), nmrSVDDynamicData::SetRef(), nmrPInverseEconomyDynamicData::SetRef(), nmrPInverseDynamicData::SetRef(), nmrNNLSDynamicData::SetRef(), nmrSVDEconomyDynamicData::SetRefOutput(), nmrSVDDynamicData::SetRefOutput(), nmrPInverseEconomyDynamicData::SetRefOutput(), nmrPInverseDynamicData::SetRefOutput(), nmrNNLSDynamicData::SetRefOutput(), nmrPInverseEconomyDynamicData::SetRefSVD(), nmrPInverseDynamicData::SetRefSVD(), and vctDynamicMatrixRef< CISSTNETLIB_DOUBLE >::vctDynamicMatrixRef().
| void vctDynamicMatrixRef< _elementType >::SetRef | ( | const nsize_type & | matrixSize, | |
| stride_type | rowStride, | |||
| stride_type | colStride, | |||
| pointer | dataPointer | |||
| ) | [inline] |
Set a dynamic reference to a memory location. The user should specify all the parameters of the referenced memory, including a start memory address.
Definition at line 226 of file vctDynamicMatrixRef.h.
| void vctDynamicMatrixRef< _elementType >::SetRef | ( | const nsize_type & | matrixSize, | |
| const nstride_type & | matrixStride, | |||
| pointer | dataPointer | |||
| ) | [inline] |
Set a dynamic reference to a memory location. The user should specify all the parameters of the referenced memory, including a start memory address.
Definition at line 232 of file vctDynamicMatrixRef.h.
| void vctDynamicMatrixRef< _elementType >::SetRef | ( | size_type | rows, | |
| size_type | cols, | |||
| pointer | dataPointer, | |||
| bool | storageOrder = VCT_DEFAULT_STORAGE | |||
| ) | [inline] |
Set a dynamic reference to a memory location. The user should specify the dimension, start memory address and desired storage order. This method assumes there is enough memory and will create a compact matrix reference.
Definition at line 245 of file vctDynamicMatrixRef.h.
| void vctDynamicMatrixRef< _elementType >::SetRef | ( | const nsize_type & | sizes, | |
| pointer | dataPointer, | |||
| bool | storageOrder = VCT_DEFAULT_STORAGE | |||
| ) | [inline] |
Set a dynamic reference to a memory location. The user should specify the dimension, start memory address and desired storage order. This method assumes there is enough memory and will create a compact matrix reference.
Definition at line 250 of file vctDynamicMatrixRef.h.
| void vctDynamicMatrixRef< _elementType >::SetRef | ( | vctFixedSizeMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > & | otherMatrix | ) | [inline] |
Set a dynamic reference to a fixed-size matrix. The reference will have identical dimensions and strides as the input matrix.
Definition at line 261 of file vctDynamicMatrixRef.h.
| void vctDynamicMatrixRef< _elementType >::SetRef | ( | vctFixedSizeMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > & | otherMatrix, | |
| size_type | startRow, | |||
| size_type | startCol, | |||
| size_type | rows, | |||
| size_type | cols | |||
| ) | [inline] |
Set a dynamic reference to a submatrix of a fixed-size matrix.
| otherMatrix | a fixed size matrix to which a reference is created. | |
| startRow | row index of the position where the reference will start. | |
| startCol | column index of the position where the reference will start. | |
| rows | the number of rows being referenced | |
| cols | the number of columns being referenced |
This method verifies that the size of this matrix does not exceed the size of the input matrix (otherwise cmnThrow is used to throw std::out_of_range).
Definition at line 280 of file vctDynamicMatrixRef.h.
| void vctDynamicMatrixRef< _elementType >::SetRef | ( | vctDynamicMatrixBase< __ownerType, _elementType > & | otherMatrix | ) | [inline] |
Set a dynamic reference to a dynamic matrix. The reference will have identical dimensions and strides as the input matrix.
Definition at line 293 of file vctDynamicMatrixRef.h.
| void vctDynamicMatrixRef< _elementType >::SetRef | ( | vctDynamicMatrixBase< __ownerType, _elementType > & | otherMatrix, | |
| size_type | startRow, | |||
| size_type | startCol, | |||
| size_type | rows, | |||
| size_type | cols | |||
| ) | [inline] |
Set a dynamic reference to a submatrix of a dynamic matrix.
| otherMatrix | a dynamic matrix to which a reference is created. | |
| startRow | row index of the position where the reference will start. | |
| startCol | column index of the position where the reference will start. | |
| rows | the number of rows being referenced | |
| cols | the number of columns being referenced |
This method verifies that the size of this matrix does not exceed the size of the input matrix (otherwise cmnThrow is used to throw std::out_of_range).
Definition at line 313 of file vctDynamicMatrixRef.h.
| void vctDynamicMatrixRef< _elementType >::SetRef | ( | vctDynamicMatrixBase< __ownerType, _elementType > & | otherMatrix, | |
| const nsize_type & | start, | |||
| const nsize_type & | matrixSize | |||
| ) | [inline] |
Set a dynamic reference to a submatrix of a dynamic matrix.
| otherMatrix | a dynamic matrix to which a reference is created. | |
| startRow | row index of the position where the reference will start. | |
| startCol | column index of the position where the reference will start. | |
| rows | the number of rows being referenced | |
| cols | the number of columns being referenced |
This method verifies that the size of this matrix does not exceed the size of the input matrix (otherwise cmnThrow is used to throw std::out_of_range).
Definition at line 324 of file vctDynamicMatrixRef.h.
| ThisType& vctDynamicMatrixRef< _elementType >::operator= | ( | const value_type & | value | ) | [inline] |
Assignement of a scalar to all elements. See also SetAll.
Definition at line 353 of file vctDynamicMatrixRef.h.
| void vctDynamicMatrixRef< _elementType >::DeSerializeRaw | ( | std::istream & | inputStream | ) | throw (std::runtime_error) [inline] |
Binary deserialization. This method can not resize the existing block of memory and will throw an exception is the sizes don't match.
Definition at line 361 of file vctDynamicMatrixRef.h.