cisst-saw
Loading...
Searching...
No Matches
vctDynamicConstMatrixBase.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4/*
5 Author(s): Ofri Sadowsky, Anton Deguet
6 Created on: 2004-07-01
7
8 (C) Copyright 2004-2018 Johns Hopkins University (JHU), All Rights Reserved.
9
10--- begin cisst license - do not edit ---
11
12This software is provided "as is" under an open source license, with
13no warranty. The complete license can be found in license.txt and
14http://www.cisst.org/cisst/license.txt.
15
16--- end cisst license ---
17*/
18
19#pragma once
20#ifndef _vctDynamicConstMatrixBase_h
21#define _vctDynamicConstMatrixBase_h
22
27
33
40
41#include <iostream>
42#include <iomanip>
43
44
45/* Forward declarations */
46#ifndef DOXYGEN
47template <class _matrixOwnerType, class __matrixOwnerType, class _elementType,
48 class _elementOperationType>
52
53template <class _matrixOwnerType, class _elementType,
54 class _elementOperationType>
57 const _elementType & scalar);
58#endif // DOXYGEN
59
60
76template <class _matrixOwnerType, typename _elementType>
78{
79public:
80 /* define most types from vctContainerTraits */
82 enum {DIMENSION = 2};
84
87
89 typedef _matrixOwnerType OwnerType;
90
92 typedef typename OwnerType::iterator iterator;
93
95 typedef typename OwnerType::const_iterator const_iterator;
96
98 typedef typename OwnerType::reverse_iterator reverse_iterator;
99
101 typedef typename OwnerType::const_reverse_iterator const_reverse_iterator;
102
106
110
114
118
122
126
130
134
138
142
146
148
153
157
160
163
164
165protected:
168
169
171 inline void ThrowUnlessValidIndex(size_type index) const CISST_THROW(std::out_of_range) {
172 if (! ValidIndex(index)) {
173 cmnThrow(std::out_of_range("vctDynamicMatrix: Invalid index"));
174 }
175 }
176
177
179 inline void ThrowUnlessValidIndex(size_type rowIndex, size_type colIndex) const CISST_THROW(std::out_of_range) {
180 if (! ValidIndex(rowIndex, colIndex)) {
181 cmnThrow(std::out_of_range("vctDynamicMatrix: Invalid indices"));
182 }
183 }
184
185
187 inline void ThrowUnlessValidRowIndex(size_type index) const CISST_THROW(std::out_of_range) {
188 if (! ValidRowIndex(index)) {
189 cmnThrow(std::out_of_range("vctDynamicMatrix: Invalid row index"));
190 }
191 }
192
194 inline void ThrowUnlessValidColIndex(size_type index) const CISST_THROW(std::out_of_range) {
195 if (! ValidColIndex(index)) {
196 cmnThrow(std::out_of_range("vctDynamicMatrix: Invalid column index"));
197 }
198 }
199
200public:
203 const_iterator begin(void) const {
204 return Matrix.begin();
205 }
206
209 const_iterator end(void) const {
210 return Matrix.end();
211 }
212
216 return Matrix.rbegin();
217 }
218
222 return Matrix.rend();
223 }
224
228 size_type size(void) const {
229 return Matrix.size();
230 }
231
233 const nsize_type & sizes(void) const {
234 return Matrix.sizes();
235 }
236
238 size_type rows() const {
239 return Matrix.rows();
240 }
241
243 size_type cols() const {
244 return Matrix.cols();
245 }
246
248 size_type height() const {
249 return Matrix.rows();
250 }
251
253 size_type width() const {
254 return Matrix.cols();
255 }
256
258 const nstride_type & strides(void) const {
259 return Matrix.strides();
260 }
261
263 difference_type row_stride() const {
264 return Matrix.row_stride();
265 }
266
268 difference_type col_stride() const {
269 return Matrix.col_stride();
270 }
271
274 bool empty() const {
275 return (size() == 0);
276 }
277
280 ConstRowRefType operator[](size_type index) const {
281 return ConstRowRefType(cols(), Pointer(index, 0), col_stride());
282 }
283
289 const_reference at(size_type index) const CISST_THROW(std::out_of_range) {
291 return (begin())[index];
292 }
293
294
298 const OwnerType & Owner(void) const {
299 return this->Matrix;
300 }
301
302
306 const_pointer Pointer(index_type rowIndex, index_type colIndex) const {
307 return Matrix.Pointer(rowIndex, colIndex);
308 }
309
313 const_pointer Pointer(void) const {
314 return Matrix.Pointer();
315 }
316
317
320 inline bool ValidIndex(size_type index) const {
321 return (index < size());
322 }
323
326 inline bool ValidIndex(size_type rowIndex, size_type colIndex) const {
327 return ((rowIndex < rows())
328 && (colIndex < cols()));
329 }
330
332 inline bool ValidRowIndex(size_type rowIndex) const {
333 return (rowIndex < rows());
334 }
335
337 inline bool ValidColIndex(size_type colIndex) const {
338 return (colIndex < cols());
339 }
340
341
346 const_reference at(size_type rowIndex, size_type colIndex) const CISST_THROW(std::out_of_range) {
347 ThrowUnlessValidIndex(rowIndex, colIndex);
348 return *(Pointer(rowIndex, colIndex));
349 }
350
352 const_reference operator () (size_type rowIndex, size_type colIndex) const CISST_THROW(std::out_of_range) {
353 return this->at(rowIndex, colIndex);
354 }
355
356
362 const_reference Element(size_type rowIndex, size_type colIndex) const {
363 return *(Pointer(rowIndex, colIndex));
364 }
365
366
367 ConstRowRefType Row(size_type index) const CISST_THROW(std::out_of_range) {
369 return ConstRowRefType(cols(), Pointer(index, 0), col_stride());
370 }
371
372 ConstColumnRefType Column(size_type index) const CISST_THROW(std::out_of_range) {
374 return ConstColumnRefType(rows(), Pointer(0, index), row_stride());
375 }
376
378 return ConstDiagonalRefType( std::min(rows(), cols()), Pointer(0, 0), row_stride() + col_stride() );
379 }
380
399 ConstVectorPointerType & RowPointers(ConstVectorPointerType & rowPointers) const CISST_THROW(std::runtime_error) {
400 if (! (this->col_stride() == 1)) {
401 cmnThrow(std::runtime_error("vctDynamicMatrix: RowPointers requires compact rows"));
402 }
403 const size_type rows = this->rows();
404 // resize the vector
405 rowPointers.SetSize(rows);
406 index_type index;
407 for (index = 0; index < rows; ++index) {
408 rowPointers[index] = this->Row(index).Pointer();
409 }
410 return rowPointers;
411 }
412
414 vctDynamicConstMatrixRef<_elementType>
415 Ref(const size_type rows, const size_type cols,
416 const size_type startRow = 0, const size_type startCol = 0) const CISST_THROW(std::out_of_range) {
417 if (((startRow + rows) > this->rows())
418 || ((startCol + cols) > this->cols())) {
419 cmnThrow(std::out_of_range("vctDynamicConstMatrixBase::Ref: reference is out of range"));
420 }
422 this->row_stride(), this->col_stride(),
423 Pointer(startRow, startCol));
424 }
425
429
432 inline value_type SumOfElements(void) const {
433 return vctDynamicMatrixLoopEngines::
434 SoMi<typename vctBinaryOperations<value_type>::Addition,
436 Run(*this);
437 }
438
441 inline value_type ProductOfElements(void) const {
442 return vctDynamicMatrixLoopEngines::
443 SoMi<typename vctBinaryOperations<value_type>::Multiplication,
445 Run(*this);
446 }
447
452 inline value_type Trace(void) const {
453 return this->Diagonal().SumOfElements();
454 }
455
458 inline value_type NormSquare(void) const {
459 return vctDynamicMatrixLoopEngines::
460 SoMi<typename vctBinaryOperations<value_type>::Addition,
462 Run(*this);
463 }
464
467 inline NormType Norm(void) const {
468 return sqrt(NormType(NormSquare()));
469 }
470
475 inline value_type L1Norm(void) const {
476 return vctDynamicMatrixLoopEngines::
477 SoMi<typename vctBinaryOperations<value_type>::Addition,
479 Run(*this);
480 }
481
488 inline value_type LinfNorm(void) const {
489 return this->MaxAbsElement();
490 }
491
494 inline value_type MaxElement(void) const {
495 return vctDynamicMatrixLoopEngines::
496 SoMi<typename vctBinaryOperations<value_type>::Maximum,
498 Run(*this);
499 }
500
503 inline value_type MinElement(void) const {
504 return vctDynamicMatrixLoopEngines::
505 SoMi<typename vctBinaryOperations<value_type>::Minimum,
507 Run(*this);
508 }
509
516 inline value_type MaxAbsElement(void) const {
517 return vctDynamicMatrixLoopEngines::
518 SoMi<typename vctBinaryOperations<value_type>::Maximum,
520 Run(*this);
521 }
522
527 inline value_type MinAbsElement(void) const {
528 return vctDynamicMatrixLoopEngines::
529 SoMi<typename vctBinaryOperations<value_type>::Minimum,
531 Run(*this);
532 }
533
541 inline void MinAndMaxElement(value_type & minElement, value_type & maxElement) const
542 {
543 vctDynamicMatrixLoopEngines::MinAndMax::Run((*this), minElement, maxElement);
544 }
545
548 inline bool IsPositive(void) const {
549 return vctDynamicMatrixLoopEngines::
550 SoMi<typename vctBinaryOperations<bool>::And,
552 Run(*this);
553 }
554
557 inline bool IsNonNegative(void) const {
558 return vctDynamicMatrixLoopEngines::
559 SoMi<typename vctBinaryOperations<bool>::And,
561 Run(*this);
562 }
563
566 inline bool IsNonPositive(void) const {
567 return vctDynamicMatrixLoopEngines::
568 SoMi<typename vctBinaryOperations<bool>::And,
570 Run(*this);
571 }
572
575 inline bool IsNegative (void) const {
576 return vctDynamicMatrixLoopEngines::
577 SoMi< typename vctBinaryOperations<bool>::And,
579 Run(*this);
580 }
581
584 inline bool All(void) const {
585 return vctDynamicMatrixLoopEngines::
586 SoMi< typename vctBinaryOperations<bool>::And,
588 Run(*this);
589 }
590
593 inline bool Any(void) const {
594 return vctDynamicMatrixLoopEngines::
595 SoMi< typename vctBinaryOperations<bool>::Or,
597 Run(*this);
598 }
599
602 inline bool IsFinite(void) const {
603 return vctDynamicMatrixLoopEngines::
604 SoMi< typename vctBinaryOperations<bool>::And,
606 Run(*this);
607 }
608
611 inline bool HasNaN(void) const {
612 return vctDynamicMatrixLoopEngines::
613 SoMi< typename vctBinaryOperations<bool>::Or,
615 Run(*this);
616 }
617
618
619
622
627 inline bool IsColMajor(void) const {
628 return Matrix.IsColMajor();
629 }
630
635 inline bool IsRowMajor(void) const {
636 return Matrix.IsRowMajor();
637 }
638
641 inline bool IsCompact(void) const {
642 return Matrix.IsCompact();
643 }
644
650 inline bool IsFortran(void) const {
651 return (IsColMajor() && (row_stride() == 1) && (col_stride() == static_cast<stride_type>(rows())));
652 }
653
656 inline bool StorageOrder(void) const {
657 return Matrix.StorageOrder();
658 }
659
661 inline bool IsSquare(void) const {
662 return (this->rows() == this->cols());
663 }
664
666 inline bool IsSquare(size_type size) const {
667 return ((this->rows() == size)
668 && (this->cols() == size));
669 }
670
671
672
676 template <class __matrixOwnerType>
678 {
679 return vctFastCopy::MatrixCopyCompatible(*this, source);
680 }
681
682 template <size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, class __dataPtrType>
687
688
689
693
705 template <class __matrixOwnerType>
707 return vctDynamicMatrixLoopEngines::
708 SoMiMi<typename vctBinaryOperations<bool>::And,
710 Run(*this, otherMatrix);
711 }
712
713 /* documented above */
714 template <class __matrixOwnerType>
716 return Equal(otherMatrix);
717 }
718
719 /* documented above */
720 template <class __matrixOwnerType>
722 value_type tolerance) const {
723 return ((*this - otherMatrix).LinfNorm() <= tolerance);
724 }
725
726 /* documented above */
727 template <class __matrixOwnerType>
729 return ((*this - otherMatrix).LinfNorm() <= TypeTraits::Tolerance());
730 }
731
732 /* documented above */
733 template <class __matrixOwnerType>
735 return vctDynamicMatrixLoopEngines::
736 SoMiMi<typename vctBinaryOperations<bool>::Or,
738 Run(*this, otherMatrix);
739 }
740
741 /* documented above */
742 template <class __matrixOwnerType>
744 return NotEqual(otherMatrix);
745 }
746
747 /* documented above */
748 template <class __matrixOwnerType>
750 return vctDynamicMatrixLoopEngines::
751 SoMiMi<typename vctBinaryOperations<bool>::And,
753 Run(*this, otherMatrix);
754 }
755
756 /* documented above */
757 template <class __matrixOwnerType>
759 return vctDynamicMatrixLoopEngines::
760 SoMiMi<typename vctBinaryOperations<bool>::And,
762 Run(*this, otherMatrix);
763 }
764
765 /* documented above */
766 template <class __matrixOwnerType>
768 return vctDynamicMatrixLoopEngines::
769 SoMiMi<typename vctBinaryOperations<bool>::And,
771 Run(*this, otherMatrix);
772 }
773
774 /* documented above */
775 template <class __matrixOwnerType>
777 return vctDynamicMatrixLoopEngines::
778 SoMiMi<typename vctBinaryOperations<bool>::And,
780 Run(*this, otherMatrix);
781 }
782
783
787
799 template <class __matrixOwnerType>
802 return vctDynamicMatrixElementwiseCompareMatrix<_matrixOwnerType, __matrixOwnerType, value_type,
804 }
805
806 /* documented above */
807 template <class __matrixOwnerType>
813
814 /* documented above */
815 template <class __matrixOwnerType>
818 return vctDynamicMatrixElementwiseCompareMatrix<_matrixOwnerType, __matrixOwnerType, value_type,
820 }
821
822 /* documented above */
823 template <class __matrixOwnerType>
829
830 /* documented above */
831 template <class __matrixOwnerType>
837
838 /* documented above */
839 template <class __matrixOwnerType>
845
847
848
852
864 inline bool Equal(const value_type & scalar) const {
865 return vctDynamicMatrixLoopEngines::
866 SoMiSi<typename vctBinaryOperations<bool>::And,
868 Run(*this, scalar);
869 }
870
871 /* documented above */
872 inline bool operator == (const value_type & scalar) const {
873 return Equal(scalar);
874 }
875
876 /* documented above */
877 inline bool NotEqual(const value_type & scalar) const {
878 return vctDynamicMatrixLoopEngines::
879 SoMiSi<typename vctBinaryOperations<bool>::Or,
881 Run(*this, scalar);
882 }
883
884 /* documented above */
885 inline bool operator != (const value_type & scalar) const {
886 return NotEqual(scalar);
887 }
888
889 /* documented above */
890 inline bool Lesser(const value_type & scalar) const {
891 return vctDynamicMatrixLoopEngines::
892 SoMiSi<typename vctBinaryOperations<bool>::And,
894 Run(*this, scalar);
895 }
896
897 /* documented above */
898 inline bool LesserOrEqual(const value_type & scalar) const {
899 return vctDynamicMatrixLoopEngines::
900 SoMiSi<typename vctBinaryOperations<bool>::And,
902 Run(*this, scalar);
903 }
904
905 /* documented above */
906 inline bool Greater(const value_type & scalar) const {
907 return vctDynamicMatrixLoopEngines::
908 SoMiSi<typename vctBinaryOperations<bool>::And,
910 Run(*this, scalar);
911 }
912
913 /* documented above */
914 inline bool GreaterOrEqual(const value_type & scalar) const {
915 return vctDynamicMatrixLoopEngines::
916 SoMiSi<typename vctBinaryOperations<bool>::And,
918 Run(*this, scalar);
919 }
920
921
925
937
938 /* documented above */
940
941 /* documented above */
943
944 /* documented above */
946
947 /* documented above */
949
950 /* documented above */
952
954
958
965 inline MatrixReturnType Abs(void) const;
966
967 /* documented above */
968 inline MatrixReturnType Negation(void) const;
969
970 /* documented above */
971 inline MatrixReturnType Floor(void) const;
972
973 /* documented above */
974 inline MatrixReturnType Ceil(void) const;
976
984
987 {
990 }
991
992
1004 static MatrixReturnType Eye(size_type size);
1005
1007 std::string ToString(void) {
1008 std::stringstream outputStream;
1009 ToStream(outputStream);
1010 return outputStream.str();
1011 }
1012
1014 void ToStream(std::ostream & outputStream) const {
1015 const size_type myRows = rows();
1016 const size_type myCols = cols();
1017 // preserve the formatting flags as they were
1018 const std::streamsize width = outputStream.width(12);
1019 const std::streamsize precision = outputStream.precision(6);
1020 bool showpoint = ((outputStream.flags() & std::ios_base::showpoint) != 0);
1021 outputStream << std::setprecision(6) << std::showpoint;
1022 size_type indexRow, indexCol;
1023 for (indexRow = 0; indexRow < myRows; ++indexRow) {
1024 for (indexCol = 0; indexCol < myCols; ++indexCol) {
1025 outputStream << std::setw(12) << this->Element(indexRow, indexCol);
1026 if (indexCol < (myCols-1)) {
1027 outputStream << " ";
1028 }
1029 }
1030 // end of line between rows, not at the end
1031 if (indexRow != (myRows - 1)) {
1032 outputStream << std::endl;
1033 }
1034 }
1035 // resume the formatting flags
1036 outputStream << std::setprecision(precision) << std::setw(width);
1037 if (!showpoint) {
1038 outputStream << std::noshowpoint;
1039 }
1040 }
1041
1042
1043 void ToStreamRaw(std::ostream & outputStream, const char delimiter = ' ',
1044 bool headerOnly = false, const std::string & headerPrefix = "") const
1045 {
1046 const size_type myRows = rows();
1047 const size_type myCols = cols();
1048 size_type indexRow, indexCol;
1049
1050 if (headerOnly) {
1051 for (indexRow = 0; indexRow < myRows; ++indexRow) {
1052 for (indexCol = 0; indexCol < myCols; ++indexCol) {
1053 outputStream << headerPrefix << "-m" << indexRow << "_" << indexCol;
1054 // delimiter between elements
1055 if (indexCol < (myCols - 1)) {
1056 outputStream << delimiter;
1057 }
1058 }
1059 // delimiter between rows, not at the end
1060 if (indexRow < (myRows - 1)) {
1061 outputStream << delimiter;
1062 }
1063 }
1064 } else {
1065 for (indexRow = 0; indexRow < myRows; ++indexRow) {
1066 for (indexCol = 0; indexCol < myCols; ++indexCol) {
1067 outputStream << this->Element(indexRow, indexCol);
1068 // delimiter between elements
1069 if (indexCol < (myCols - 1)) {
1070 outputStream << delimiter;
1071 }
1072 }
1073 // delimiter between rows, not at the end
1074 if (indexRow < (myRows - 1)) {
1075 outputStream << delimiter;
1076 }
1077 }
1078 }
1079 }
1080
1098#ifndef SWIG
1100 {
1101 public:
1103 };
1104#endif // SWIG
1105
1107 void SerializeRaw(std::ostream & outputStream) const
1108 {
1109 const size_type myRows = rows();
1110 const size_type myCols = cols();
1111 size_type indexRow, indexCol;
1112
1113 cmnSerializeSizeRaw(outputStream, myRows);
1114 cmnSerializeSizeRaw(outputStream, myCols);
1115 for (indexRow = 0; indexRow < myRows; ++indexRow) {
1116 for (indexCol = 0; indexCol < myCols; ++indexCol) {
1117 cmnSerializeRaw(outputStream, this->Element(indexRow, indexCol));
1118 }
1119 }
1120 }
1121
1122};
1123
1124#ifndef DOXYGEN
1125/* documented in class. Implementation moved here for .Net 2003 */
1126template <class _matrixOwnerType, class _elementType>
1129 return vctDynamicMatrixElementwiseCompareScalar<_matrixOwnerType, _elementType,
1131}
1132
1133/* documented in class. Implementation moved here for .Net 2003 */
1134template <class _matrixOwnerType, class _elementType>
1137 return vctDynamicMatrixElementwiseCompareScalar<_matrixOwnerType, _elementType,
1139}
1140
1141/* documented in class. Implementation moved here for .Net 2003 */
1142template <class _matrixOwnerType, class _elementType>
1145 return vctDynamicMatrixElementwiseCompareScalar<_matrixOwnerType, _elementType,
1147}
1148
1149/* documented in class. Implementation moved here for .Net 2003 */
1150template <class _matrixOwnerType, class _elementType>
1153 return vctDynamicMatrixElementwiseCompareScalar<_matrixOwnerType, _elementType,
1155}
1156
1157/* documented in class. Implementation moved here for .Net 2003 */
1158template <class _matrixOwnerType, class _elementType>
1161 return vctDynamicMatrixElementwiseCompareScalar<_matrixOwnerType, _elementType,
1163}
1164
1165/* documented in class. Implementation moved here for .Net 2003 */
1166template <class _matrixOwnerType, class _elementType>
1169 return vctDynamicMatrixElementwiseCompareScalar<_matrixOwnerType, _elementType,
1171}
1172#endif // DOXYGEN
1173
1175template <class _matrixOwnerType, typename _elementType>
1177 return matrix.All();
1178}
1179
1181template <class _matrixOwnerType, typename _elementType>
1183 return matrix.Any();
1184}
1185
1187template <class _matrixOwnerType, typename _elementType>
1188std::ostream & operator << (std::ostream & output,
1190 matrix.ToStream(output);
1191 return output;
1192}
1193
1194
1195// helper function declared and used in vctFixedSizeMatrixBase.h
1196template <vct::size_type _rows, vct::size_type _cols,
1197 vct::stride_type _rowStride, vct::stride_type _colStride,
1198 class _elementType, class _dataPtrType, class _matrixOwnerType>
1206
1207
1208#endif // _vctDynamicConstMatrixBase_h
Definition vctDynamicConstMatrixBase.h:1100
vctDynamicConstMatrixRef< value_type > Type
Definition vctDynamicConstMatrixBase.h:1102
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition cmnTypeTraits.h:155
bool BoolType
Definition cmnTypeTraits.h:164
static Type Tolerance(void)
Definition cmnTypeTraits.h:170
Test for equality between input1 and input2.
Definition vctBinaryOperations.h:282
Test if input1 is greater than input2.
Definition vctBinaryOperations.h:363
Test if input1 is greater than or equal to input2.
Definition vctBinaryOperations.h:384
Test if input1 is lesser than input2.
Definition vctBinaryOperations.h:322
Test if input1 is lesser than or equal to input2.
Definition vctBinaryOperations.h:343
Test for non equality between input1 and input2.
Definition vctBinaryOperations.h:302
Definition vctForwardDeclarations.h:145
Dynamic matrix referencing existing memory (const).
Definition vctDynamicConstMatrixRef.h:81
vctDynamicConstMatrixRef()
Definition vctDynamicConstMatrixRef.h:96
Dynamic vector referencing existing memory (const).
Definition vctDynamicConstVectorRef.h:79
ThisType & Assign(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &other)
Definition vctDynamicMatrixBase.h:509
Definition vctForwardDeclarations.h:157
static void Run(const _inputMatrixType &inputMatrix, typename _inputMatrixType::value_type &minValue, typename _inputMatrixType::value_type &maxValue)
Definition vctDynamicMatrixLoopEngines.h:978
Dynamic matrix referencing existing memory.
Definition vctDynamicMatrixRef.h:75
Definition vctForwardDeclarations.h:131
Dynamic vector referencing existing memory.
Definition vctDynamicVectorRef.h:78
static bool MatrixCopyCompatible(const _matrix1Type &matrix1, const _matrix2Type &matrix2)
Definition vctFastCopy.h:135
A template for a fixed size matrix with fixed spacing in memory.
Definition vctFixedSizeConstMatrixBase.h:104
A template for a fixed size matrix with fixed spacings in memory.
Definition vctFixedSizeMatrixBase.h:60
Definition vctDynamicMatrix.h:419
vctReturnDynamicMatrix(const BaseType &other)
Definition vctDynamicMatrix.h:426
Returns the absolute value of the input as an OutputType object.
Definition vctUnaryOperations.h:80
Returns the input as an OutputType object.
Definition vctUnaryOperations.h:65
Definition vctUnaryOperations.h:186
Definition vctUnaryOperations.h:194
Definition vctUnaryOperations.h:170
Definition vctUnaryOperations.h:154
Definition vctUnaryOperations.h:162
Definition vctUnaryOperations.h:178
Definition vctUnaryOperations.h:146
Returns the square of the input as an OutputType object.
Definition vctUnaryOperations.h:119
Assert macros definitions.
Portability across compilers and operating systems tools.
#define CISST_THROW(exceptionParameter)
Somewhat portable compilation warning message. This works with very recent versions of gcc (4....
Definition cmnPortability.h:559
Declaration of cmnSerializer and functions cmnSerializeRaw.
void cmnSerializeRaw(std::ostream &outputStream, const _elementType &data) CISST_THROW(std
Definition cmnSerializer.h:76
void cmnSerializeSizeRaw(std::ostream &outputStream, const size_t &data) CISST_THROW(std
Definition cmnSerializer.h:91
Declaration of the template function cmnThrow.
Declaration of the class cmnTypeTraits.
void cmnThrow(const _exceptionType &except, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR)
Definition cmnThrow.h:76
STL namespace.
size_t size_type
Definition vctContainerTraits.h:35
ptrdiff_t stride_type
Definition vctContainerTraits.h:37
Basic traits for the cisstVector containers.
#define VCT_CONTAINER_TRAITS_TYPEDEFS(type)
Definition vctContainerTraits.h:50
#define VCT_NARRAY_TRAITS_TYPEDEFS(dimension)
Definition vctContainerTraits.h:68
bool StorageOrder(void) const
Definition vctDynamicConstMatrixBase.h:656
vctDynamicMatrixRef< _elementType > RefTransposeType
Definition vctDynamicConstMatrixBase.h:133
ConstRowRefType Row(size_type index) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:367
bool IsColMajor(void) const
Definition vctDynamicConstMatrixBase.h:627
vctDynamicConstVectorRef< _elementType > ConstRowRefType
Definition vctDynamicConstMatrixBase.h:105
value_type MaxElement(void) const
Definition vctDynamicConstMatrixBase.h:494
vctReturnDynamicMatrix< bool > vctDynamicMatrixElementwiseCompareScalar(const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix, const _elementType &scalar)
Definition vctDynamicMatrix.h:737
vctDynamicVectorRef< _elementType > RowRefType
Definition vctDynamicConstMatrixBase.h:109
bool IsRowMajor(void) const
Definition vctDynamicConstMatrixBase.h:635
size_type height() const
Definition vctDynamicConstMatrixBase.h:248
size_type cols() const
Definition vctDynamicConstMatrixBase.h:243
const_iterator end(void) const
Definition vctDynamicConstMatrixBase.h:209
OwnerType Matrix
Definition vctDynamicConstMatrixBase.h:167
bool AlmostEqual(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix, value_type tolerance) const
Definition vctDynamicConstMatrixBase.h:721
MatrixReturnType Negation(void) const
BoolMatrixReturnType ElementwiseEqual(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:801
vctDynamicMatrix< _elementType > TransposeValueType
Definition vctDynamicConstMatrixBase.h:137
MatrixReturnType Ceil(void) const
OwnerType::const_iterator const_iterator
Definition vctDynamicConstMatrixBase.h:95
bool IsFortran(void) const
Definition vctDynamicConstMatrixBase.h:650
bool GreaterOrEqual(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:776
const_reference at(size_type index) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:289
bool vctAll(const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix)
Definition vctDynamicConstMatrixBase.h:1176
difference_type col_stride() const
Definition vctDynamicConstMatrixBase.h:268
cmnTypeTraits< value_type > TypeTraits
Definition vctDynamicConstMatrixBase.h:147
bool IsNonPositive(void) const
Definition vctDynamicConstMatrixBase.h:566
void vctFixedSizeMatrixBaseAssignDynamicConstMatrixBase(vctFixedSizeMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &fixedSizeMatrix, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &dynamicMatrix)
Definition vctDynamicConstMatrixBase.h:1199
@ DIMENSION
Definition vctDynamicConstMatrixBase.h:82
value_type MaxAbsElement(void) const
Definition vctDynamicConstMatrixBase.h:516
const OwnerType & Owner(void) const
Definition vctDynamicConstMatrixBase.h:298
bool IsNonNegative(void) const
Definition vctDynamicConstMatrixBase.h:557
MatrixReturnType Transpose() const
Definition vctDynamicConstMatrixBase.h:986
difference_type row_stride() const
Definition vctDynamicConstMatrixBase.h:263
value_type MinElement(void) const
Definition vctDynamicConstMatrixBase.h:503
OwnerType::iterator iterator
Definition vctDynamicConstMatrixBase.h:92
ConstRefTransposeType TransposeRef(void) const
Definition vctDynamicConstMatrixBase.h:980
void MinAndMaxElement(value_type &minElement, value_type &maxElement) const
Definition vctDynamicConstMatrixBase.h:541
bool NotEqual(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:734
bool ValidColIndex(size_type colIndex) const
Definition vctDynamicConstMatrixBase.h:337
size_type size(void) const
Definition vctDynamicConstMatrixBase.h:228
bool IsCompact(void) const
Definition vctDynamicConstMatrixBase.h:641
vctDynamicVectorRef< _elementType > DiagonalRefType
Definition vctDynamicConstMatrixBase.h:125
value_type MinAbsElement(void) const
Definition vctDynamicConstMatrixBase.h:527
bool IsNegative(void) const
Definition vctDynamicConstMatrixBase.h:575
void ToStreamRaw(std::ostream &outputStream, const char delimiter=' ', bool headerOnly=false, const std::string &headerPrefix="") const
Definition vctDynamicConstMatrixBase.h:1043
BoolMatrixReturnType ElementwiseGreater(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:833
void ToStream(std::ostream &outputStream) const
Definition vctDynamicConstMatrixBase.h:1014
bool empty() const
Definition vctDynamicConstMatrixBase.h:274
const_reverse_iterator rbegin(void) const
Definition vctDynamicConstMatrixBase.h:215
bool Any(void) const
Definition vctDynamicConstMatrixBase.h:593
vctDynamicVector< pointer > VectorPointerType
Definition vctDynamicConstMatrixBase.h:162
vctDynamicConstVectorRef< _elementType > ConstColumnRefType
Definition vctDynamicConstMatrixBase.h:113
vctDynamicVectorRef< _elementType > ColumnRefType
Definition vctDynamicConstMatrixBase.h:117
MatrixReturnType Floor(void) const
std::string ToString(void)
Definition vctDynamicConstMatrixBase.h:1007
vctDynamicConstMatrixRef< _elementType > ConstRefTransposeType
Definition vctDynamicConstMatrixBase.h:129
void SerializeRaw(std::ostream &outputStream) const
Definition vctDynamicConstMatrixBase.h:1107
TypeTraits::BoolType BoolType
Definition vctDynamicConstMatrixBase.h:152
const nsize_type & sizes(void) const
Definition vctDynamicConstMatrixBase.h:233
ConstRowRefType operator[](size_type index) const
Definition vctDynamicConstMatrixBase.h:280
MatrixReturnType Abs(void) const
const_reverse_iterator rend(void) const
Definition vctDynamicConstMatrixBase.h:221
bool vctAny(const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix)
Definition vctDynamicConstMatrixBase.h:1182
size_type width() const
Definition vctDynamicConstMatrixBase.h:253
value_type L1Norm(void) const
Definition vctDynamicConstMatrixBase.h:475
bool All(void) const
Definition vctDynamicConstMatrixBase.h:584
std::ostream & operator<<(std::ostream &output, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix)
Definition vctDynamicConstMatrixBase.h:1188
vctDynamicConstMatrixRef< _elementType > Ref(const size_type rows, const size_type cols, const size_type startRow=0, const size_type startCol=0) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:415
const_reference Element(size_type rowIndex, size_type colIndex) const
Definition vctDynamicConstMatrixBase.h:362
_matrixOwnerType OwnerType
Definition vctDynamicConstMatrixBase.h:89
vctDynamicConstVectorRef< _elementType > ConstDiagonalRefType
Definition vctDynamicConstMatrixBase.h:121
ConstVectorPointerType & RowPointers(ConstVectorPointerType &rowPointers) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:399
ConstDiagonalRefType Diagonal() const
Definition vctDynamicConstMatrixBase.h:377
bool LesserOrEqual(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:758
void ThrowUnlessValidColIndex(size_type index) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:194
const nstride_type & strides(void) const
Definition vctDynamicConstMatrixBase.h:258
value_type Trace(void) const
Definition vctDynamicConstMatrixBase.h:452
vctDynamicMatrix< _elementType > MatrixValueType
Definition vctDynamicConstMatrixBase.h:141
bool Equal(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:706
const_pointer Pointer(index_type rowIndex, index_type colIndex) const
Definition vctDynamicConstMatrixBase.h:306
vctReturnDynamicMatrix< bool > vctDynamicMatrixElementwiseCompareMatrix(const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix1, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix2)
Definition vctDynamicMatrix.h:725
value_type LinfNorm(void) const
Definition vctDynamicConstMatrixBase.h:488
size_type rows() const
Definition vctDynamicConstMatrixBase.h:238
BoolMatrixReturnType ElementwiseLesser(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:817
bool ValidRowIndex(size_type rowIndex) const
Definition vctDynamicConstMatrixBase.h:332
bool HasNaN(void) const
Definition vctDynamicConstMatrixBase.h:611
value_type SumOfElements(void) const
Definition vctDynamicConstMatrixBase.h:432
value_type ProductOfElements(void) const
Definition vctDynamicConstMatrixBase.h:441
NormType Norm(void) const
Definition vctDynamicConstMatrixBase.h:467
vctReturnDynamicMatrix< BoolType > BoolMatrixReturnType
Definition vctDynamicConstMatrixBase.h:156
ConstColumnRefType Column(size_type index) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:372
const_iterator begin(void) const
Definition vctDynamicConstMatrixBase.h:203
vctDynamicVector< const_pointer > ConstVectorPointerType
Definition vctDynamicConstMatrixBase.h:159
value_type NormSquare(void) const
Definition vctDynamicConstMatrixBase.h:458
bool operator==(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:715
BoolMatrixReturnType ElementwiseNotEqual(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:809
void ThrowUnlessValidIndex(size_type index) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:171
OwnerType::const_reverse_iterator const_reverse_iterator
Definition vctDynamicConstMatrixBase.h:101
void ThrowUnlessValidRowIndex(size_type index) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:187
bool Lesser(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:749
bool IsFinite(void) const
Definition vctDynamicConstMatrixBase.h:602
bool Greater(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:767
bool operator!=(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:743
bool IsSquare(void) const
Definition vctDynamicConstMatrixBase.h:661
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > ThisType
Definition vctDynamicConstMatrixBase.h:86
BoolMatrixReturnType ElementwiseLesserOrEqual(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:825
bool ValidIndex(size_type index) const
Definition vctDynamicConstMatrixBase.h:320
bool FastCopyCompatible(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &source) const
Definition vctDynamicConstMatrixBase.h:677
bool IsPositive(void) const
Definition vctDynamicConstMatrixBase.h:548
vctReturnDynamicMatrix< _elementType > MatrixReturnType
Definition vctDynamicConstMatrixBase.h:145
const_reference operator()(size_type rowIndex, size_type colIndex) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:352
BoolMatrixReturnType ElementwiseGreaterOrEqual(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:841
OwnerType::reverse_iterator reverse_iterator
Definition vctDynamicConstMatrixBase.h:98
Declaration of vctDynamicConstVectorRef.
Declaration of vctDynamicMatrixLoopEngines.
Declaration of vctDynamicVector.
Declaration of vctDynamicVectorRef.
Declaration of vctFixedSizeVector.