cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Friends | List of all members
vctDynamicMatrix< _elementType > Class Template Reference

A matrix object of dynamic size. More...

#include <vctDynamicMatrix.h>

Inheritance diagram for vctDynamicMatrix< _elementType >:
vctDynamicMatrixBase< vctDynamicMatrixOwner< _elementType >, _elementType > vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > mtsMatrix< _elementType > vctReturnDynamicMatrix< _elementType >

Public Types

enum  { DIMENSION = 2 }
 
typedef vctDynamicMatrixBase
< vctDynamicMatrixOwner
< _elementType >, _elementType > 
BaseType
 
typedef vctDynamicMatrix
< _elementType > 
ThisType
 
- Public Types inherited from vctDynamicMatrixBase< vctDynamicMatrixOwner< _elementType >, _elementType >
typedef vctDynamicMatrixBase ThisType
 
typedef
vctDynamicConstMatrixBase
< vctDynamicMatrixOwner
< _elementType >, _elementType > 
BaseType
 
typedef vctDynamicMatrixOwner
< _elementType > 
OwnerType
 
typedef BaseType::iterator iterator
 
typedef BaseType::reverse_iterator reverse_iterator
 
typedef BaseType::const_iterator const_iterator
 
typedef
BaseType::const_reverse_iterator 
const_reverse_iterator
 
typedef BaseType::ConstRowRefType ConstRowRefType
 
typedef BaseType::RowRefType RowRefType
 
typedef
BaseType::ConstColumnRefType 
ConstColumnRefType
 
typedef BaseType::ColumnRefType ColumnRefType
 
typedef
BaseType::ConstDiagonalRefType 
ConstDiagonalRefType
 
typedef BaseType::DiagonalRefType DiagonalRefType
 
typedef
BaseType::ConstRefTransposeType 
ConstRefTransposeType
 
typedef BaseType::RefTransposeType RefTransposeType
 
typedef
BaseType::ConstVectorPointerType 
ConstVectorPointerType
 
typedef BaseType::VectorPointerType VectorPointerType
 
- Public Types inherited from vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >
enum  { DIMENSION = 2 }
 
typedef
vctDynamicConstMatrixBase
< _matrixOwnerType,
_elementType > 
ThisType
 
typedef _matrixOwnerType OwnerType
 
typedef OwnerType::iterator iterator
 
typedef OwnerType::const_iterator const_iterator
 
typedef OwnerType::reverse_iterator reverse_iterator
 
typedef
OwnerType::const_reverse_iterator 
const_reverse_iterator
 
typedef
vctDynamicConstVectorRef
< _elementType > 
ConstRowRefType
 
typedef vctDynamicVectorRef
< _elementType > 
RowRefType
 
typedef
vctDynamicConstVectorRef
< _elementType > 
ConstColumnRefType
 
typedef vctDynamicVectorRef
< _elementType > 
ColumnRefType
 
typedef
vctDynamicConstVectorRef
< _elementType > 
ConstDiagonalRefType
 
typedef vctDynamicVectorRef
< _elementType > 
DiagonalRefType
 
typedef
vctDynamicConstMatrixRef
< _elementType > 
ConstRefTransposeType
 
typedef vctDynamicMatrixRef
< _elementType > 
RefTransposeType
 
typedef vctDynamicMatrix
< _elementType > 
TransposeValueType
 
typedef vctDynamicMatrix
< _elementType > 
MatrixValueType
 
typedef vctReturnDynamicMatrix
< _elementType > 
MatrixReturnType
 
typedef cmnTypeTraits< value_type > TypeTraits
 
typedef TypeTraits::BoolType BoolType
 
typedef vctReturnDynamicMatrix
< BoolType
BoolMatrixReturnType
 
typedef vctDynamicVector
< const_pointer > 
ConstVectorPointerType
 
