cisst-saw
|
#include <vctDynamicConstMatrixBase.h>
Classes | |
class | ConstSubmatrix |
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 OwnerType & | Owner (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 |
ConstVectorPointerType & | RowPointers (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 |
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).
_matrixOwnerType | the type of matrix owner. |
_elementType | the type of elements of the matrix. |
typedef vctReturnDynamicMatrix<BoolType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::BoolMatrixReturnType |
The type of a matrix of booleans returned from operations on this object, e.g., ElementwiseEqual.
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.
typedef vctDynamicVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ColumnRefType |
The type indicating a column of this matrix accessed by (non-const) reference
typedef OwnerType::const_iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::const_iterator |
Const iterator on the elements of the matrix.
typedef OwnerType::const_reverse_iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::const_reverse_iterator |
Const reverse iterator on the elements of the matrix.
typedef vctDynamicConstVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ConstColumnRefType |
The type indicating a column of this matrix accessed by (const) reference
typedef vctDynamicConstVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ConstDiagonalRefType |
The type indicating the main diagonal of this matrix accessed by (const) reference
typedef vctDynamicConstMatrixRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ConstRefTransposeType |
The type of object representing this matrix accessed in transposed order. Access is by (const) reference
typedef vctDynamicConstVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ConstRowRefType |
The type indicating a row of this matrix accessed by (const) reference
typedef vctDynamicVector<const_pointer> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ConstVectorPointerType |
The type of vector used to store const pointers on the rows or columns
typedef vctDynamicVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::DiagonalRefType |
The type indicating the main diagonal of this matrix accessed by (non-const) reference
typedef OwnerType::iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::iterator |
Iterator on the elements of the matrix.
typedef vctReturnDynamicMatrix<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::MatrixReturnType |
The type of a matrix returned by value from operations on this object
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.
typedef _matrixOwnerType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::OwnerType |
Type of the data owner (dynamic array or pointer)
typedef vctDynamicMatrixRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::RefTransposeType |
The type of object representing this matrix accessed in transposed order. Access is by (non-const) reference
typedef OwnerType::reverse_iterator vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::reverse_iterator |
Reverse iterator on the elements of the matrix.
typedef vctDynamicVectorRef<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::RowRefType |
The type indicating a row of this matrix accessed by (non-const) reference
typedef vctDynamicConstMatrixBase<_matrixOwnerType, _elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ThisType |
Type of the matrix itself.
typedef vctDynamicMatrix<_elementType> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::TransposeValueType |
The type of object required to store a transposed copy of this matrix
typedef cmnTypeTraits<value_type> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::TypeTraits |
typedef vctDynamicVector<pointer> vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::VectorPointerType |
The type of vector used to store pointers on the rows or columns
|
inline |
Unary elementwise operations on a matrix. For each element of the matrix "this", performs where
can calculate the absolute value (Abs) or the opposite (Negation).
|
inline |
Return true if all the elements of this matrix are nonzero, false otherwise
|
inline |
|
inline |
|
inline |
Return true if any element of this matrix is nonzero, false otherwise
|
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.
|
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.
|
inline |
Returns a const iterator on the first element (STL compatibility).
|
inline |
|
inline |
Not required by STL but provided for completeness
|
inline |
Not required by STL but provided for completeness
|
inline |
|
inline |
|
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.
|
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 ( ) 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.
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 ( ) 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.
|
inline |
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseGreater | ( | const value_type & | scalar | ) | const |
|
inline |
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseGreaterOrEqual | ( | const value_type & | scalar | ) | const |
|
inline |
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseLesser | ( | const value_type & | scalar | ) | const |
|
inline |
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseLesserOrEqual | ( | const value_type & | scalar | ) | const |
|
inline |
BoolMatrixReturnType vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::ElementwiseNotEqual | ( | const value_type & | scalar | ) | const |
|
inline |
Tell is the matrix is empty (STL compatibility). False unless size is zero.
|
inline |
Returns a const iterator on the last element (STL compatibility).
|
inline |
Comparison between two matrices of the same size, containing the same type of elements. The strides can be different. The comparaison ( ) 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.
|
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 ( ) 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.
|
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:
|
inline |
Test if the method FastCopyOf can be used instead of Assign. See FastCopyOf for more details.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return true if any element of this matrix is NaN, false otherwise
|
inline |
Not required by STL but provided for completeness
|
inline |
Test if the matrix storage order is column major.
|
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.
|
inline |
Return true if all the elements of this matrix are finite, false otherwise
|
inline |
Test if the matrix is "Fortran" compatible, i.e. is compact and uses a column major storage order.
|
inline |
Return true if all the elements of this matrix are strictly negative, false otherwise
|
inline |
Return true if all the elements of this matrix are non-negative, false otherwise
|
inline |
Return true if all the elements of this matrix are non-positive, false otherwise
|
inline |
Return true if all the elements of this matrix are strictly positive, false otherwise
|
inline |
Test if the matrix storage order is row major.
|
inline |
Test if a matrix is square.
|
inline |
Test if a matrix is square and of a given size.
|
inline |
Return the L1 norm of the matrix, i.e. the sum of the absolute values of all the elements.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the Linf norm of the matrix, i.e. the maximum of the absolute values of all the elements.
|
inline |
Return the maximum of the absolute values of all the elements.
|
inline |
Return the maximum element of the matrix.
|
inline |
Return the minimum of the absolute values of all the elements.
|
inline |
Compute the minimum AND maximum elements of the matrix. This method is more runtime-efficient than computing them separately.
minElement | reference to store the minimum element result. |
maxElement | reference to store the maximum element result. |
|
inline |
Return the minimum element of the matrix.
|
inline |
|
inline |
Return the norm of the matrix.
|
inline |
Return the square of the norm of the matrix.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Overloaded operator () for simplified (const) element access with bounds checking
|
inline |
|
inline |
|
inline |
Reference a row of this matrix by index (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).
|
inline |
Returns a const pointer to an element of the container, specified by its indices. Addition to the STL requirements.
|
inline |
Returns a const pointer to the first element of the container. Addition to the STL requirements.
|
inline |
Return the product of the elements of the matrix.
|
inline |
Returns a reverse const iterator on the last element (STL compatibility).
|
inline |
Create a const reference to a sub matrix
|
inline |
Returns a reverse const iterator on the element before first (STL compatibility).
|
inline |
|
inline |
Not required by STL but provided for completeness
|
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:
|
inline |
Not required by STL but provided for completeness
|
inline |
Binary serialization
|
inline |
Return the number of elements in the matrix. This is not equivalent to the difference between the end and the beginning.
|
inline |
Return a fixed size vector containing the number of rows and columns.
|
inline |
Return the storage order, i.e. either VCT_ROW_MAJOR or VCT_COL_MAJOR.
|
inline |
Return a fixed size vector containing the row and column strides.
|
inline |
Return the sum of the elements of the matrix.
|
inlineprotected |
Throw an exception unless the column index is valid
|
inlineprotected |
Check the validity of an index.
|
inlineprotected |
Check the validity of the row and column indices.
|
inlineprotected |
Throw an exception unless the row index is valid
|
inline |
Print the matrix to a text stream
|
inline |
|
inline |
Return a string representation of the matrix elements
|
inline |
Return the trace of the matrix, i.e. the sum of elements of its diagonal.
|
inline |
Return a transposed copy of this matrix
|
inline |
Return a transposed reference to this matrix. This allows access to elements of this matrix in transposed order.
|
inline |
Returns true if colIndex is a valid column index.
|
inline |
Returns true if the index is lesser or equal to the number of elements of the matrix.
|
inline |
Returns true if both rowIndex and colIndex are valid indices.
|
inline |
Returns true if rowIndex is a valid row index.
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::VCT_CONTAINER_TRAITS_TYPEDEFS | ( | _elementType | ) |
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::VCT_NARRAY_TRAITS_TYPEDEFS | ( | DIMENSION | ) |
|
inline |
Not required by STL but provided for completeness
|
protected |
Declaration of the matrix-defining member object