cisst-saw
Loading...
Searching...
No Matches
vctDynamicConstMatrixBase.h File Reference

Declaration of vctDynamicConstMatrixBase. More...

Go to the source code of this file.

Classes

class  ConstSubmatrix

Macros

#define _vctDynamicConstMatrixBase_h

Typedefs

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_typeTypeTraits
typedef TypeTraits::BoolType BoolType
typedef vctReturnDynamicMatrix< BoolTypeBoolMatrixReturnType
typedef vctDynamicVector< const_pointer > ConstVectorPointerType
typedef vctDynamicVector< pointer > VectorPointerType

Enumerations

enum  { DIMENSION = 2 }

Functions

template<class _matrixOwnerType, class __matrixOwnerType, class _elementType, class _elementOperationType>
vctReturnDynamicMatrix< bool > vctDynamicMatrixElementwiseCompareMatrix (const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix1, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix2)
template<class _matrixOwnerType, class _elementType, class _elementOperationType>
vctReturnDynamicMatrix< bool > vctDynamicMatrixElementwiseCompareScalar (const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix, const _elementType &scalar)
 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 An implementation of the ``abstract'' vctFixedSizeConstMatrixBase.
 VCT_NARRAY_TRAITS_TYPEDEFS (DIMENSION)
void ThrowUnlessValidIndex (size_type index) const CISST_THROW(std
void ThrowUnlessValidIndex (size_type rowIndex, size_type colIndex) const CISST_THROW(std
void ThrowUnlessValidRowIndex (size_type index) const CISST_THROW(std
void ThrowUnlessValidColIndex (size_type index) const CISST_THROW(std
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 CISST_THROW(std
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 CISST_THROW(std
const_reference operator() (size_type rowIndex, size_type colIndex) const CISST_THROW(std
const_reference Element (size_type rowIndex, size_type colIndex) const
ConstRowRefType Row (size_type index) const CISST_THROW(std
ConstColumnRefType Column (size_type index) const CISST_THROW(std
ConstDiagonalRefType Diagonal () const
ConstVectorPointerTypeRowPointers (ConstVectorPointerType &rowPointers) const CISST_THROW(std
vctDynamicConstMatrixRef< _elementType > Ref (const size_type rows, const size_type cols, const size_type startRow=0, const size_type startCol=0) const CISST_THROW(std
Incremental operations returning a scalar.

Compute a scalar from all the elements of the matrix.

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
Storage format.
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
Elementwise comparisons between matrices.

Returns the matrix of comparison's results.

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
Elementwise comparisons between a matrix and a scalar.

Returns the result of the comparison.

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
Unary elementwise operations.

Returns the result of matrix.op().

MatrixReturnType Abs (void) const
MatrixReturnType Negation (void) const
MatrixReturnType Floor (void) const
MatrixReturnType Ceil (void) const
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
template<class _matrixOwnerType, typename _elementType>
bool vctAll (const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix)
template<class _matrixOwnerType, typename _elementType>
bool vctAny (const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix)
template<class _matrixOwnerType, typename _elementType>
std::ostream & operator<< (std::ostream &output, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix)
template<vct::size_type _rows, vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride, class _elementType, class _dataPtrType, class _matrixOwnerType>
void vctFixedSizeMatrixBaseAssignDynamicConstMatrixBase (vctFixedSizeMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &fixedSizeMatrix, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &dynamicMatrix)

Variables

OwnerType Matrix

Detailed Description

Declaration of vctDynamicConstMatrixBase.

Macro Definition Documentation

◆ _vctDynamicConstMatrixBase_h

#define _vctDynamicConstMatrixBase_h

Typedef Documentation

◆ BoolMatrixReturnType

The type of a matrix of booleans returned from operations on this object, e.g., ElementwiseEqual.

◆ BoolType

Define bool based on the container type to force some compilers (i.e. gcc 4.0) to delay the instantiation of the ElementWiseCompare methods.

◆ ColumnRefType

typedef vctDynamicVectorRef<_elementType> ColumnRefType

The type indicating a column of this matrix accessed by (non-const) reference

◆ const_iterator

typedef OwnerType::const_iterator const_iterator

Const iterator on the elements of the matrix.

Const iterator on the elements of the vector.

◆ const_reverse_iterator

typedef OwnerType::const_reverse_iterator const_reverse_iterator

Const reverse iterator on the elements of the matrix.

Const reverse iterator on the elements of the vector.

◆ ConstColumnRefType

The type indicating a column of this matrix accessed by (const) reference

◆ ConstDiagonalRefType

The type indicating the main diagonal of this matrix accessed by (const) reference

◆ ConstRefTransposeType

The type of object representing this matrix accessed in transposed order. Access is by (const) reference

◆ ConstRowRefType

The type indicating a row of this matrix accessed by (const) reference

◆ ConstVectorPointerType

typedef vctDynamicVector<const_pointer> ConstVectorPointerType

The type of vector used to store const pointers on the rows or columns

◆ DiagonalRefType

typedef vctDynamicVectorRef<_elementType> DiagonalRefType

The type indicating the main diagonal of this matrix accessed by (non-const) reference

◆ iterator

typedef OwnerType::iterator iterator

Iterator on the elements of the matrix.

Iterator on the elements of the vector.

◆ MatrixReturnType

The type of a matrix returned by value from operations on this object

◆ MatrixValueType

typedef vctDynamicMatrix<_elementType> MatrixValueType

The type of a matrix used to store by value results of the same type as this object.

◆ OwnerType

typedef _matrixOwnerType OwnerType

Type of the data owner (dynamic array or pointer)

◆ RefTransposeType

typedef vctDynamicMatrixRef<_elementType> RefTransposeType

The type of object representing this matrix accessed in transposed order. Access is by (non-const) reference

◆ reverse_iterator

typedef OwnerType::reverse_iterator reverse_iterator

Reverse iterator on the elements of the matrix.

Reverse iterator on the elements of the vector.

◆ RowRefType

typedef vctDynamicVectorRef<_elementType> RowRefType

The type indicating a row of this matrix accessed by (non-const) reference

◆ ThisType

typedef vctDynamicConstMatrixBase<_matrixOwnerType, _elementType> ThisType

Type of the matrix itself.

◆ TransposeValueType

typedef vctDynamicMatrix<_elementType> TransposeValueType

The type of object required to store a transposed copy of this matrix

◆ TypeTraits

◆ VectorPointerType

The type of vector used to store pointers on the rows or columns

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DIMENSION 

Function Documentation

◆ Abs()

MatrixReturnType Abs ( void ) const
inline

Unary elementwise operations on a matrix. For each element of the matrix "this", performs \( this[i] \leftarrow op(otherMatrix[i])\) where \(op\) can calculate the absolute value (Abs) or the opposite (Negation).

Returns
A new matrix.

◆ All()

bool All ( void ) const
inline

Return true if all the elements of this matrix are nonzero, false otherwise

◆ AlmostEqual() [1/2]

template<class __matrixOwnerType>
bool AlmostEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ AlmostEqual() [2/2]

template<class __matrixOwnerType>
bool AlmostEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix,
value_type tolerance ) const
inline

◆ Any()

bool Any ( void ) const
inline

Return true if any element of this matrix is nonzero, false otherwise

◆ at() [1/2]

const_reference at ( size_type index) const

Access an element by index (const). Compare with std::matrix::at(). This method can be a handy substitute for the overloaded operator [] when operator overloading is unavailable or inconvenient.

Returns
a const reference to element[index]

◆ at() [2/2]

const_reference at ( size_type rowIndex,
size_type colIndex ) const

Access an element by index (const). Compare with std::vector::at(). This method can be a handy substitute for the overloaded operator () when operator overloading is unavailable or inconvenient.

Returns
a const reference to the element at rowIndex, colIndex

◆ begin()

const_iterator begin ( void ) const

Returns a const iterator on the first element (STL compatibility).

◆ Ceil()

MatrixReturnType Ceil ( void ) const
inline

◆ col_stride()

difference_type col_stride ( ) const

Not required by STL but provided for completeness

◆ cols()

size_type cols ( ) const

Not required by STL but provided for completeness

◆ Column()

ConstColumnRefType Column ( size_type index) const

◆ Diagonal()

ConstDiagonalRefType Diagonal ( ) const

◆ Element()

const_reference Element ( size_type rowIndex,
size_type colIndex ) const

Access an element by indices (const). This method allows to access an element without any bounds checking. It doesn't create any temporary row reference as a matrix[][] would do.

Returns
a reference to the element at rowIndex, colIndex

◆ ElementwiseEqual() [1/2]

BoolMatrixReturnType ElementwiseEqual ( const value_type & scalar) const

Comparison between a matrix and a scalar, containing the same type of elements. The comparaison ( \( = \neq < \leq > \geq \)) for ElementwiseEqual(), ElementwiseNotEqual(), ElementwiseLesser(), ElementwiseLesserOrEqual(), ElementwiseGreater() or ElementwiseGreaterOrEqual() is performed elementwise between the matrix and the scalar and stored in a newly created matrix. There is no operator provided since the semantic would be ambiguous.

Returns
A matrix of booleans.

◆ ElementwiseEqual() [2/2]

template<class __matrixOwnerType>
BoolMatrixReturnType ElementwiseEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

Comparison between two matrices of the same size, containing the same type of elements. The strides and the internal representation (_matrixOwnerType) can be different. The comparaison ( \( = \neq < \leq > \geq \)) for ElementwiseEqual(), ElementwiseNotEqual(), ElementwiseLesser(), ElementwiseLesserOrEqual(), ElementwiseGreater() or ElementwiseGreaterOrEqual() is performed elementwise between the two matrices and stored in a newly created matrix. There is no operator provided since the semantic would be ambiguous.

Returns
A matrix of booleans.

◆ ElementwiseGreater() [1/2]

BoolMatrixReturnType ElementwiseGreater ( const value_type & scalar) const

◆ ElementwiseGreater() [2/2]

template<class __matrixOwnerType>
BoolMatrixReturnType ElementwiseGreater ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ ElementwiseGreaterOrEqual() [1/2]

BoolMatrixReturnType ElementwiseGreaterOrEqual ( const value_type & scalar) const

◆ ElementwiseGreaterOrEqual() [2/2]

template<class __matrixOwnerType>
BoolMatrixReturnType ElementwiseGreaterOrEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ ElementwiseLesser() [1/2]

BoolMatrixReturnType ElementwiseLesser ( const value_type & scalar) const

◆ ElementwiseLesser() [2/2]

template<class __matrixOwnerType>
BoolMatrixReturnType ElementwiseLesser ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ ElementwiseLesserOrEqual() [1/2]

BoolMatrixReturnType ElementwiseLesserOrEqual ( const value_type & scalar) const

◆ ElementwiseLesserOrEqual() [2/2]

template<class __matrixOwnerType>
BoolMatrixReturnType ElementwiseLesserOrEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ ElementwiseNotEqual() [1/2]

BoolMatrixReturnType ElementwiseNotEqual ( const value_type & scalar) const

◆ ElementwiseNotEqual() [2/2]

template<class __matrixOwnerType>
BoolMatrixReturnType ElementwiseNotEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ empty()

bool empty ( void ) const

Tell is the matrix is empty (STL compatibility). False unless size is zero.

◆ end()

const_iterator end ( void ) const

Returns a const iterator on the last element (STL compatibility).

◆ Equal() [1/2]

bool Equal ( const value_type & scalar) const
inline

Comparison between a matrix and a scalar. The type of the elements of the matrix and the scalar must be the same. The comparaison ( \( = \neq < \leq > \geq \)) for Equal(), NotEqual(), Lesser(), LesserOrEqual(), Greater() or GreaterOrEqual() is performed elementwise between the matrix and the scalar. A logical "and" is performed (except for NotEqual which uses a logical "or") to accumulate the elementwise results.. The only operators provided are "==" and "!=" since the semantic is not ambiguous.

Returns
A boolean.

◆ Equal() [2/2]

template<class __matrixOwnerType>
bool Equal ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

Comparison between two matrices of the same size, containing the same type of elements. The strides can be different. The comparaison ( \( = \neq < \leq > \geq \)) for Equal(), NotEqual(), Lesser(), LesserOrEqual(), Greater() or GreaterOrEqual() is performed elementwise between the two matrices. A logical "and" is performed (except for NotEqual which uses a logical "or") to accumulate the elementwise results. The only operators provided are "==" and "!=" since the semantic is not ambiguous.

Returns
A boolean.

◆ FastCopyCompatible() [1/2]

template<class __matrixOwnerType>
bool FastCopyCompatible ( const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > & source) const
inline

Test if the method FastCopyOf can be used instead of Assign. See FastCopyOf for more details.

◆ FastCopyCompatible() [2/2]

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
inline

◆ Floor()

MatrixReturnType Floor ( void ) const
inline

◆ Greater() [1/2]

bool Greater ( const value_type & scalar) const
inline

◆ Greater() [2/2]

template<class __matrixOwnerType>
bool Greater ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ GreaterOrEqual() [1/2]

bool GreaterOrEqual ( const value_type & scalar) const
inline

◆ GreaterOrEqual() [2/2]

template<class __matrixOwnerType>
bool GreaterOrEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ HasNaN()

bool HasNaN ( void ) const
inline

Return true if any element of this matrix is NaN, false otherwise

◆ height()

size_type height ( ) const

Not required by STL but provided for completeness

◆ IsColMajor()

bool IsColMajor ( void ) const
inline

Test if the matrix storage order is column major.

Returns
true if the row stride is lesser or equal to the column stride.

◆ IsCompact()

bool IsCompact ( void ) const
inline

Test if the matrix is compact, i.e. a m by n matrix actually uses a contiguous block of memory or size m by n.

◆ IsFinite()

bool IsFinite ( void ) const
inline

Return true if all the elements of this matrix are finite, false otherwise

◆ IsFortran()

bool IsFortran ( void ) const
inline

Test if the matrix is "Fortran" compatible, i.e. is compact and uses a column major storage order.

See also
IsColMajor IsCompact

◆ IsNegative()

bool IsNegative ( void ) const
inline

Return true if all the elements of this matrix are strictly negative, false otherwise

◆ IsNonNegative()

bool IsNonNegative ( void ) const
inline

Return true if all the elements of this matrix are non-negative, false otherwise

◆ IsNonPositive()

bool IsNonPositive ( void ) const
inline

Return true if all the elements of this matrix are non-positive, false otherwise

◆ IsPositive()

bool IsPositive ( void ) const
inline

Return true if all the elements of this matrix are strictly positive, false otherwise

◆ IsRowMajor()

bool IsRowMajor ( void ) const
inline

Test if the matrix storage order is row major.

Returns
true if the column stride is lesser or equal to the row stride.

◆ IsSquare() [1/2]

bool IsSquare ( size_type size) const
inline

Test if a matrix is square and of a given size.

◆ IsSquare() [2/2]

bool IsSquare ( void ) const
inline

Test if a matrix is square.

◆ L1Norm()

value_type L1Norm ( void ) const
inline

Return the L1 norm of the matrix, i.e. the sum of the absolute values of all the elements.

Returns
The L1 norm.

◆ Lesser() [1/2]

bool Lesser ( const value_type & scalar) const
inline

◆ Lesser() [2/2]

template<class __matrixOwnerType>
bool Lesser ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ LesserOrEqual() [1/2]

bool LesserOrEqual ( const value_type & scalar) const
inline

◆ LesserOrEqual() [2/2]

template<class __matrixOwnerType>
bool LesserOrEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ LinfNorm()

value_type LinfNorm ( void ) const
inline

Return the Linf norm of the matrix, i.e. the maximum of the absolute values of all the elements.

See also
MaxAbsElement
Returns
The Linf norm.

◆ MaxAbsElement()

value_type MaxAbsElement ( void ) const
inline

Return the maximum of the absolute values of all the elements.

See also
LinfNorm.
Returns
The maximum of the absolute values.

◆ MaxElement()

value_type MaxElement ( void ) const
inline

Return the maximum element of the matrix.

Returns
The maximum element

◆ MinAbsElement()

value_type MinAbsElement ( void ) const
inline

Return the minimum of the absolute values of all the elements.

Returns
The minimum of the absolute values.

◆ MinAndMaxElement()

void MinAndMaxElement ( value_type & minElement,
value_type & maxElement ) const
inline

Compute the minimum AND maximum elements of the matrix. This method is more runtime-efficient than computing them separately.

Parameters
minElementreference to store the minimum element result.
maxElementreference to store the maximum element result.
Note
If this matrix is empty (null pointer) the result is undefined.

◆ MinElement()

value_type MinElement ( void ) const
inline

Return the minimum element of the matrix.

Returns
The minimum element

◆ Negation()

MatrixReturnType Negation ( void ) const
inline

◆ Norm()

NormType Norm ( void ) const
inline

Return the norm of the matrix.

Returns
The norm.

◆ NormSquare()

value_type NormSquare ( void ) const
inline

Return the square of the norm of the matrix.

Returns
The square of the norm

◆ NotEqual() [1/2]

bool NotEqual ( const value_type & scalar) const
inline

◆ NotEqual() [2/2]

template<class __matrixOwnerType>
bool NotEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ operator!=() [1/2]

bool operator!= ( const value_type & scalar) const
inline

◆ operator!=() [2/2]

template<class __matrixOwnerType>
bool operator!= ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ operator()()

const_reference operator() ( size_type rowIndex,
size_type colIndex ) const

Overloaded operator () for simplified (const) element access with bounds checking

◆ operator<<()

template<class _matrixOwnerType, typename _elementType>
std::ostream & operator<< ( std::ostream & output,
const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > & matrix )

Stream out operator.

◆ operator==() [1/2]

bool operator== ( const value_type & scalar) const
inline

◆ operator==() [2/2]

template<class __matrixOwnerType>
bool operator== ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > & otherMatrix) const
inline

◆ operator[]()

ConstRowRefType operator[] ( size_type index) const

Reference a row of this matrix by index (const).

Returns
a const reference to the element[index]

◆ Owner()

const OwnerType & Owner ( void ) const

Access the matrix owner. This method should be used only to access some extra information related to the memory layout. It is used by the engines (vctDynamicMatrixLoopEngines).

◆ Pointer() [1/2]

const_pointer Pointer ( index_type rowIndex,
index_type colIndex ) const

Returns a const pointer to an element of the container, specified by its indices. Addition to the STL requirements.

◆ Pointer() [2/2]

const_pointer Pointer ( void ) const

Returns a const pointer to the first element of the container. Addition to the STL requirements.

◆ ProductOfElements()

value_type ProductOfElements ( void ) const
inline

Return the product of the elements of the matrix.

Returns
The product of all the elements

◆ rbegin()

const_reverse_iterator rbegin ( void ) const

Returns a reverse const iterator on the last element (STL compatibility).

◆ Ref()

vctDynamicConstMatrixRef< _elementType > Ref ( const size_type rows,
const size_type cols,
const size_type startRow = 0,
const size_type startCol = 0 ) const

Create a const reference to a sub matrix

◆ rend()

const_reverse_iterator rend ( void ) const

Returns a reverse const iterator on the element before first (STL compatibility).

◆ Row()

ConstRowRefType Row ( size_type index) const

◆ row_stride()

difference_type row_stride ( ) const

Not required by STL but provided for completeness

◆ RowPointers()

ConstVectorPointerType & RowPointers ( ConstVectorPointerType & rowPointers) const

Resize and fill a vector of const pointers on the rows of the matrix. This method is provided to ease the interfacing with C libraries using matrices stored as value_type**.

To use this method, one must first create a dynamic vector of pointers, update it with the RowPointers method and then call the C function:

vctDynamicMatrix<double> myMatrix = ...;
myMatrix.RowPointers(rowPointers);
c_function(rowPointers.Pointer());
Definition vctForwardDeclarations.h:157
Definition vctForwardDeclarations.h:131
Note
This method will throw an exception if the rows are not compact, i.e. if the column stride is not equal to 1.

◆ rows()

size_type rows ( ) const

Not required by STL but provided for completeness

◆ SerializeRaw()

void SerializeRaw ( std::ostream & outputStream) const

Binary serialization

◆ size()

size_type size ( void ) const

Return the number of elements in the matrix. This is not equivalent to the difference between the end and the beginning.

◆ sizes()

const nsize_type & sizes ( void ) const

Return a fixed size vector containing the number of rows and columns.

◆ StorageOrder()

bool StorageOrder ( void ) const
inline

Return the storage order, i.e. either VCT_ROW_MAJOR or VCT_COL_MAJOR.

◆ strides()

const nstride_type & strides ( void ) const

Return a fixed size vector containing the row and column strides.

◆ SumOfElements()

value_type SumOfElements ( void ) const
inline

Return the sum of the elements of the matrix.

Returns
The sum of all the elements

◆ ThrowUnlessValidColIndex()

void ThrowUnlessValidColIndex ( size_type index) const
inlineprotected

Throw an exception unless the column index is valid

◆ ThrowUnlessValidIndex() [1/2]

void ThrowUnlessValidIndex ( size_type index) const
inlineprotected

Check the validity of an index.

◆ ThrowUnlessValidIndex() [2/2]

void ThrowUnlessValidIndex ( size_type rowIndex,
size_type colIndex ) const
inlineprotected

Check the validity of the row and column indices.

◆ ThrowUnlessValidRowIndex()

void ThrowUnlessValidRowIndex ( size_type index) const
inlineprotected

Throw an exception unless the row index is valid

◆ ToStream()

void ToStream ( std::ostream & outputStream) const

Print the matrix to a text stream

◆ ToStreamRaw()

void ToStreamRaw ( std::ostream & outputStream,
const char delimiter = ' ',
bool headerOnly = false,
const std::string & headerPrefix = "" ) const

◆ ToString()

std::string ToString ( void )

Return a string representation of the matrix elements

◆ Trace()

value_type Trace ( void ) const
inline

Return the trace of the matrix, i.e. the sum of elements of its diagonal.

Returns
The trace of the matrix.

◆ Transpose()

MatrixReturnType Transpose ( ) const
inline

Return a transposed copy of this matrix

◆ TransposeRef()

ConstRefTransposeType TransposeRef ( void ) const

Return a transposed reference to this matrix. This allows access to elements of this matrix in transposed order.

◆ ValidColIndex()

bool ValidColIndex ( size_type colIndex) const
inline

Returns true if colIndex is a valid column index.

◆ ValidIndex() [1/2]

bool ValidIndex ( size_type index) const
inline

Returns true if the index is lesser or equal to the number of elements of the matrix.

◆ ValidIndex() [2/2]

bool ValidIndex ( size_type rowIndex,
size_type colIndex ) const
inline

Returns true if both rowIndex and colIndex are valid indices.

◆ ValidRowIndex()

bool ValidRowIndex ( size_type rowIndex) const
inline

Returns true if rowIndex is a valid row index.

◆ VCT_CONTAINER_TRAITS_TYPEDEFS()

VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType )

An implementation of the ``abstract'' vctFixedSizeConstMatrixBase.

An implementation of the ``abstract'' vctFixedSizeMatrixBase.

This class is templated with the ``matrix owner type'', which may be a vctDynamicMatrixOwner or a vctMatrixRefOwner. It provides const operations on the dynamic matrix, such as SumOfElements etc.

Matrix indexing is zero-based.

The method provided for the compatibility with the STL containers start with a lower case. Other methods start with a capitalilized letter (see CISST naming convention).

Parameters
_matrixOwnerTypethe type of matrix owner.
_elementTypethe type of elements of the matrix. */ template <class _matrixOwnerType, typename _elementType> class vctDynamicConstMatrixBase { public: /* define most types from vctContainerTraits

This implementations uses a pointer to the matrix beginning as the matrix defining data member. An instantiation of this type can be used as a matrix reference with TransposeRef().

Note that the class provides only const operations, except for assigning the matrix start, which does not affect the matrix. This is despite the fact that the stored pointer is non-const.

See the base class (vctFixedSizeConstMatrixBase) for template parameter details. */ template <class _elementType, vct::size_type _rows, vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride> class vctFixedSizeConstMatrixRef : public vctFixedSizeConstMatrixBase <_rows, _cols,_rowStride, _colStride, _elementType, typename vctFixedSizeMatrixTraits<_elementType, _rows, _cols, _rowStride, _colStride>::pointer> { public: /* define most types from vctContainerTraits

This implementations uses a pointer to the matrix beginning as the matrix defining data member. An instantiation of this type can be used as a matrix reference with TransposeRef().

See the base class (vctFixedSizeMatrixBase) for template parameter details.

See also
vctFixedSizeConstMatrixRef */ template <class _elementType, vct::size_type _rows, vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride> class vctFixedSizeMatrixRef : public vctFixedSizeMatrixBase <_rows, _cols,_rowStride, _colStride, _elementType, typename vctFixedSizeMatrixTraits<_elementType, _rows, _cols, _rowStride, _colStride>::pointer> { public: /* define most types from vctContainerTraits

◆ VCT_NARRAY_TRAITS_TYPEDEFS()

VCT_NARRAY_TRAITS_TYPEDEFS ( DIMENSION )

◆ vctAll()

template<class _matrixOwnerType, typename _elementType>
bool vctAll ( const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > & matrix)
inline

Return true if all the elements of the matrix are nonzero, false otherwise

◆ vctAny()

template<class _matrixOwnerType, typename _elementType>
bool vctAny ( const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > & matrix)
inline

Return true if any element of the matrix is nonzero, false otherwise

◆ vctDynamicMatrixElementwiseCompareMatrix()

template<class _matrixOwnerType, class __matrixOwnerType, class _elementType, class _elementOperationType>
vctReturnDynamicMatrix< bool > vctDynamicMatrixElementwiseCompareMatrix ( const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > & matrix1,
const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > & matrix2 )
inline

◆ vctDynamicMatrixElementwiseCompareScalar()

template<class _matrixOwnerType, class _elementType, class _elementOperationType>
vctReturnDynamicMatrix< bool > vctDynamicMatrixElementwiseCompareScalar ( const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > & matrix,
const _elementType & scalar )
inline

◆ vctFixedSizeMatrixBaseAssignDynamicConstMatrixBase()

template<vct::size_type _rows, vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride, class _elementType, class _dataPtrType, class _matrixOwnerType>
void vctFixedSizeMatrixBaseAssignDynamicConstMatrixBase ( vctFixedSizeMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > & fixedSizeMatrix,
const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > & dynamicMatrix )
inline

◆ width()

size_type width ( ) const

Not required by STL but provided for completeness

Variable Documentation

◆ Matrix

OwnerType Matrix
protected

Declaration of the matrix-defining member object