20 #ifndef _vctFixedSizeConstMatrixBase_h
21 #define _vctFixedSizeConstMatrixBase_h
44 class _elementOperationType>
47 _elementType, _dataPtrType> & matrix1,
49 _elementType, __dataPtrType> & matrix2);
54 class _elementOperationType>
57 _elementType, _dataPtrType> & matrix,
58 const _elementType & scalar);
102 class _elementType,
class _dataPtrType>
116 _rowStride, _colStride, _elementType, _dataPtrType>
ThisType;
198 COLSTRIDE <= ROWSTRIDE> TransposeValueType;
204 COLSTRIDE <= ROWSTRIDE> MatrixValueType;
210 COLSTRIDE <= ROWSTRIDE> BoolMatrixValueType;
212 typedef _dataPtrType DataType;
220 inline void ThrowUnlessValidIndex(
size_type index)
const throw(std::out_of_range) {
221 if (! ValidIndex(index)) {
222 cmnThrow(std::out_of_range(
"vctFixedSizeMatrix: Invalid index"));
228 inline void ThrowUnlessValidIndex(
size_type rowIndex,
size_type colIndex)
const throw(std::out_of_range) {
229 if (! ValidIndex(rowIndex, colIndex)) {
230 cmnThrow(std::out_of_range(
"vctFixedSizeMatrix: Invalid indices"));
271 const nsize_type & sizes(
void)
const {
272 static nsize_type staticSizes(ROWS, COLS);
296 const nstride_type & strides(
void)
const {
298 return staticStrides;
336 const_pointer Pointer(
void)
const {
342 inline bool ValidIndex(
size_type index)
const {
343 return (index < size());
349 return ((rowIndex < rows())
350 && (colIndex < cols()));
354 inline bool ValidRowIndex(
size_type rowIndex)
const {
355 return (rowIndex < rows());
359 inline bool ValidColIndex(
size_type colIndex)
const {
360 return (colIndex < cols());
368 const_reference at(
size_type index)
const throw(std::out_of_range) {
369 ThrowUnlessValidIndex(index);
370 return (begin())[index];
378 const_reference at(
size_type rowIndex,
size_type colIndex)
const throw(std::out_of_range) {
379 ThrowUnlessValidIndex(rowIndex, colIndex);
380 return *(Pointer(rowIndex, colIndex));
386 const_reference operator()(
size_type rowIndex,
size_type colIndex)
const throw(std::out_of_range) {
387 return at(rowIndex, colIndex);
398 return *(Pointer(rowIndex, colIndex));
416 template <vct::
size_type __subRows, vct::
size_type __subCols>
418 Ref(
const size_type startRow = 0,
const size_type startCol = 0)
const throw (std::out_of_range) {
420 result(*
this, startRow, startCol);
430 inline value_type SumOfElements()
const {
439 inline value_type ProductOfElements()
const {
450 inline value_type Trace(
void)
const {
451 return this->Diagonal().SumOfElements();
456 inline value_type NormSquare(
void)
const {
465 inline NormType Norm(
void)
const {
466 return sqrt(NormType(NormSquare()));
473 inline value_type L1Norm(
void)
const {
486 inline value_type LinfNorm(
void)
const {
487 return this->MaxAbsElement();
492 inline value_type MaxElement(
void)
const {
501 inline value_type MinElement(
void)
const {
514 inline value_type MaxAbsElement(
void)
const {
525 inline value_type MinAbsElement(
void)
const {
539 inline void MinAndMaxElement(value_type & minElement, value_type & maxElement)
const
546 inline bool IsPositive(
void)
const {
555 inline bool IsNonNegative(
void)
const {
564 inline bool IsNonPositive(
void)
const {
573 inline bool IsNegative (
void)
const {
582 inline bool All(
void)
const {
591 inline bool Any(
void)
const {
600 inline bool IsFinite(
void)
const {
609 inline bool HasNaN(
void)
const {
625 inline bool IsColMajor(
void)
const {
626 return (row_stride() <= col_stride());
634 return (col_stride() <= row_stride());
639 inline bool IsCompact(
void)
const {
640 return (((row_stride() == 1) && (col_stride() == static_cast<stride_type>(rows())))
641 || ((col_stride() == 1) && (row_stride() == static_cast<stride_type>(cols()))));
649 inline bool IsFortran(
void)
const {
650 return (IsColMajor() && (row_stride() == 1) && (col_stride() == static_cast<stride_type>(rows())));
655 inline bool StorageOrder(
void)
const {
661 return (this->rows() == this->cols());
666 return ((this->rows() == size)
667 && (this->cols() == size));
672 template <
size_type __rows,
size_type __cols, str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
680 template<
class __matrixOwnerType>
703 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
705 value_type, __dataPtrType> & otherMatrix)
const {
709 Run(*
this, otherMatrix);
713 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
715 value_type, __dataPtrType> & otherMatrix)
const {
716 return Equal(otherMatrix);
720 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
722 value_type, __dataPtrType> & otherMatrix,
723 value_type tolerance)
const {
724 return ((*
this - otherMatrix).LinfNorm() <= tolerance);
728 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
730 value_type, __dataPtrType> & otherMatrix)
const {
735 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
737 value_type, __dataPtrType> & otherMatrix)
const {
741 Run(*
this, otherMatrix);
745 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
747 value_type, __dataPtrType> & otherMatrix)
const {
752 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
754 value_type, __dataPtrType> & otherMatrix)
const {
758 Run(*
this, otherMatrix);
762 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
764 value_type, __dataPtrType> & otherMatrix)
const {
768 Run(*
this, otherMatrix);
772 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
774 value_type, __dataPtrType> & otherMatrix)
const {
778 Run(*
this, otherMatrix);
782 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
784 value_type, __dataPtrType> & otherMatrix)
const {
788 Run(*
this, otherMatrix);
808 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
809 inline BoolMatrixValueType
811 value_type, __dataPtrType> & otherMatrix)
const {
814 _rowStride, _colStride, _dataPtrType,
815 __rowStride, __colStride, __dataPtrType,
821 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
822 inline BoolMatrixValueType
824 value_type, __dataPtrType> & otherMatrix)
const {
827 _rowStride, _colStride, _dataPtrType,
828 __rowStride, __colStride, __dataPtrType,
834 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
835 inline BoolMatrixValueType
837 value_type, __dataPtrType> & otherMatrix)
const {
840 _rowStride, _colStride, _dataPtrType,
841 __rowStride, __colStride, __dataPtrType,
847 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
848 inline BoolMatrixValueType
850 value_type, __dataPtrType> & otherMatrix)
const {
853 _rowStride, _colStride, _dataPtrType,
854 __rowStride, __colStride, __dataPtrType,
860 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
861 inline BoolMatrixValueType
863 value_type, __dataPtrType> & otherMatrix)
const {
866 _rowStride, _colStride, _dataPtrType,
867 __rowStride, __colStride, __dataPtrType,
873 template <str
ide_type __rowStr
ide, str
ide_type __colStr
ide,
class __dataPtrType>
874 inline BoolMatrixValueType
876 value_type, __dataPtrType> & otherMatrix)
const {
879 _rowStride, _colStride, _dataPtrType,
880 __rowStride, __colStride, __dataPtrType,
900 inline bool Equal(
const value_type & scalar)
const {
909 return Equal(scalar);
913 inline bool NotEqual(
const value_type & scalar)
const {
926 inline bool Lesser(
const value_type & scalar)
const {
942 inline bool Greater(
const value_type & scalar)
const {
977 _rowStride, _colStride, _dataPtrType,
986 _rowStride, _colStride, _dataPtrType,
995 _rowStride, _colStride, _dataPtrType,
1004 _rowStride, _colStride, _dataPtrType,
1013 _rowStride, _colStride, _dataPtrType,
1022 _rowStride, _colStride, _dataPtrType,
1039 inline MatrixValueType
Abs(
void)
const;
1042 inline MatrixValueType
Negation(
void)
const;
1045 inline MatrixValueType
Floor(
void)
const;
1048 inline MatrixValueType
Ceil(
void)
const;
1078 template <
size_type _subRows,
size_type _subCols>
1097 static const MatrixValueType &
Eye(
void);
1101 std::stringstream outputStream;
1103 return outputStream.str();
1111 const std::streamsize width = outputStream.width(12);
1112 const std::streamsize precision = outputStream.precision(6);
1113 bool showpoint = ((outputStream.flags() & std::ios_base::showpoint) != 0);
1114 outputStream << std::setprecision(6) << std::showpoint;
1116 for (indexRow = 0; indexRow < myRows; ++indexRow) {
1117 for (indexCol = 0; indexCol < myCols; ++indexCol) {
1118 outputStream << std::setw(12) << this->Element(indexRow, indexCol);
1119 if (indexCol < (myCols-1)) {
1120 outputStream <<
" ";
1124 if (indexRow != (myRows - 1)) {
1125 outputStream << std::endl;
1129 outputStream << std::setprecision(precision) << std::setw(width);
1131 outputStream << std::noshowpoint;
1136 void ToStreamRaw(std::ostream & outputStream,
const char delimiter =
' ',
1137 bool headerOnly =
false,
const std::string & headerPrefix =
"")
const
1144 for (indexRow = 0; indexRow < myRows; ++indexRow) {
1145 for (indexCol = 0; indexCol < myCols; ++indexCol) {
1146 outputStream << headerPrefix <<
"-m" << indexRow <<
"_" << indexCol;
1148 if (indexCol < (myCols - 1)) {
1149 outputStream << delimiter;
1153 if (indexRow < (myRows - 1)) {
1154 outputStream << delimiter;
1158 for (indexRow = 0; indexRow < myRows; ++indexRow) {
1159 for (indexCol = 0; indexCol < myCols; ++indexCol) {
1160 outputStream << this->Element(indexRow, indexCol);
1162 if (indexCol < (myCols - 1)) {
1163 outputStream << delimiter;
1167 if (indexRow < (myRows - 1)) {
1168 outputStream << delimiter;
1181 for (indexRow = 0; indexRow < myRows; ++indexRow) {
1182 for (indexCol = 0; indexCol < myCols; ++indexCol) {
1195 class _elementType,
class _dataPtrType>
1197 return matrix.All();
1203 class _elementType,
class _dataPtrType>
1205 return matrix.Any();
1211 class _elementType,
class _dataPtrType>
1219 #endif // _vctFixedSizeConstMatrixBase_h
MatrixTraits::const_reverse_iterator const_reverse_iterator
Definition: vctFixedSizeConstMatrixBase.h:132
A template for a fixed size matrix with fixed spacing in memory.
Definition: vctFixedSizeConstMatrixBase.h:103
BoolMatrixValueType ElementwiseNotEqual(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:823
Definition: vctFixedSizeConstMatrixBase.h:1079
Definition: vctFixedSizeMatrixTraits.h:67
Returns the absolute value of the input as an OutputType object.
Definition: vctUnaryOperations.h:80
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
bool vctAny(const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &matrix)
Definition: vctFixedSizeConstMatrixBase.h:1204
vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > ThisType
Definition: vctFixedSizeConstMatrixBase.h:116
bool Equal(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:900
static const MatrixValueType & Eye(void)
Definition: vctFixedSizeMatrix.h:422
MatrixTraits::reverse_iterator reverse_iterator
Definition: vctFixedSizeConstMatrixBase.h:129
vctFixedSizeConstMatrixRef< _elementType, _rows, _cols, _rowStride, _colStride > ConstRefType
Definition: vctFixedSizeConstMatrixBase.h:178
Declaration of vctFixedSizeMatrixLoopEngines.
An implementation of the ``abstract'' vctFixedSizeVectorBase.
Definition: vctFixedSizeVectorRef.h:46
bool NotEqual(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:913
Test if input1 is lesser than input2.
Definition: vctBinaryOperations.h:322
std::ostream & operator<<(std::ostream &output, const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &matrix)
Definition: vctFixedSizeConstMatrixBase.h:1212
BoolMatrixValueType ElementwiseLesserOrEqual(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:849
Declaration of cmnSerializer and functions cmnSerializeRaw.
vctFixedSizeMatrixRef< _elementType, _rows, _cols, _rowStride, _colStride > RefType
Definition: vctFixedSizeConstMatrixBase.h:181
bool Greater(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:942
Definition: vctFixedSizeConstMatrixBase.h:139
Test for non equality between input1 and input2.
Definition: vctBinaryOperations.h:302
vctFixedSizeVectorRef< _elementType, COLS, COLSTRIDE > RowRefType
Definition: vctFixedSizeConstMatrixBase.h:152
Definition: vctFixedSizeConstMatrixBase.h:135
Definition: vctFixedSizeConstMatrixBase.h:138
bool vctAll(const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &matrix)
Definition: vctFixedSizeConstMatrixBase.h:1196
An implementation of the ``abstract'' vctFixedSizeConstVectorBase.
Definition: vctFixedSizeConstVectorRef.h:50
Definition: vctFixedSizeMatrixTraits.h:67
vctFixedSizeConstVectorRef< _elementType, DIAGONAL_LENGTH, DIAGONAL_STRIDE > ConstDiagonalRefType
Definition: vctFixedSizeConstMatrixBase.h:164
size_t size_type
Definition: vctContainerTraits.h:35
Definition: vctFixedStrideMatrixIterator.h:361
Definition: vctFixedSizeConstMatrixBase.h:142
bool LesserOrEqual(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:763
Definition: vctUnaryOperations.h:178
Test for equality between input1 and input2.
Definition: vctBinaryOperations.h:282
BoolMatrixValueType ElementwiseLesser(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:992
Returns the square of the input as an OutputType object.
Definition: vctUnaryOperations.h:119
bool IsSquare(size_type size) const
Definition: vctFixedSizeConstMatrixBase.h:665
Matrix iterator.
Definition: vctFixedStrideMatrixIterator.h:90
Returns the input as an OutputType object.
Definition: vctUnaryOperations.h:65
Definition: vctFixedSizeMatrixLoopEngines.h:440
Definition: vctDynamicConstMatrixBase.h:77
Implementation of a fixed-size vector using template metaprogramming.
Definition: vctFixedSizeVector.h:52
vctFixedSizeVector< _elementType, ROWS > ColumnValueType
Definition: vctFixedSizeConstMatrixBase.h:175
VCT_NARRAY_TRAITS_TYPEDEFS(DIMENSION)
bool Equal(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:704
Test if input1 is greater than input2.
Definition: vctBinaryOperations.h:363
bool GreaterOrEqual(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:950
MatrixValueType Negation(void) const
Definition: vctFixedSizeMatrix.h:389
bool IsSquare(void) const
Definition: vctFixedSizeConstMatrixBase.h:660
Definition: vctUnaryOperations.h:186
ptrdiff_t difference_type
Definition: vctContainerTraits.h:38
bool GreaterOrEqual(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:783
MatrixValueType Floor(void) const
Definition: vctFixedSizeMatrix.h:400
Definition: vctFixedSizeMatrixTraits.h:67
vctFixedSizeConstMatrixRef< _elementType, _cols, _rows, _colStride, _rowStride > ConstRefTransposeType
Definition: vctFixedSizeConstMatrixBase.h:187
static bool MatrixCopyCompatible(const _matrix1Type &matrix1, const _matrix2Type &matrix2)
Definition: vctFastCopy.h:139
BoolMatrixValueType ElementwiseLesser(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:836
BoolMatrixValueType ElementwiseEqual(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:810
MatrixValueType Abs(void) const
Definition: vctFixedSizeMatrix.h:378
MatrixTraits::const_iterator const_iterator
Definition: vctFixedSizeConstMatrixBase.h:126
Test if input1 is greater than or equal to input2.
Definition: vctBinaryOperations.h:384
bool Lesser(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:753
std::string ToString(void) const
Definition: vctFixedSizeConstMatrixBase.h:1100
vctFixedSizeVectorRef< _elementType, DIAGONAL_LENGTH, DIAGONAL_STRIDE > DiagonalRefType
Definition: vctFixedSizeConstMatrixBase.h:168
bool Greater(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:773
bool operator!=(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:746
vctFixedSizeMatrixRef< _elementType, _cols, _rows, _colStride, _rowStride > RefTransposeType
Definition: vctFixedSizeConstMatrixBase.h:192
Declaration of vctFixedSizeVector.
vctFixedSizeConstMatrixRef< value_type, _subRows, _subCols, ROWSTRIDE, COLSTRIDE > Type
Definition: vctFixedSizeConstMatrixBase.h:1083
void ToStream(std::ostream &outputStream) const
Definition: vctFixedSizeConstMatrixBase.h:1107
bool operator==(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:714
An implementation of the ``abstract'' vctFixedSizeMatrixBase.
Definition: vctFixedSizeMatrixRef.h:46
Definition: vctUnaryOperations.h:154
bool Lesser(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:926
Definition: vctFixedSizeMatrixTraits.h:74
void cmnSerializeRaw(std::ostream &outputStream, const _elementType &data)
Definition: cmnSerializer.h:78
Definition: vctFixedSizeMatrixLoopEngines.h:400
MatrixValueType Ceil(void) const
Definition: vctFixedSizeMatrix.h:411
Definition: vctFixedSizeConstMatrixBase.h:111
vctFixedSizeVectorRef< _elementType, ROWS, ROWSTRIDE > ColumnRefType
Definition: vctFixedSizeConstMatrixBase.h:160
Definition: vctUnaryOperations.h:170
vctFixedSizeMatrix< _elementType, COLS, ROWS, COLSTRIDE<=ROWSTRIDE > TransposeValueType;typedef vctFixedSizeMatrix< _elementType, ROWS, COLS, COLSTRIDE<=ROWSTRIDE > MatrixValueType;typedef vctFixedSizeMatrix< bool, ROWS, COLS, COLSTRIDE<=ROWSTRIDE > BoolMatrixValueType;typedef _dataPtrType DataType;protected:DataType Data;inline void ThrowUnlessValidIndex(size_type index) const throw(std::out_of_range){if(!ValidIndex(index)){cmnThrow(std::out_of_range("vctFixedSizeMatrix: Invalid index"));}}inline void ThrowUnlessValidIndex(size_type rowIndex, size_type colIndex) const throw(std::out_of_range){if(!ValidIndex(rowIndex, colIndex)){cmnThrow(std::out_of_range("vctFixedSizeMatrix: Invalid indices"));}}public:const_iterator begin() const {return const_iterator(Data, 0);}const_iterator end() const {return const_iterator(Data)+LENGTH;}const_reverse_iterator rbegin() const {return const_reverse_iterator(Pointer(ROWS-1, COLS-1), 0);}const_reverse_iterator rend() const {return const_reverse_iterator(Data-ROWSTRIDE+COLSTRIDE *(COLS-1), 0);}size_type size() const {return LENGTH;}const nsize_type &sizes(void) const {static nsize_type staticSizes(ROWS, COLS);return staticSizes;}size_type rows() const {return ROWS;}size_type cols() const {return COLS;}size_type max_size() const {return LENGTH;}const nstride_type &strides(void) const {static nstride_type staticStrides(ROWSTRIDE, COLSTRIDE);return staticStrides;}difference_type row_stride() const {return ROWSTRIDE;}difference_type col_stride() const {return COLSTRIDE;}bool empty() const {return(LENGTH==0);}ConstRowRefType operator[](size_type index) const {return ConstRowRefType(Data+ROWSTRIDE *index);}const_pointer Pointer(size_type rowIndex, size_type colIndex) const {return Data+ROWSTRIDE *rowIndex+COLSTRIDE *colIndex;}const_pointer Pointer(void) const {return Data;}inline bool ValidIndex(size_type index) const {return(index< size());}inline bool ValidIndex(size_type rowIndex, size_type colIndex) const {return((rowIndex< rows())&&(colIndex< cols()));}inline bool ValidRowIndex(size_type rowIndex) const {return(rowIndex< rows());}inline bool ValidColIndex(size_type colIndex) const {return(colIndex< cols());}const_reference at(size_type index) const throw(std::out_of_range){ThrowUnlessValidIndex(index);return(begin())[index];}const_reference at(size_type rowIndex, size_type colIndex) const throw(std::out_of_range){ThrowUnlessValidIndex(rowIndex, colIndex);return *(Pointer(rowIndex, colIndex));}const_reference operator()(size_type rowIndex, size_type colIndex) const throw(std::out_of_range){return at(rowIndex, colIndex);}const_reference Element(size_type rowIndex, size_type colIndex) const {return *(Pointer(rowIndex, colIndex));}ConstRowRefType Row(size_type index) const {return ConstRowRefType(Data+ROWSTRIDE *index);}ConstColumnRefType Column(size_type index) const {return ConstColumnRefType(Data+COLSTRIDE *index);}ConstDiagonalRefType Diagonal(void) const {return ConstDiagonalRefType(Data);}template< vct::size_type __subRows, vct::size_type __subCols > vctFixedSizeConstMatrixRef< _elementType, __subRows, __subCols, _rowStride, _colStride > Ref(const size_type startRow=0, const size_type startCol=0) const throw(std::out_of_range){vctFixedSizeConstMatrixRef< _elementType, __subRows, __subCols, _rowStride, _colStride > result(*this, startRow, startCol);return result;}inline value_type SumOfElements() const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< value_type >::Addition, typename vctUnaryOperations< value_type >::Identity >::Run(*this);}inline value_type ProductOfElements() const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< value_type >::Multiplication, typename vctUnaryOperations< value_type >::Identity >::Run(*this);}inline value_type Trace(void) const {return this->Diagonal().SumOfElements();}inline value_type NormSquare(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< value_type >::Addition, typename vctUnaryOperations< value_type >::Square >::Run(*this);}inline NormType Norm(void) const {return sqrt(NormType(NormSquare()));}inline value_type L1Norm(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< value_type >::Addition, typename vctUnaryOperations< value_type >::AbsValue >::Run(*this);}inline value_type LinfNorm(void) const {return this->MaxAbsElement();}inline value_type MaxElement(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< value_type >::Maximum, typename vctUnaryOperations< value_type >::Identity >::Run(*this);}inline value_type MinElement(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< value_type >::Minimum, typename vctUnaryOperations< value_type >::Identity >::Run(*this);}inline value_type MaxAbsElement(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< value_type >::Maximum, typename vctUnaryOperations< value_type >::AbsValue >::Run(*this);}inline value_type MinAbsElement(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< value_type >::Minimum, typename vctUnaryOperations< value_type >::AbsValue >::Run(*this);}inline void MinAndMaxElement(value_type &minElement, value_type &maxElement) const {vctFixedSizeMatrixLoopEngines::MinAndMax::Run((*this), minElement, maxElement);}inline bool IsPositive(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< bool >::And, typename vctUnaryOperations< bool, value_type >::IsPositive >::Run(*this);}inline bool IsNonNegative(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< bool >::And, typename vctUnaryOperations< bool, value_type >::IsNonNegative >::Run(*this);}inline bool IsNonPositive(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< bool >::And, typename vctUnaryOperations< bool, value_type >::IsNonPositive >::Run(*this);}inline bool IsNegative(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< bool >::And, typename vctUnaryOperations< bool, value_type >::IsNegative >::Run(*this);}inline bool All(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< bool >::And, typename vctUnaryOperations< bool, value_type >::IsNonzero >::Run(*this);}inline bool Any(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< bool >::Or, typename vctUnaryOperations< bool, value_type >::IsNonzero >::Run(*this);}inline bool IsFinite(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< bool >::And, typename vctUnaryOperations< bool, value_type >::IsFinite >::Run(*this);}inline bool HasNaN(void) const {return vctFixedSizeMatrixLoopEngines::SoMi< typename vctBinaryOperations< bool >::Or, typename vctUnaryOperations< bool, value_type >::IsNaN >::Run(*this);}inline bool IsColMajor(void) const {return(row_stride()<=col_stride());}inline bool IsRowMajor(void) const {return(col_stride()<=row_stride());}inline bool IsCompact(void) const {return(((row_stride()==1)&&(col_stride()==static_cast< stride_type >rows())))||((col_stride()==1)&&(row_stride()==static_cast< stride_type >cols()))));}inline bool IsFortran(void) const {return(IsColMajor()&&(row_stride()==1)&&(col_stride()==static_cast< stride_type >rows())));}inline bool StorageOrder(void) const {return this-> IsRowMajor()
Definition: vctFixedSizeConstMatrixBase.h:656
ConstRefTransposeType TransposeRef(void) const
Definition: vctFixedSizeConstMatrixRef.h:172
Definition: vctFixedSizeMatrixTraits.h:74
Definition: vctFixedSizeConstMatrixBase.h:143
#define cmnThrow(a)
Definition: MinimalCmn.h:4
Implementation of a fixed-size matrix using template metaprogramming.
Definition: vctFixedSizeMatrix.h:52
BoolMatrixValueType ElementwiseGreaterOrEqual(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:1019
void ToStreamRaw(std::ostream &outputStream, const char delimiter= ' ', bool headerOnly=false, const std::string &headerPrefix="") const
Definition: vctFixedSizeConstMatrixBase.h:1136
Declaration of vctFixedSizeVectorRef.
Definition: vctUnaryOperations.h:146
Declaration of vctFixedSizeMatrixTraits.
vctFixedSizeMatrixTraits< _elementType, _rows, _cols, _rowStride, _colStride > MatrixTraits
Definition: vctFixedSizeConstMatrixBase.h:120
TransposeValueType Transpose() const
Definition: vctFixedSizeConstMatrixBase.h:1060
Test if input1 is lesser than or equal to input2.
Definition: vctBinaryOperations.h:343
ptrdiff_t stride_type
Definition: vctContainerTraits.h:37
vctFixedSizeConstVectorRef< _elementType, COLS, COLSTRIDE > ConstRowRefType
Definition: vctFixedSizeConstMatrixBase.h:148
bool LesserOrEqual(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:934
BoolMatrixValueType ElementwiseGreaterOrEqual(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:875
static void Run(const _inputMatrixType &inputMatrix, typename _inputMatrixType::value_type &minValue, typename _inputMatrixType::value_type &maxValue)
Definition: vctFixedSizeMatrixLoopEngines.h:764
An implementation of the ``abstract'' vctFixedSizeConstMatrixBase.
Definition: vctFixedSizeConstMatrixRef.h:50
BoolMatrixValueType ElementwiseGreater(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:862
BoolMatrixValueType ElementwiseNotEqual(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:983
bool AlmostEqual(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:729
vctFixedSizeMatrix< bool, _rows, _cols > vctFixedSizeMatrixElementwiseCompareMatrix(const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &matrix1, const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, _elementType, __dataPtrType > &matrix2)
Definition: vctFixedSizeMatrix.h:439
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition: cmnTypeTraits.h:155
Definition: vctFixedSizeConstMatrixBase.h:135
Definition: vctFixedSizeMatrixLoopEngines.h:648
Definition: vctUnaryOperations.h:194
bool AlmostEqual(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix, value_type tolerance) const
Definition: vctFixedSizeConstMatrixBase.h:721
BoolMatrixValueType ElementwiseLesserOrEqual(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:1001
Define common container related types based on the properties of a fixed size container.
Definition: vctFixedSizeMatrixTraits.h:46
bool NotEqual(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix) const
Definition: vctFixedSizeConstMatrixBase.h:736
bool FastCopyCompatible(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &source) const
Definition: vctFixedSizeConstMatrixBase.h:681
BoolMatrixValueType ElementwiseEqual(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:974
vctFixedSizeVector< _elementType, COLS > RowValueType
Definition: vctFixedSizeConstMatrixBase.h:172
BoolMatrixValueType ElementwiseGreater(const value_type &scalar) const
Definition: vctFixedSizeConstMatrixBase.h:1010
void SerializeRaw(std::ostream &outputStream) const
Definition: vctFixedSizeConstMatrixBase.h:1175
bool FastCopyCompatible(const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, value_type, __dataPtrType > &source) const
Definition: vctFixedSizeConstMatrixBase.h:673
Definition: vctFixedSizeConstMatrixBase.h:136
vctFixedSizeConstVectorRef< _elementType, ROWS, ROWSTRIDE > ConstColumnRefType
Definition: vctFixedSizeConstMatrixBase.h:156
vctFixedSizeMatrix< bool, _rows, _cols > vctFixedSizeMatrixElementwiseCompareScalar(const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &matrix, const _elementType &scalar)
Definition: vctFixedSizeMatrix.h:455
Definition: vctUnaryOperations.h:162
MatrixTraits::iterator iterator
Definition: vctFixedSizeConstMatrixBase.h:123