typedef vctDynamicVector< pointer > VectorPointerType
 

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
 VCT_NARRAY_TRAITS_TYPEDEFS (DIMENSION)
 
 vctDynamicMatrix ()
 
 vctDynamicMatrix (const vctReturnDynamicMatrix< value_type > &otherMatrix)
 
 vctDynamicMatrix (const ThisType &otherMatrix)
 
template<class __matrixOwnerType , typename __otherMatrixElementType >
 vctDynamicMatrix (const vctDynamicConstMatrixBase< __matrixOwnerType, __otherMatrixElementType > &otherMatrix, bool storageOrder)
 
template<class __matrixOwnerType >
 vctDynamicMatrix (const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &otherMatrix)
 
template<class __matrixOwnerType , typename __otherMatrixElementType >
 vctDynamicMatrix (const vctDynamicConstMatrixBase< __matrixOwnerType, __otherMatrixElementType > &otherMatrix)
 
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, class __elementType , class __dataPtrType >
 vctDynamicMatrix (const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
 
template<class __matrixOwnerType , typename __elementType >
ThisTypeoperator= (const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &otherMatrix)
 
ThisTypeoperator= (const ThisType &otherMatrix)
 
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, class __elementType , class __dataPtrType >
ThisTypeoperator= (const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
 
ThisTypeoperator= (const vctReturnDynamicMatrix< value_type > &otherMatrix)
 
ThisTypeoperator= (const value_type &value)
 
template<class __matrixOwnerType , typename __elementType >
ThisTypeForceAssign (const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &other)
 
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, class __elementType , class __dataPtrType >
ThisTypeForceAssign (const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
 
void DeSerializeRaw (std::istream &inputStream)
 
template<class _elementType >
 vctDynamicMatrix (const vctReturnDynamicMatrix< _elementType > &other)
 
template<class _elementType >
vctDynamicMatrix< _elementType > & operator= (const vctReturnDynamicMatrix< _elementType > &other)
 
 vctDynamicMatrix (size_type rows, size_type cols, bool storageOrder=VCT_DEFAULT_STORAGE)
 
 vctDynamicMatrix (const nsize_type &matrixSize, bool storageOrder=VCT_DEFAULT_STORAGE)
 
 vctDynamicMatrix (size_type rows, size_type cols, value_type value, bool storageOrder=VCT_DEFAULT_STORAGE)
 
 vctDynamicMatrix (const nsize_type &matrixSize, value_type value, bool storageOrder=VCT_DEFAULT_STORAGE)
 
void resize (size_type rows, size_type cols)
 
void resize (const nsize_type &newSizes)
 
void SetSize (size_type rows, size_type cols, bool storageOrder)
 
void SetSize (const nsize_type &matrixSize, bool storageOrder)
 
void SetSize (size_type rows, size_type cols)
 
void SetSize (const nsize_type &matrixSize)
 
- Public Member Functions inherited from vctDynamicMatrixBase< vctDynamicMatrixOwner< _elementType >, _elementType >
 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
reverse_iterator rbegin (void)
 
const_reverse_iterator rbegin (void) const
 
reverse_iterator rend (void)
 
const_reverse_iterator rend (void) const
 
RowRefType operator[] (size_type index)
 
ConstRowRefType operator[] (size_type index) const
 
const OwnerTypeOwner (void) const
 
OwnerTypeOwner (void)
 
pointer Pointer (size_type rowIndex, size_type colIndex)
 
pointer Pointer (void)
 
const_pointer Pointer (size_type rowIndex, size_type colIndex) const
 
const_pointer Pointer (void) const
 
reference at (size_type index) throw (std::out_of_range)
 
const_reference at (size_type index) const throw (std::out_of_range)
 
reference at (size_type rowIndex, size_type colIndex) throw (std::out_of_range)
 
const_reference at (size_type rowIndex, size_type colIndex) const throw (std::out_of_range)
 
reference operator() (size_type rowIndex, size_type colIndex) throw (std::out_of_range)
 
const_reference operator() (size_type rowIndex, size_type colIndex) const throw (std::out_of_range)
 
reference Element (size_type rowIndex, size_type colIndex)
 
const_reference Element (size_type rowIndex, size_type colIndex) const
 
void RowPermutationOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &inputMatrix, const index_type permutedRowIndexes[])
 
void RowInversePermutationOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &inputMatrix, const index_type permutedRowIndexes[])
 
void ColumnPermutationOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &inputMatrix, const index_type permutedColumnIndexes[])
 
void ColumnInversePermutationOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &inputMatrix, const index_type permutedColumnIndexes[])
 
value_type SetAll (const value_type value)
 
bool Zeros (void)
 
ThisTypeAssign (const value_type *elements, bool inputIsRowMajor=true)
 
ThisTypeAssign (const value_type element0,...)
 
RefTransposeType TransposeRef (void)
 
ConstRefTransposeType TransposeRef (void) const
 
void ProductOf (const vctDynamicConstMatrixBase< __matrixOwnerType1, _elementType > &matrix1, const vctDynamicConstMatrixBase< __matrixOwnerType2, _elementType > &matrix2)
 
ThisTypeAddProductOf (const value_type scalar, const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeAddElementwiseProductOf (const vctDynamicConstMatrixBase< __matrixOwnerType1, _elementType > &matrix1, const vctDynamicConstMatrixBase< __matrixOwnerType2, _elementType > &matrix2)
 
void OuterProductOf (const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &colVector, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &rowVector)
 
RowRefType Row (size_type index) throw (std::out_of_range)
 
ConstRowRefType Row (size_type index) const throw (std::out_of_range)
 
ColumnRefType Column (size_type index) throw (std::out_of_range)
 
ConstColumnRefType Column (size_type index) const throw (std::out_of_range)
 
DiagonalRefType Diagonal (void)
 
ConstDiagonalRefType Diagonal (void) const
 
VectorPointerTypeRowPointers (VectorPointerType &rowPointers) throw (std::runtime_error)
 
ConstVectorPointerType RowPointers (ConstVectorPointerType &rowPointers) const throw (std::runtime_error)
 
vctDynamicMatrixRef< _elementType > Ref (const size_type rows, const size_type cols, const size_type startRow=0, const size_type startCol=0) throw (std::out_of_range)
 
vctDynamicConstMatrixRef
< _elementType > 
Ref (const size_type rows, const size_type cols, const size_type startRow=0, const size_type startCol=0) const throw (std::out_of_range)
 
void ExchangeRows (const size_type row1Index, const size_type row2Index)
 
void ExchangeColumns (const size_type col1Index, const size_type col2Index)
 
void SelectRowsFrom (const vctDynamicConstMatrixBase< __inputMatrixOwnerType, _elementType > &inputMatrix, const vctDynamicConstVectorBase< __indexVectorOwnerType, index_type > &rowIndexVector)
 
void SelectColsFrom (const vctDynamicConstMatrixBase< __inputMatrixOwnerType, _elementType > &inputMatrix, const vctDynamicConstVectorBase< __indexVectorOwnerType, index_type > &colIndexVector)
 
ThisTypeAssign (const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &other)
 
ThisTypeAssign (const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &other)
 
ThisTypeAssign (const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
 
ThisTypeoperator= (const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &other)
 
ThisTypeForceAssign (const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &other)
 
ThisTypeForceAssign (const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
 
bool FastCopyOf (const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &source, bool performSafetyChecks=vctFastCopy::PerformChecks) throw (std::runtime_error)
 
bool FastCopyOf (const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, value_type, __dataPtrType > &source, bool performSafetyChecks=vctFastCopy::PerformChecks) throw (std::runtime_error)
 
ThisTypeSumOf (const vctDynamicConstMatrixBase< __matrixOwnerType1, _elementType > &matrix1, const vctDynamicConstMatrixBase< __matrixOwnerType2, _elementType > &matrix2)
 
ThisTypeDifferenceOf (const vctDynamicConstMatrixBase< __matrixOwnerType1, _elementType > &matrix1, const vctDynamicConstMatrixBase< __matrixOwnerType2, _elementType > &matrix2)
 
ThisTypeElementwiseProductOf (const vctDynamicConstMatrixBase< __matrixOwnerType1, _elementType > &matrix1, const vctDynamicConstMatrixBase< __matrixOwnerType2, _elementType > &matrix2)
 
ThisTypeElementwiseRatioOf (const vctDynamicConstMatrixBase< __matrixOwnerType1, _elementType > &matrix1, const vctDynamicConstMatrixBase< __matrixOwnerType2, _elementType > &matrix2)
 
ThisTypeElementwiseMinOf (const vctDynamicConstMatrixBase< __matrixOwnerType1, _elementType > &matrix1, const vctDynamicConstMatrixBase< __matrixOwnerType2, _elementType > &matrix2)
 
ThisTypeElementwiseMaxOf (const vctDynamicConstMatrixBase< __matrixOwnerType1, _elementType > &matrix1, const vctDynamicConstMatrixBase< __matrixOwnerType2, _elementType > &matrix2)
 
ThisTypeAdd (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeSubtract (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeElementwiseMultiply (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeElementwiseDivide (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeElementwiseMin (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeElementwiseMax (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeoperator+= (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeoperator-= (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeSumOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type scalar)
 
ThisTypeDifferenceOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type scalar)
 
ThisTypeProductOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type scalar)
 
ThisTypeRatioOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type scalar)
 
ThisTypeClippedAboveOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type lowerBound)
 
ThisTypeClippedBelowOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type upperBound)
 
ThisTypeSumOf (const value_type scalar, const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix)
 
ThisTypeDifferenceOf (const value_type scalar, const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix)
 
ThisTypeProductOf (const value_type scalar, const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix)
 
ThisTypeRatioOf (const value_type scalar, const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix)
 
ThisTypeClippedAboveOf (const value_type upperBound, const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix)
 
ThisTypeClippedBelowOf (const value_type lowerBound, const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix)
 
ThisTypeAdd (const value_type scalar)
 
ThisTypeSubtract (const value_type scalar)
 
ThisTypeoperator+= (const value_type scalar)
 
ThisTypeoperator-= (const value_type scalar)
 
ThisTypeMultiply (const value_type scalar)
 
ThisTypeDivide (const value_type scalar)
 
ThisTypeClipAbove (const value_type upperBound)
 
ThisTypeClipBelow (const value_type lowerBound)
 
ThisTypeoperator*= (const value_type scalar)
 
ThisTypeoperator/= (const value_type scalar)
 
ThisTypeAbsOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeNegationOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeFloorOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeCeilOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeTransposeOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
 
ThisTypeAbsSelf (void)
 
ThisTypeNegationSelf (void)
 
ThisTypeFloorSelf (void)
 
ThisTypeCeilSelf (void)
 
- Public Member Functions inherited from vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >
 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
 VCT_NARRAY_TRAITS_TYPEDEFS (DIMENSION)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
const_reverse_iterator rbegin (void) const
 
const_reverse_iterator rend (void) const
 
size_type size (void) const
 
const nsize_type & sizes (void) const
 
size_type rows () const
 
size_type cols () const
 
size_type height () const
 
size_type width () const
 
const nstride_type & strides (void) const
 
difference_type row_stride () const
 
difference_type col_stride () const
 
bool empty () const
 
ConstRowRefType operator[] (size_type index) const
 
const_reference at (size_type index) const throw (std::out_of_range)
 
const OwnerTypeOwner (void) const
 
const_pointer Pointer (index_type rowIndex, index_type colIndex) const
 
const_pointer Pointer (void) const
 
bool ValidIndex (size_type index) const
 
bool ValidIndex (size_type rowIndex, size_type colIndex) const
 
bool ValidRowIndex (size_type rowIndex) const
 
bool ValidColIndex (size_type colIndex) const
 
const_reference at (size_type rowIndex, size_type colIndex) const throw (std::out_of_range)
 
const_reference operator() (size_type rowIndex, size_type colIndex) const throw (std::out_of_range)
 
const_reference Element (size_type rowIndex, size_type colIndex) const
 
ConstRowRefType Row (size_type index) const throw (std::out_of_range)
 
ConstColumnRefType Column (size_type index) const throw (std::out_of_range)
 
ConstDiagonalRefType Diagonal () const
 
ConstVectorPointerTypeRowPointers (ConstVectorPointerType &rowPointers) const throw (std::runtime_error)
 
vctDynamicConstMatrixRef
< _elementType > 
Ref (const size_type rows, const size_type cols, const size_type startRow=0, const size_type startCol=0) const throw (std::out_of_range)
 
ConstRefTransposeType TransposeRef (void) const
 
MatrixReturnType Transpose () const
 
std::string ToString (void)
 
void ToStream (std::ostream &outputStream) const
 
void ToStreamRaw (std::ostream &outputStream, const char delimiter= ' ', bool headerOnly=false, const std::string &headerPrefix="") const
 
void SerializeRaw (std::ostream &outputStream) const
 
value_type SumOfElements (void) const
 
value_type ProductOfElements (void) const
 
value_type Trace (void) const
 
value_type NormSquare (void) const
 
NormType Norm (void) const
 
value_type L1Norm (void) const
 
value_type LinfNorm (void) const
 
value_type MaxElement (void) const
 
value_type MinElement (void) const
 
value_type MaxAbsElement (void) const
 
value_type MinAbsElement (void) const
 
void MinAndMaxElement (value_type &minElement, value_type &maxElement) const
 
bool IsPositive (void) const
 
bool IsNonNegative (void) const
 
bool IsNonPositive (void) const
 
bool IsNegative (void) const
 
bool All (void) const
 
bool Any (void) const
 
bool IsFinite (void) const
 
bool HasNaN (void) const
 
bool IsColMajor (void) const
 
bool IsRowMajor (void) const
 
bool IsCompact (void) const
 
bool IsFortran (void) const
 
bool StorageOrder (void) const
 
bool IsSquare (void) const
 
bool IsSquare (size_type size) const
 
template<class __matrixOwnerType >
bool FastCopyCompatible (const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &source) const
 
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, class __dataPtrType >
bool FastCopyCompatible (const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, value_type, __dataPtrType > &source) const
 
template<class __matrixOwnerType >
bool Equal (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
bool operator== (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
bool AlmostEqual (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix, value_type tolerance) const
 
template<class __matrixOwnerType >
bool AlmostEqual (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
bool NotEqual (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
bool operator!= (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
bool Lesser (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
bool LesserOrEqual (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
bool Greater (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
bool GreaterOrEqual (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
BoolMatrixReturnType ElementwiseEqual (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
BoolMatrixReturnType ElementwiseNotEqual (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
BoolMatrixReturnType ElementwiseLesser (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
BoolMatrixReturnType ElementwiseLesserOrEqual (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
BoolMatrixReturnType ElementwiseGreater (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
template<class __matrixOwnerType >
BoolMatrixReturnType ElementwiseGreaterOrEqual (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
 
bool Equal (const value_type &scalar) const
 
bool operator== (const value_type &scalar) const
 
bool NotEqual (const value_type &scalar) const
 
bool operator!= (const value_type &scalar) const
 
bool Lesser (const value_type &scalar) const
 
bool LesserOrEqual (const value_type &scalar) const
 
bool Greater (const value_type &scalar) const
 
bool GreaterOrEqual (const value_type &scalar) const
 
BoolMatrixReturnType ElementwiseEqual (const value_type &scalar) const
 
BoolMatrixReturnType ElementwiseNotEqual (const value_type &scalar) const
 
BoolMatrixReturnType ElementwiseLesser (const value_type &scalar) const
 
BoolMatrixReturnType ElementwiseLesserOrEqual (const value_type &scalar) const
 
BoolMatrixReturnType ElementwiseGreater (const value_type &scalar) const
 
BoolMatrixReturnType ElementwiseGreaterOrEqual (const value_type &scalar) const
 
MatrixReturnType Abs (void) const
 
MatrixReturnType Negation (void) const
 
MatrixReturnType Floor (void) const
 
MatrixReturnType Ceil (void) const
 

Friends

class vctReturnDynamicMatrix< _elementType >
 

Additional Inherited Members

- Static Public Member Functions inherited from vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >
static MatrixReturnType Eye (size_type size)
 
- Protected Member Functions inherited from vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >
void ThrowUnlessValidIndex (size_type index) const throw (std::out_of_range)
 
void ThrowUnlessValidIndex (size_type rowIndex, size_type colIndex) const throw (std::out_of_range)
 
void ThrowUnlessValidRowIndex (size_type index) const throw (std::out_of_range)
 
void ThrowUnlessValidColIndex (size_type index) const throw (std::out_of_range)
 
- Protected Attributes inherited from vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >
OwnerType Matrix
 

Detailed Description

template<class _elementType>
class vctDynamicMatrix< _elementType >

A matrix object of dynamic size.

This class defines a matrix object of dynamic size with memory allocation.

The algebraic operations are mostly inherited from the base classes vctDynamicMatrixBase and vctDynamicConstMatrixBase. Here, we will briefly describe the specific properties of vctDynamicMatrix, with a few usage examples.

  1. The class is templated by its element type, that is, the matrix element. Normally, the element should be an arithmetic type, that is, support all the standard arithmetic operations: +, -, *, /, =, ==, <, >, <=, >=, ...
  2. The class uses dynamically allocated memory, and, more importantly, owns the memory. That is, a vctDynamicMatrix object automatically frees the allocated memory it owns when it is destroyed.
  3. To allocate the memory, use one of the following operations.
    // define a typical element type
    typedef double ElementType;
    // the matrixRows and matrixCols variables can be set to any value at
    // any time before creating the matrix.
    size_t matrixRows = 12;
    size_t matrixCols = 9;
    // constructor allocation
    vctDynamicMatrix<ElementType> m1(matrixRows, matrixCols);
    // Create an empty matrix and later allocate memory.
    m2.SetSize(matrixRows, matrixCols);
    // Create a dynamic matrix of some size and then change it.
    // This operation does not preserve any elements in the resized
    // matrix
    vctDynamicMatrix<Elements> m3(3 * matrixRows, 3 * matrixCols);
    m3.SetSize(2 * matrixRows, 2 * matrixCols);
    // resize a matrix and keep as many elements as possible.
    m3.resize(matrixRows, matrixCols);
    // Store an algebraic result to a new matrix. In this case,
    // memory is allocated by the algebraic operation, and then
    // attached to the matrix object.
  4. The default storage order is row first. This can be modified using the different constructors as well as the method SetSize with the flags VCT_ROW_MAJOR or VCT_COL_MAJOR.
    // 12 by 7 matrix stored column first
    // a similar matrix filled with zeroes
    // resize the matrix and change its storage order
    m1.SetSize(5, 7, VCT_ROW_MAJOR);
  5. Matrix assignment can be facilitated through the Assign method (defined in the base class) or as follows.
    // Initialize all elements to the same value
    vctDynamicMatrix<ElementType> v5(matrixRows, matrixCols, 2.0);
    // Initialize the elements by specific values. NOTE: All the
    // arguments MUST be of type ElementType
    matrix.Assign(7.0, 1.0, 2.0, 3.0,
    4.0, 5.0, 6.0, 7.0); // correct
    matrix.Assign(7, 1, 2, 3,
    4, 5, 6, 7); // WRONG, missing dot
    // Assign one matrix to another.
    matrixInt.Assign(matrix);
    matrixInt = matrix; // same operation

A few more notes.

Parameters
_elementTypethe type of an element in the matrix
See Also
vctDynamicMatrixBase vctDynamicConstMatrixBase

Member Typedef Documentation

template<class _elementType>
typedef vctDynamicMatrixBase<vctDynamicMatrixOwner<_elementType>, _elementType> vctDynamicMatrix< _elementType >::BaseType
template<class _elementType>
typedef vctDynamicMatrix<_elementType> vctDynamicMatrix< _elementType >::ThisType

Member Enumeration Documentation

template<class _elementType>
anonymous enum
Enumerator
DIMENSION 

Constructor & Destructor Documentation

template<class _elementType>
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( )
inline

Default constructor. Initialize an empty matrix.

template<class _elementType>
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( size_type  rows,
size_type  cols,
bool  storageOrder = VCT_DEFAULT_STORAGE 
)
inline
template<class _elementType>
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( const nsize_type &  matrixSize,
bool  storageOrder = VCT_DEFAULT_STORAGE 
)
inline
template<class _elementType>
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( size_type  rows,
size_type  cols,
value_type  value,
bool  storageOrder = VCT_DEFAULT_STORAGE 
)
inline

Constructor: Create a matrix of the specified size and assign all elements a specific value. The storage order can be either VCT_ROW_MAJOR or VCT_COL_MAJOR.

template<class _elementType>
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( const nsize_type &  matrixSize,
value_type  value,
bool  storageOrder = VCT_DEFAULT_STORAGE 
)
inline
template<class _elementType>
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( const vctReturnDynamicMatrix< value_type > &  otherMatrix)

Special copy constructor: Take ownership of the data of a temporary matrix object of type vctReturnDynamicMatrix. Disown the other matrix.

template<class _elementType>
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( const ThisType otherMatrix)
inline

Copy constructor: Allocate memory to store a copy of the other matrix, and copy the elements of the other matrix to this matrix.

template<class _elementType>
template<class __matrixOwnerType , typename __otherMatrixElementType >
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( const vctDynamicConstMatrixBase< __matrixOwnerType, __otherMatrixElementType > &  otherMatrix,
bool  storageOrder 
)
inline

Copy constructor: Allocate memory and copy all the elements from the other matrix. The storage order can be either VCT_ROW_MAJOR or VCT_COL_MAJOR.

template<class _elementType>
template<class __matrixOwnerType >
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &  otherMatrix)
inline

Copy constructor: Allocate memory and copy all the elements from the other matrix. The storage order of the copied matrix is defined by the source matrix.

template<class _elementType>
template<class __matrixOwnerType , typename __otherMatrixElementType >
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( const vctDynamicConstMatrixBase< __matrixOwnerType, __otherMatrixElementType > &  otherMatrix)
inlineexplicit

Copy constructor: Allocate memory and copy all the elements from the other matrix. The storage order of the copied matrix is defined by the source matrix. This constructor can also be used for type conversions.

template<class _elementType>
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, class __elementType , class __dataPtrType >
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, __elementType, __dataPtrType > &  other)
inlineexplicit

Constructor from a fixed size matrix.

template<class _elementType>
template<class _elementType >
vctDynamicMatrix< _elementType >::vctDynamicMatrix ( const vctReturnDynamicMatrix< _elementType > &  other)

Member Function Documentation

template<class _elementType>
void vctDynamicMatrix< _elementType >::DeSerializeRaw ( std::istream &  inputStream)
inline

Binary deserialization

template<class _elementType>
template<class __matrixOwnerType , typename __elementType >
ThisType& vctDynamicMatrix< _elementType >::ForceAssign ( const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &  other)
inline
template<class _elementType>
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, class __elementType , class __dataPtrType >
ThisType& vctDynamicMatrix< _elementType >::ForceAssign ( const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, __elementType, __dataPtrType > &  other)
inline
template<class _elementType>
template<class __matrixOwnerType , typename __elementType >
ThisType& vctDynamicMatrix< _elementType >::operator= ( const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &  otherMatrix)
inline

Assignment from a dynamic matrix to a matrix. The operation discards the old memory allocated for this matrix, and allocates new memory the size of the input matrix. Then the elements of the input matrix are copied into this matrix.

Todo:
This assumes a row major storage. Needs more work.
template<class _elementType>
ThisType& vctDynamicMatrix< _elementType >::operator= ( const ThisType otherMatrix)
inline

Assignment from a dynamic matrix to this matrix. The operation discards the old memory allocated for this matrix, and allocates new memory the size of the input matrix. Then the elements of the input matrix are copied into this matrix.

template<class _elementType>
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, class __elementType , class __dataPtrType >
ThisType& vctDynamicMatrix< _elementType >::operator= ( const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, __elementType, __dataPtrType > &  other)
inline

Assignment from a fixed size matrix. This operator will resize the left side dynamic matrix to match the right side fixed size matrix.

template<class _elementType>
ThisType& vctDynamicMatrix< _elementType >::operator= ( const vctReturnDynamicMatrix< value_type > &  otherMatrix)

Assignement from a transitional vctReturnDynamicMatrix to a vctDynamicMatrix variable. This specialized operation does not perform any element copy. Instead it transfers ownership of the data from the other matrix to this matrix, and disowns the other matrix. The right hand side operand must be a temporary object returned, e.g., from a function or overloaded operator.

Todo:
This operator needs some revisions.
template<class _elementType>
ThisType& vctDynamicMatrix< _elementType >::operator= ( const value_type &  value)
inline

Assignement of a scalar to all elements. See also SetAll.

template<class _elementType>
template<class _elementType >
vctDynamicMatrix<_elementType>& vctDynamicMatrix< _elementType >::operator= ( const vctReturnDynamicMatrix< _elementType > &  other)
template<class _elementType>
void vctDynamicMatrix< _elementType >::resize ( size_type  rows,
size_type  cols 
)
inline

Non-destructive size change. Change the size to the specified size, and preserve as many rows and columns as possible from the former matrix.

Note
If the storage order and the sizes (both rows and columns) are unchanged, this method does nothing.
This method doesn't allow to change the storage order of the elements (i.e. stays either row or column major).
If the size is set to zero, the data pointer is set to null (0).
template<class _elementType>
void vctDynamicMatrix< _elementType >::resize ( const nsize_type &  newSizes)
inline
template<class _elementType>
void vctDynamicMatrix< _elementType >::SetSize ( size_type  rows,
size_type  cols,
bool  storageOrder 
)
inline

DESTRUCTIVE size change. Change the size to the specified size. Discard of all the old values. The storage order can be either VCT_ROW_MAJOR or VCT_COL_MAJOR. If the storage order is not specified, it is not modified.

template<class _elementType>
void vctDynamicMatrix< _elementType >::SetSize ( const nsize_type &  matrixSize,
bool  storageOrder 
)
inline
template<class _elementType>
void vctDynamicMatrix< _elementType >::SetSize ( size_type  rows,
size_type  cols 
)
inline
template<class _elementType>
void vctDynamicMatrix< _elementType >::SetSize ( const nsize_type &  matrixSize)
inline
template<class _elementType>
vctDynamicMatrix< _elementType >::VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType  )
template<class _elementType>
vctDynamicMatrix< _elementType >::VCT_NARRAY_TRAITS_TYPEDEFS ( DIMENSION  )

Friends And Related Function Documentation

template<class _elementType>
friend class vctReturnDynamicMatrix< _elementType >
friend

The documentation for this class was generated from the following file: