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

#include <vctDynamicConstMatrixBase.h>

Inheritance diagram for vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >:
vctDynamicMatrixBase< _matrixOwnerType, _elementType > vctDynamicMatrixBase< vctDynamicMatrixOwner< _elementType >, _elementType > vctDynamicMatrix< _ValueType > vctDynamicMatrix< CISSTNETLIB_DOUBLE > vctDynamicMatrix< CISSTNETLIB_INTEGER > vctDynamicMatrix< double > vctDynamicMatrix< float > vctDynamicMatrix< int > vctDynamicMatrix< short > vctDynamicMatrix< svlTarget2D > vctDynamicMatrix< unsigned char > vctDynamicMatrix< VariableType > vctDynamicMatrixRef< _ValueType > vctDynamicMatrixRef< CISSTNETLIB_DOUBLE > vctDynamicMatrixRef< double > vctDynamicMatrixRef< float > vctDynamicMatrixRef< unsigned char > vctDynamicMatrix< _elementType >

Classes

class  ConstSubmatrix
 

Public Types

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)
 
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
 
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
 

Static Public Member Functions

static MatrixReturnType Eye (size_type size)
 

Protected Member Functions

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

OwnerType Matrix
 

Detailed Description

template<class _matrixOwnerType, typename _elementType>
class vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >

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.

Member Typedef Documentation

template<class _matrixOwnerType, typename _elementType>
typedef vctReturnDynamicMatrix<BoolType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::BoolMatrixReturnType

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

template<class _matrixOwnerType, typename _elementType>
typedef TypeTraits::BoolType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ColumnRefType

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

template<class _matrixOwnerType, typename _elementType>
typedef OwnerType::const_iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::const_iterator

Const iterator on the elements of the matrix.

template<class _matrixOwnerType, typename _elementType>
typedef OwnerType::const_reverse_iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::const_reverse_iterator

Const reverse iterator on the elements of the matrix.

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicConstVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ConstColumnRefType

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

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicConstVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ConstDiagonalRefType

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

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicConstMatrixRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ConstRefTransposeType

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

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicConstVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ConstRowRefType

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

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicVector<const_pointer> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ConstVectorPointerType

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

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::DiagonalRefType

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

template<class _matrixOwnerType, typename _elementType>
typedef OwnerType::iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::iterator

Iterator on the elements of the matrix.

template<class _matrixOwnerType, typename _elementType>
typedef vctReturnDynamicMatrix<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MatrixReturnType

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

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicMatrix<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MatrixValueType

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

template<class _matrixOwnerType, typename _elementType>
typedef _matrixOwnerType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::OwnerType

Type of the data owner (dynamic array or pointer)

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicMatrixRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::RefTransposeType

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

template<class _matrixOwnerType, typename _elementType>
typedef OwnerType::reverse_iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::reverse_iterator

Reverse iterator on the elements of the matrix.

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::RowRefType

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

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicConstMatrixBase<_matrixOwnerType, _elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ThisType

Type of the matrix itself.

template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicMatrix<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::TransposeValueType

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

template<class _matrixOwnerType, typename _elementType>
typedef cmnTypeTraits<value_type> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::TypeTraits
template<class _matrixOwnerType, typename _elementType>
typedef vctDynamicVector<pointer> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::VectorPointerType

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

Member Enumeration Documentation

template<class _matrixOwnerType, typename _elementType>
anonymous enum
Enumerator
DIMENSION 

Member Function Documentation

template<class _matrixOwnerType , class _elementType >
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::All ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::AlmostEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix,
value_type  tolerance 
) const
inline
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::AlmostEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Any ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
const_reference vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::at ( size_type  index) const
throw (std::out_of_range
)
inline

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]
template<class _matrixOwnerType, typename _elementType>
const_reference vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::at ( size_type  rowIndex,
size_type  colIndex 
) const
throw (std::out_of_range
)
inline

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
template<class _matrixOwnerType, typename _elementType>
const_iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::begin ( void  ) const
inline

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

template<class _matrixOwnerType , class _elementType >
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Ceil ( void  ) const
inline
template<class _matrixOwnerType, typename _elementType>
difference_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::col_stride ( ) const
inline

Not required by STL but provided for completeness

template<class _matrixOwnerType, typename _elementType>
size_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::cols ( ) const
inline

Not required by STL but provided for completeness

template<class _matrixOwnerType, typename _elementType>
ConstColumnRefType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Column ( size_type  index) const
throw (std::out_of_range
)
inline
template<class _matrixOwnerType, typename _elementType>
ConstDiagonalRefType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Diagonal ( void  ) const
inline
template<class _matrixOwnerType, typename _elementType>
const_reference vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Element ( size_type  rowIndex,
size_type  colIndex 
) const
inline

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
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseGreater ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseGreater ( const value_type &  scalar) const
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseGreaterOrEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseGreaterOrEqual ( const value_type &  scalar) const
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseLesser ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseLesser ( const value_type &  scalar) const
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseLesserOrEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseLesserOrEqual ( const value_type &  scalar) const
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseNotEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseNotEqual ( const value_type &  scalar) const
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::empty ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
const_iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::end ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType , class _elementType >
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Eye ( size_type  size)
static

Return the identity matrix for the type of elements of this matrix class. The size has to be specified by the caller. For example:

typedef vctDynamicMatrix<float> MatrixType;
MatrixType m2 = MatrixType::Eye(9);
Note
Eye is the spelling of "I".
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.

template<class _matrixOwnerType, typename _elementType>
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, class __dataPtrType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::FastCopyCompatible ( const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, value_type, __dataPtrType > &  source) const
inline
template<class _matrixOwnerType , class _elementType >
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Floor ( void  ) const
inline
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Greater ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Greater ( const value_type &  scalar) const
inline
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::GreaterOrEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::GreaterOrEqual ( const value_type &  scalar) const
inline
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::HasNaN ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
size_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::height ( ) const
inline

Not required by STL but provided for completeness

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::IsFinite ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::IsNegative ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::IsNonNegative ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::IsNonPositive ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::IsPositive ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::IsSquare ( void  ) const
inline

Test if a matrix is square.

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::IsSquare ( size_type  size) const
inline

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

template<class _matrixOwnerType, typename _elementType>
value_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Lesser ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Lesser ( const value_type &  scalar) const
inline
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::LesserOrEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::LesserOrEqual ( const value_type &  scalar) const
inline
template<class _matrixOwnerType, typename _elementType>
value_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
value_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
value_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MaxElement ( void  ) const
inline

Return the maximum element of the matrix.

Returns
The maximum element
template<class _matrixOwnerType, typename _elementType>
value_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MinAbsElement ( void  ) const
inline

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

Returns
The minimum of the absolute values.
template<class _matrixOwnerType, typename _elementType>
void vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
value_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MinElement ( void  ) const
inline

Return the minimum element of the matrix.

Returns
The minimum element
template<class _matrixOwnerType , class _elementType >
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Negation ( void  ) const
inline
template<class _matrixOwnerType, typename _elementType>
NormType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Norm ( void  ) const
inline

Return the norm of the matrix.

Returns
The norm.
template<class _matrixOwnerType, typename _elementType>
value_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::NormSquare ( void  ) const
inline

Return the square of the norm of the matrix.

Returns
The square of the norm
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::NotEqual ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::NotEqual ( const value_type &  scalar) const
inline
template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::operator!= ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::operator!= ( const value_type &  scalar) const
inline
template<class _matrixOwnerType, typename _elementType>
const_reference vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::operator() ( size_type  rowIndex,
size_type  colIndex 
) const
throw (std::out_of_range
)
inline

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

template<class _matrixOwnerType, typename _elementType>
template<class __matrixOwnerType >
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::operator== ( const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &  otherMatrix) const
inline
template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::operator== ( const value_type &  scalar) const
inline
template<class _matrixOwnerType, typename _elementType>
ConstRowRefType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::operator[] ( size_type  index) const
inline

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

Returns
a const reference to the element[index]
template<class _matrixOwnerType, typename _elementType>
const OwnerType& vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Owner ( void  ) const
inline

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).

template<class _matrixOwnerType, typename _elementType>
const_pointer vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Pointer ( index_type  rowIndex,
index_type  colIndex 
) const
inline

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

template<class _matrixOwnerType, typename _elementType>
const_pointer vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Pointer ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
value_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ProductOfElements ( void  ) const
inline

Return the product of the elements of the matrix.

Returns
The product of all the elements
template<class _matrixOwnerType, typename _elementType>
const_reverse_iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rbegin ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
vctDynamicConstMatrixRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _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
)
inline

Create a const reference to a sub matrix

template<class _matrixOwnerType, typename _elementType>
const_reverse_iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rend ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
ConstRowRefType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Row ( size_type  index) const
throw (std::out_of_range
)
inline
template<class _matrixOwnerType, typename _elementType>
difference_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::row_stride ( ) const
inline

Not required by STL but provided for completeness

template<class _matrixOwnerType, typename _elementType>
ConstVectorPointerType& vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::RowPointers ( ConstVectorPointerType rowPointers) const
throw (std::runtime_error
)
inline

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());
Note
This method will throw an exception if the rows are not compact, i.e. if the column stride is not equal to 1.
template<class _matrixOwnerType, typename _elementType>
size_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rows ( ) const
inline

Not required by STL but provided for completeness

template<class _matrixOwnerType, typename _elementType>
void vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::SerializeRaw ( std::ostream &  outputStream) const
inline

Binary serialization

template<class _matrixOwnerType, typename _elementType>
size_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::size ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
const nsize_type& vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::sizes ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::StorageOrder ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
const nstride_type& vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::strides ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
value_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::SumOfElements ( void  ) const
inline

Return the sum of the elements of the matrix.

Returns
The sum of all the elements
template<class _matrixOwnerType, typename _elementType>
void vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ThrowUnlessValidColIndex ( size_type  index) const
throw (std::out_of_range
)
inlineprotected

Throw an exception unless the column index is valid

template<class _matrixOwnerType, typename _elementType>
void vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ThrowUnlessValidIndex ( size_type  index) const
throw (std::out_of_range
)
inlineprotected

Check the validity of an index.

template<class _matrixOwnerType, typename _elementType>
void vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ThrowUnlessValidIndex ( size_type  rowIndex,
size_type  colIndex 
) const
throw (std::out_of_range
)
inlineprotected

Check the validity of the row and column indices.

template<class _matrixOwnerType, typename _elementType>
void vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ThrowUnlessValidRowIndex ( size_type  index) const
throw (std::out_of_range
)
inlineprotected

Throw an exception unless the row index is valid

template<class _matrixOwnerType, typename _elementType>
void vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ToStream ( std::ostream &  outputStream) const
inline

Print the matrix to a text stream

template<class _matrixOwnerType, typename _elementType>
void vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ToStreamRaw ( std::ostream &  outputStream,
const char  delimiter = ' ',
bool  headerOnly = false,
const std::string &  headerPrefix = "" 
) const
inline
template<class _matrixOwnerType, typename _elementType>
std::string vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ToString ( void  )
inline

Return a string representation of the matrix elements

template<class _matrixOwnerType, typename _elementType>
value_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::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.
template<class _matrixOwnerType, typename _elementType>
MatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Transpose ( ) const
inline

Return a transposed copy of this matrix

template<class _matrixOwnerType, typename _elementType>
ConstRefTransposeType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::TransposeRef ( void  ) const
inline

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

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ValidColIndex ( size_type  colIndex) const
inline

Returns true if colIndex is a valid column index.

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ValidIndex ( size_type  index) const
inline

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

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ValidIndex ( size_type  rowIndex,
size_type  colIndex 
) const
inline

Returns true if both rowIndex and colIndex are valid indices.

template<class _matrixOwnerType, typename _elementType>
bool vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ValidRowIndex ( size_type  rowIndex) const
inline

Returns true if rowIndex is a valid row index.

template<class _matrixOwnerType, typename _elementType>
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType  )
template<class _matrixOwnerType, typename _elementType>
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::VCT_NARRAY_TRAITS_TYPEDEFS ( DIMENSION  )
template<class _matrixOwnerType, typename _elementType>
size_type vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::width ( ) const
inline

Not required by STL but provided for completeness

Member Data Documentation

template<class _matrixOwnerType, typename _elementType>
OwnerType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::Matrix
protected

Declaration of the matrix-defining member object


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