cisst-saw
Loading...
Searching...
No Matches
vctFixedSizeMatrixBase.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: 2003-11-04
7
8 (C) Copyright 2003-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 _vctFixedSizeMatrixBase_h
21#define _vctFixedSizeMatrixBase_h
22
27
31
32#include <cstdarg>
33
34
35// forward declaration of Assign method from dynamic matrix to fixed size
36template <vct::size_type _rows, vct::size_type _cols,
37 vct::stride_type _rowStride, vct::stride_type _colStride,
38 class _elementType, class _dataPtrType, class _matrixOwnerType>
42
43
44
55template <vct::size_type _rows, vct::size_type _cols,
56 vct::stride_type _rowStride, vct::stride_type _colStride,
57 class _elementType, class _dataPtrType>
59<_rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType>
60{
61 public:
62 /* Declare the container-defined typed required by STL, plus the
63 types completed by our traits class */
64
65 /* define most types from vctContainerTraits */
67
68 /* documented in base class */
69 typedef vctFixedSizeMatrixBase<_rows, _cols,
70 _rowStride, _colStride, _elementType, _dataPtrType> ThisType;
71
73 typedef vctFixedSizeConstMatrixBase<_rows, _cols, _rowStride, _colStride,
74 _elementType, _dataPtrType> BaseType;
75
76 typedef vctFixedSizeMatrixTraits<_elementType, _rows, _cols,
77 _rowStride, _colStride> MatrixTraits;
78
83
94
101
102 public:
104 inline iterator begin() {
105 return iterator(this->Data, 0);
106 }
107
108 /* documented in base class */
109 inline const_iterator begin() const {
110 return BaseType::begin();
111 }
112
114 inline iterator end() {
115 return iterator(this->Data) + LENGTH;
116 }
117
118 /* documented in base class */
119 inline const_iterator end() const {
120 return BaseType::end();
121 }
122
125 return reverse_iterator(Pointer(ROWS - 1, COLS - 1), 0);
126 }
127
128 /* documented in base class */
130 return BaseType::rbegin();
131 }
132
136 return reverse_iterator(this->Data - ROWSTRIDE +
137 COLSTRIDE * (COLS - 1), 0);
138 }
139
140 /* documented in base class */
142 return BaseType::rend();
143 }
144
145
148 RowRefType operator[](size_type index) {
149 return RowRefType(this->Data + ROWSTRIDE * index);
150 }
151
152 /* documented in base class */
153 ConstRowRefType operator[](size_type index) const {
154 return BaseType::operator[](index);
155 }
156
157
161 pointer Pointer(size_type rowIndex, size_type colIndex) {
162 return this->Data + ROWSTRIDE * rowIndex + COLSTRIDE * colIndex;
163 }
164
168 pointer Pointer(void) {
169 return this->Data;
170 }
171
172 /* documented in base class */
173 const_pointer Pointer(size_type rowIndex, size_type colIndex) const {
174 return BaseType::Pointer(rowIndex, colIndex);
175 }
176
177 /* documented in base class */
178 const_pointer Pointer(void) const {
179 return BaseType::Pointer();
180 }
181
182
187 reference at(size_type index) CISST_THROW(std::out_of_range) {
188 this->ThrowUnlessValidIndex(index);
189 return (begin())[index];
190 }
191
192 /* documented in base class */
193 const_reference at(size_type index) const CISST_THROW(std::out_of_range) {
194 return BaseType::at(index);
195 }
196
197
202 reference at(size_type rowIndex, size_type colIndex) CISST_THROW(std::out_of_range) {
203 this->ThrowUnlessValidIndex(rowIndex, colIndex);
204 return *(Pointer(rowIndex, colIndex));
205 }
206
207 /* documented in base class */
208 const_reference at(size_type rowIndex, size_type colIndex) const CISST_THROW(std::out_of_range) {
209 return BaseType::at(rowIndex, colIndex);
210 }
211
212#ifndef SWIG
215 reference operator()(size_type rowIndex, size_type colIndex) CISST_THROW(std::out_of_range) {
216 return at(rowIndex, colIndex);
217 }
218
219 /* documented in base class */
220 const_reference operator()(size_type rowIndex, size_type colIndex) const CISST_THROW(std::out_of_range) {
221 return BaseType::operator()(rowIndex, colIndex);
222 }
223#endif
224
225
231 reference Element(size_type rowIndex, size_type colIndex) {
232 return *(Pointer(rowIndex, colIndex));
233 }
234
235 /* documented in base class */
236 const_reference Element(size_type rowIndex, size_type colIndex) const {
237 return BaseType::Element(rowIndex, colIndex);
238 }
239
240
243
244 RowRefType Row(size_type index) {
245 return RowRefType(this->Data + ROWSTRIDE * index);
246 }
247
249 ColumnRefType Column(size_type index) {
250 return ColumnRefType(this->Data + COLSTRIDE * index);
251 }
252
255 return DiagonalRefType(this->Data);
256 }
257
258 /* documented in base class */
259 ConstRowRefType Row(size_type index) const {
260 return BaseType::Row(index);
261 }
262
263 /* documented in base class */
264 ConstColumnRefType Column(size_type index) const {
265 return BaseType::Column(index);
266 }
267
268 /* documented in base class */
270 return BaseType::Diagonal();
271 }
272
273
276 template <vct::size_type __subRows, vct::size_type __subCols>
278 Ref(const size_type startRow = 0, const size_type startCol = 0) CISST_THROW(std::out_of_range) {
280 result(*this, startRow, startCol);
281 return result;
282 }
283
284 template <vct::size_type __subRows, vct::size_type __subCols>
286 Ref(const size_type startRow = 0, const size_type startCol = 0) const CISST_THROW(std::out_of_range) {
287 return BaseType::Ref(startRow, startCol);
288 }
289
290
292
293 void ExchangeRows(const size_type row1Index, const size_type row2Index) {
294 RowRefType row1( Row(row1Index) );
295 RowRefType row2( Row(row2Index) );
296 row1.SwapElementsWith(row2);
297 }
298
300 void ExchangeColumns(const size_type col1Index, const size_type col2Index) {
301 ColumnRefType col1( Column(col1Index) );
302 ColumnRefType col2( Column(col2Index) );
303 col1.SwapElementsWith(col2);
304 }
305
307
308 template <size_type __rows, stride_type __rowStride, stride_type __colStride, class __dataPtrType,
309 stride_type __indexStride, class __indexDataPtrType>
316
318 template <size_type __cols, stride_type __rowStride, stride_type __colStride, class __dataPtrType,
319 stride_type __indexStride, class __indexDataPtrType>
325
326
339 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
340 void RowPermutationOf(const vctFixedSizeConstMatrixBase<_rows, _cols, __rowStride, __colStride,
341 _elementType, __dataPtrType> & inputMatrix, const index_type permutedRowIndexes[])
342 {
343 index_type thisRowIndex;
344 for (thisRowIndex = 0; thisRowIndex < ROWS; ++thisRowIndex) {
345 Row(thisRowIndex).Assign( inputMatrix.Row(permutedRowIndexes[thisRowIndex]) );
346 }
347 }
348
361 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
362 void RowInversePermutationOf(const vctFixedSizeConstMatrixBase<_rows, _cols, __rowStride, __colStride,
363 _elementType, __dataPtrType> & inputMatrix, const index_type permutedRowIndexes[])
364 {
365 index_type thisRowIndex;
366 for (thisRowIndex = 0; thisRowIndex < ROWS; ++thisRowIndex) {
367 Row(permutedRowIndexes[thisRowIndex]).Assign( inputMatrix.Row(thisRowIndex) );
368 }
369 }
370
383 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
384 void ColumnPermutationOf(const vctFixedSizeConstMatrixBase<_rows, _cols, __rowStride, __colStride,
385 _elementType, __dataPtrType> & inputMatrix, const index_type permutedColumnIndexes[])
386 {
387 index_type thisColumnIndex;
388 for (thisColumnIndex = 0; thisColumnIndex < COLS; ++thisColumnIndex) {
389 Column(thisColumnIndex).Assign( inputMatrix.Column(permutedColumnIndexes[thisColumnIndex]) );
390 }
391 }
392
405 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
406 void ColumnInversePermutationOf(const vctFixedSizeConstMatrixBase<_rows, _cols, __rowStride, __colStride,
407 _elementType, __dataPtrType> & inputMatrix, const index_type permutedColumnIndexes[])
408 {
409 index_type thisColumnIndex;
410 for (thisColumnIndex = 0; thisColumnIndex < COLS; ++thisColumnIndex) {
411 Column(permutedColumnIndexes[thisColumnIndex]).Assign( inputMatrix.Column(thisColumnIndex) );
412 }
413 }
414
415
416
421 inline value_type SetAll(const value_type value) {
422 vctFixedSizeMatrixLoopEngines::
423 MioSi<typename vctStoreBackBinaryOperations<value_type>::SecondOperand>::
424 Run(*this, value);
425 return value;
426 }
427
428
437 inline bool Zeros(void) {
438 if (this->IsCompact()) {
439 memset(this->Pointer(), 0, this->size() * sizeof(value_type));
440 return true;
441 } else if (this->col_stride() == 1) {
442 /* memset row by row */
443 const size_type sizeOfRow = this->cols() * sizeof(value_type);
444 const stride_type rowStride = this->row_stride();
445 pointer currentPointer = this->Pointer();
446 const pointer endPointer = currentPointer + this->rows() * rowStride;
447 for (;
448 currentPointer != endPointer;
449 currentPointer += rowStride) {
450 memset(currentPointer, 0, sizeOfRow);
451 }
452 return true;
453 } else if (this->row_stride() == 1) {
454 /* memset col by col */
455 const size_type sizeOfCol = this->rows() * sizeof(value_type);
456 const stride_type colStride = this->col_stride();
457 pointer currentPointer = this->Pointer();
458 const pointer endPointer = currentPointer + this->cols() * colStride;
459 for (;
460 currentPointer != endPointer;
461 currentPointer += colStride) {
462 memset(currentPointer, 0, sizeOfCol);
463 }
464 return true;
465 } else {
466 this->SetAll(static_cast<value_type>(0));
467 return false;
468 }
469 }
470
471
474 template <stride_type __rowStride, stride_type __colStride, class __elementType, class __dataPtrType>
476 vctFixedSizeMatrixLoopEngines::
477 MoMi<typename vctUnaryOperations<value_type, __elementType>::Identity>::
478 Run(*this, other);
479 return *this;
480 }
481
482
501 inline ThisType & Assign(const value_type element0, ...)
502 {
503 iterator iter = begin();
504 (*iter) = element0;
505 ++iter;
506 va_list nextArg;
507 va_start(nextArg, element0);
508 for (; iter != end(); ++iter) {
509 (*iter) = static_cast<value_type>(va_arg(nextArg, typename cmnTypeTraits<value_type>::VaArgPromotion));
510 }
511 va_end(nextArg);
512 return *this;
513 }
514
515
537 inline ThisType & Assign(const value_type * elements, bool inputIsRowMajor = true)
538 {
539 if (inputIsRowMajor)
540 {
541 // row-major input means that the row-stride is equal to the number of elements
542 // in a row, i.e, COLS, and the column-stride is 1.
544 this->Assign(tmpRef);
545 }
546 else
547 {
548 // column-major input means that the column-stride is equal to the number of
549 // elements in a column, i.e., ROWS, and the row-stride is 1.
551 this->Assign(tmpRef);
552 }
553 return *this;
554 }
555
556
562 template <class __matrixOwnerType>
567
568
587 template <stride_type __rowStride, stride_type __colStride, class __elementType, class __dataPtrType>
588 inline ThisType & ForceAssign(const vctFixedSizeConstMatrixBase<_rows, _cols, __rowStride, __colStride,
589 __elementType, __dataPtrType> & other) {
590 return this->Assign(other);
591 }
592
593 template <class __matrixOwnerType>
595 return this->Assign(other);
596 }
597
598
599
668 template <class __matrixOwnerType>
670 bool performSafetyChecks = vctFastCopy::PerformChecks)
671 CISST_THROW(std::runtime_error)
672 {
673 return vctFastCopy::MatrixCopy(*this, source, performSafetyChecks);
674 }
675
676 template <class __dataPtrType>
678 bool performSafetyChecks = vctFastCopy::PerformChecks)
679 CISST_THROW(std::runtime_error)
680 {
681 return vctFastCopy::MatrixCopy(*this, source, performSafetyChecks);
682 }
683
684
685
686
692
693 /* documented in base class */
697
698
702
715 template <stride_type __input1RowStride, stride_type __input1ColStride, class __input1DataPtrType,
716 stride_type __input2RowStride, stride_type __input2ColStride, class __input2DataPtrType>
717 inline ThisType & SumOf(const vctFixedSizeConstMatrixBase<_rows, _cols, __input1RowStride, __input1ColStride,
718 value_type, __input1DataPtrType> & input1Matrix,
719 const vctFixedSizeConstMatrixBase<_rows, _cols, __input2RowStride, __input2ColStride,
720 value_type, __input2DataPtrType> & input2Matrix) {
722 ::Run(*this, input1Matrix, input2Matrix);
723 return *this;
724 }
725
726 /* documented above */
727 template <stride_type __input1RowStride, stride_type __input1ColStride, class __input1DataPtrType,
728 stride_type __input2RowStride, stride_type __input2ColStride, class __input2DataPtrType>
729 inline ThisType & DifferenceOf(const vctFixedSizeConstMatrixBase<_rows, _cols, __input1RowStride, __input1ColStride,
730 value_type, __input1DataPtrType> & input1Matrix,
731 const vctFixedSizeConstMatrixBase<_rows, _cols, __input2RowStride, __input2ColStride,
732 value_type, __input2DataPtrType> & input2Matrix) {
734 ::Run(*this, input1Matrix, input2Matrix);
735 return *this;
736 }
737
738 /* documented above */
739 template <stride_type __input1RowStride, stride_type __input1ColStride, class __input1DataPtrType,
740 stride_type __input2RowStride, stride_type __input2ColStride, class __input2DataPtrType>
741 inline ThisType & ElementwiseProductOf(const vctFixedSizeConstMatrixBase<_rows, _cols, __input1RowStride, __input1ColStride,
742 value_type, __input1DataPtrType> & input1Matrix,
743 const vctFixedSizeConstMatrixBase<_rows, _cols, __input2RowStride, __input2ColStride,
744 value_type, __input2DataPtrType> & input2Matrix) {
746 ::Run(*this, input1Matrix, input2Matrix);
747 return *this;
748 }
749
750 /* documented above */
751 template <stride_type __input1RowStride, stride_type __input1ColStride, class __input1DataPtrType,
752 stride_type __input2RowStride, stride_type __input2ColStride, class __input2DataPtrType>
753 inline ThisType & ElementwiseRatioOf(const vctFixedSizeConstMatrixBase<_rows, _cols, __input1RowStride, __input1ColStride,
754 value_type, __input1DataPtrType> & input1Matrix,
755 const vctFixedSizeConstMatrixBase<_rows, _cols, __input2RowStride, __input2ColStride,
756 value_type, __input2DataPtrType> & input2Matrix) {
758 ::Run(*this, input1Matrix, input2Matrix);
759 return *this;
760 }
761
762 /* documented above */
763 template <stride_type __input1RowStride, stride_type __input1ColStride, class __input1DataPtrType,
764 stride_type __input2RowStride, stride_type __input2ColStride, class __input2DataPtrType>
765 inline ThisType & ElementwiseMinOf(const vctFixedSizeConstMatrixBase<_rows, _cols, __input1RowStride, __input1ColStride,
766 value_type, __input1DataPtrType> & input1Matrix,
767 const vctFixedSizeConstMatrixBase<_rows, _cols, __input2RowStride, __input2ColStride,
768 value_type, __input2DataPtrType> & input2Matrix) {
770 ::Run(*this, input1Matrix, input2Matrix);
771 return *this;
772 }
773
774 /* documented above */
775 template <stride_type __input1RowStride, stride_type __input1ColStride, class __input1DataPtrType,
776 stride_type __input2RowStride, stride_type __input2ColStride, class __input2DataPtrType>
777 inline ThisType & ElementwiseMaxOf(const vctFixedSizeConstMatrixBase<_rows, _cols, __input1RowStride, __input1ColStride,
778 value_type, __input1DataPtrType> & input1Matrix,
779 const vctFixedSizeConstMatrixBase<_rows, _cols, __input2RowStride, __input2ColStride,
780 value_type, __input2DataPtrType> & input2Matrix) {
782 ::Run(*this, input1Matrix, input2Matrix);
783 return *this;
784 }
785
786
787
788
792
805 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
807 vctFixedSizeMatrixLoopEngines::
808 MioMi<typename vctStoreBackBinaryOperations<value_type>::Addition>::
809 Run(*this, otherMatrix);
810 return *this;
811 }
812
813 /* documented above */
814 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
816 vctFixedSizeMatrixLoopEngines::
817 MioMi<typename vctStoreBackBinaryOperations<value_type>::Subtraction>::
818 Run(*this, otherMatrix);
819 return *this;
820 }
821
822 /* documented above */
823 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
825 vctFixedSizeMatrixLoopEngines::
826 MioMi<typename vctStoreBackBinaryOperations<value_type>::Multiplication>::
827 Run(*this, otherMatrix);
828 return *this;
829 }
830
831 /* documented above */
832 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
834 vctFixedSizeMatrixLoopEngines::
835 MioMi<typename vctStoreBackBinaryOperations<value_type>::Division>::
836 Run(*this, otherMatrix);
837 return *this;
838 }
839
840 /* documented above */
841 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
843 vctFixedSizeMatrixLoopEngines::
844 MioMi<typename vctStoreBackBinaryOperations<value_type>::Minimum>::
845 Run(*this, otherMatrix);
846 return *this;
847 }
848
849 /* documented above */
850 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
852 vctFixedSizeMatrixLoopEngines::
853 MioMi<typename vctStoreBackBinaryOperations<value_type>::Maximum>::
854 Run(*this, otherMatrix);
855 return *this;
856 }
857
858 /* documented above */
859 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
863
864 /* documented above */
865 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
869
870
871
872
876
888 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
890 const value_type scalar) {
891 vctFixedSizeMatrixLoopEngines::
892 MoMiSi<typename vctBinaryOperations<value_type>::Addition>::
893 Run(*this, matrix, scalar);
894 return *this;
895 }
896
897 /* documented above */
898 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
900 const value_type scalar) {
901 vctFixedSizeMatrixLoopEngines::
902 MoMiSi<typename vctBinaryOperations<value_type>::Subtraction>::
903 Run(*this, matrix, scalar);
904 return *this;
905 }
906
907 /* documented above */
908 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
910 const value_type scalar) {
911 vctFixedSizeMatrixLoopEngines::
912 MoMiSi<typename vctBinaryOperations<value_type>::Multiplication>::
913 Run(*this, matrix, scalar);
914 return *this;
915 }
916
917 /* documented above */
918 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
920 const value_type scalar) {
921 vctFixedSizeMatrixLoopEngines::
922 MoMiSi<typename vctBinaryOperations<value_type>::Division>::
923 Run(*this, matrix, scalar);
924 return *this;
925 }
926
927 /* documented above */
928 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
930 const value_type upperBound) {
931 vctFixedSizeMatrixLoopEngines::
932 MoMiSi<typename vctBinaryOperations<value_type>::Minimum>::
933 Run(*this, matrix, upperBound);
934 return *this;
935 }
936
937 /* documented above */
938 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
940 const value_type lowerBound) {
941 vctFixedSizeMatrixLoopEngines::
942 MoMiSi<typename vctBinaryOperations<value_type>::Maximum>::
943 Run(*this, matrix, lowerBound);
944 return *this;
945 }
946
947
948
949
953
965 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
966 inline ThisType & SumOf(const value_type scalar,
968 vctFixedSizeMatrixLoopEngines::
969 MoSiMi<typename vctBinaryOperations<value_type>::Addition>::
970 Run(*this, scalar, matrix);
971 return *this;
972 }
973
974 /* documented above */
975 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
976 inline ThisType & DifferenceOf(const value_type scalar,
978 vctFixedSizeMatrixLoopEngines::
979 MoSiMi<typename vctBinaryOperations<value_type>::Subtraction>::
980 Run(*this, scalar, matrix);
981 return *this;
982 }
983
984 /* documented above */
985 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
986 inline ThisType & ProductOf(const value_type scalar,
988 vctFixedSizeMatrixLoopEngines::
989 MoSiMi<typename vctBinaryOperations<value_type>::Multiplication>::
990 Run(*this, scalar, matrix);
991 return *this;
992 }
993
994 /* documented above */
995 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
996 inline ThisType & RatioOf(const value_type scalar,
998 vctFixedSizeMatrixLoopEngines::
999 MoSiMi<typename vctBinaryOperations<value_type>::Division>::
1000 Run(*this, scalar, matrix);
1001 return *this;
1002 }
1003
1004 /* documented above */
1005 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
1006 inline ThisType & ClippedAboveOf(const value_type upperBound,
1008 vctFixedSizeMatrixLoopEngines::
1009 MoSiMi<typename vctBinaryOperations<value_type>::Minimum>::
1010 Run(*this, upperBound, matrix);
1011 return *this;
1012 }
1013
1014 /* documented above */
1015 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
1016 inline ThisType & ClippedBelowOf(const value_type lowerBound,
1018 vctFixedSizeMatrixLoopEngines::
1019 MoSiMi<typename vctBinaryOperations<value_type>::Maximum>::
1020 Run(*this, lowerBound, matrix);
1021 return *this;
1022 }
1023
1024
1028
1040 inline ThisType & Add(const value_type scalar) {
1041 vctFixedSizeMatrixLoopEngines::
1042 MioSi<typename vctStoreBackBinaryOperations<value_type>::Addition>::
1043 Run(*this, scalar);
1044 return *this;
1045 }
1046
1047 /* documented above */
1048 inline ThisType & Subtract(const value_type scalar) {
1049 vctFixedSizeMatrixLoopEngines::
1050 MioSi<typename vctStoreBackBinaryOperations<value_type>::Subtraction>::
1051 Run(*this, scalar);
1052 return *this;
1053 }
1054
1055 /* documented above */
1056 inline ThisType & Multiply(const value_type scalar) {
1057 vctFixedSizeMatrixLoopEngines::
1058 MioSi<typename vctStoreBackBinaryOperations<value_type>::Multiplication>::
1059 Run(*this, scalar);
1060 return *this;
1061 }
1062
1063 /* documented above */
1064 inline ThisType & Divide(const value_type scalar) {
1065 vctFixedSizeMatrixLoopEngines::
1066 MioSi<typename vctStoreBackBinaryOperations<value_type>::Division>::
1067 Run(*this, scalar);
1068 return *this;
1069 }
1070
1071 /* documented above */
1072 inline ThisType & ClipAbove(const value_type upperBound) {
1073 vctFixedSizeMatrixLoopEngines::
1074 MioSi<typename vctStoreBackBinaryOperations<value_type>::Minimum>::
1075 Run(*this, upperBound);
1076 return *this;
1077 }
1078
1079 /* documented above */
1080 inline ThisType & ClipBelow(const value_type lowerBound) {
1081 vctFixedSizeMatrixLoopEngines::
1082 MioSi<typename vctStoreBackBinaryOperations<value_type>::Maximum>::
1083 Run(*this, lowerBound);
1084 return *this;
1085 }
1086
1087 /* documented above */
1088 inline ThisType & operator += (const value_type scalar) {
1089 return this->Add(scalar);
1090 }
1091
1092 /* documented above */
1093 inline ThisType & operator -= (const value_type scalar) {
1094 return this->Subtract(scalar);
1095 }
1096
1097 /* documented above */
1098 inline ThisType & operator *= (const value_type scalar) {
1099 return this->Multiply(scalar);
1100 }
1101
1102 /* documented above */
1103 inline ThisType & operator /= (const value_type scalar) {
1104 return this->Divide(scalar);
1105 }
1106
1107
1108
1109 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
1110 inline ThisType & AddProductOf(const value_type scalar,
1112 {
1113 vctFixedSizeMatrixLoopEngines::
1114 MioSiMi<
1117 Run(*this, scalar, otherMatrix);
1118 return *this;
1119 }
1120
1121
1122 template <stride_type __rowStride1, stride_type __colStride1, class __dataPtrType1,
1123 stride_type __rowStride2, stride_type __colStride2, class __dataPtrType2>
1134
1135
1139
1149 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
1151 vctFixedSizeMatrixLoopEngines::
1152 MoMi<typename vctUnaryOperations<value_type>::AbsValue>::
1153 Run(*this, otherMatrix);
1154 return *this;
1155 }
1156
1157 /* documented above */
1158 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
1160 vctFixedSizeMatrixLoopEngines::
1161 MoMi<typename vctUnaryOperations<value_type>::Negation>::
1162 Run(*this, otherMatrix);
1163 return *this;
1164 }
1165
1166 /* documented above */
1167 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
1169 vctFixedSizeMatrixLoopEngines::
1170 MoMi<typename vctUnaryOperations<value_type>::Floor>::
1171 Run(*this, otherMatrix);
1172 return *this;
1173 }
1174
1175 /* documented above */
1176 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
1178 vctFixedSizeMatrixLoopEngines::
1179 MoMi<typename vctUnaryOperations<value_type>::Ceil>::
1180 Run(*this, otherMatrix);
1181 return *this;
1182 }
1183
1184
1185
1186
1187 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
1192
1193
1194
1198
1205 inline ThisType & AbsSelf(void) {
1206 vctFixedSizeMatrixLoopEngines::
1207 Mio<typename vctStoreBackUnaryOperations<value_type>::MakeAbs>::
1208 Run(*this);
1209 return *this;
1210 }
1211
1212 /* documented above */
1213 inline ThisType & NegationSelf(void) {
1214 vctFixedSizeMatrixLoopEngines::
1215 Mio<typename vctStoreBackUnaryOperations<value_type>::MakeNegation>::
1216 Run(*this);
1217 return *this;
1218 }
1219
1220 /* documented above */
1221 inline ThisType & FloorSelf(void) {
1222 vctFixedSizeMatrixLoopEngines::
1223 Mio<typename vctStoreBackUnaryOperations<value_type>::MakeFloor>::
1224 Run(*this);
1225 return *this;
1226 }
1227
1228 /* documented above */
1229 inline ThisType & CeilSelf(void) {
1230 vctFixedSizeMatrixLoopEngines::
1231 Mio<typename vctStoreBackUnaryOperations<value_type>::MakeCeil>::
1232 Run(*this);
1233 return *this;
1234 }
1235
1236
1237
1246 template <size_type __input1Cols, stride_type __input1RowStride, stride_type __input1ColStride, class __input1DataPtrType,
1247 stride_type __input2RowStride, stride_type __input2ColStride, class __input2DataPtrType>
1248 void ProductOf(const vctFixedSizeConstMatrixBase<_rows, __input1Cols, __input1RowStride, __input1ColStride,
1249 _elementType, __input1DataPtrType> & input1Matrix,
1250 const vctFixedSizeConstMatrixBase<__input1Cols, _cols, __input2RowStride, __input2ColStride,
1251 _elementType, __input2DataPtrType> & input2Matrix) {
1252 typedef vctFixedSizeConstMatrixBase<_rows, __input1Cols, __input1RowStride, __input1ColStride,
1253 _elementType, __input1DataPtrType> Input1MatrixType;
1254 typedef vctFixedSizeConstMatrixBase<__input1Cols, _cols, __input2RowStride, __input2ColStride,
1255 _elementType, __input2DataPtrType> Input2MatrixType;
1256 typedef typename Input1MatrixType::ConstRowRefType Input1RowRefType;
1257 typedef typename Input2MatrixType::ConstColumnRefType Input2ColumnRefType;
1258 vctFixedSizeMatrixLoopEngines::
1259 Product<typename vctBinaryOperations<value_type, Input1RowRefType, Input2ColumnRefType>::DotProduct>::
1260 Run((*this), input1Matrix, input2Matrix);
1261 }
1262
1265 template <stride_type __stride1, class __dataPtrType1, stride_type __stride2, class __dataPtrType2>
1268 {
1271 typedef typename InputColumnType::ColConstMatrixRefType ColMatrixType;
1272 typedef typename InputRowType::RowConstMatrixRefType RowMatrixType;
1273 const ColMatrixType colMatrix = columnVector.AsColMatrix();
1274 const RowMatrixType rowMatrix = rowVector.AsRowMatrix();
1275 this->ProductOf(colMatrix, rowMatrix);
1276 }
1277
1278
1292 template <size_type _subRows, size_type _subCols>
1299
1302 bool FromStreamRaw(std::istream & inputStream, const char delimiter = ' ')
1303 {
1304 const size_type myRows = this->rows();
1305 const size_type myCols = this->cols();
1306 size_type indexRow, indexCol;
1307 char c;
1308 bool valid = true;
1309 ThisType temp;
1310 for (indexRow = 0; (indexRow < myRows) && valid; ++indexRow) {
1311 for (indexCol = 0; (indexCol < myCols) && valid; ++indexCol) {
1312 inputStream >> temp.Element(indexRow, indexCol);
1313 if (inputStream.fail()) {
1314 valid = false;
1315 inputStream.clear();
1316 }
1317 // Look for the delimiter
1318 if (valid && !isspace(delimiter) && (indexCol < myCols-1)) {
1319 inputStream >> c;
1320 if (c != delimiter)
1321 valid = false;
1322 }
1323 } // end for cols
1324 // Look for the delimiter
1325 if (valid && !isspace(delimiter) && (indexRow < myRows-1)) {
1326 inputStream >> c;
1327 if (c != delimiter)
1328 valid = false;
1329 }
1330 } // end for rows
1331 if (valid) {
1332 // Only update the object if the parsing was successful for all elements.
1333 Assign(temp);
1334 }
1335 return valid;
1336 }
1337
1339 void DeSerializeRaw(std::istream & inputStream)
1340 {
1341 const size_type myRows = this->rows();
1342 const size_type myCols = this->cols();
1343 size_type indexRow, indexCol;
1344
1345 for (indexRow = 0; indexRow < myRows; ++indexRow) {
1346 for (indexCol = 0; indexCol < myCols; ++indexCol) {
1347 cmnDeSerializeRaw(inputStream, this->Element(indexRow, indexCol));
1348 }
1349 }
1350 }
1351
1352};
1353
1354
1355#endif // _vctFixedSizeMatrixBase_h
cmnVaArgPromotion< _elementType >::Type VaArgPromotion
Definition cmnTypeTraits.h:167
Returns the product of the two InputType object.
Definition vctBinaryOperations.h:116
Definition vctForwardDeclarations.h:145
static bool MatrixCopy(_destinationMatrixType &destination, const _sourceMatrixType &source, bool performSafetyChecks)
Definition vctFastCopy.h:208
static const bool PerformChecks
Definition vctFastCopy.h:119
A template for a fixed size matrix with fixed spacing in memory.
Definition vctFixedSizeConstMatrixBase.h:104
vctFixedSizeVector< _elementType, COLS > RowValueType
Definition vctFixedSizeConstMatrixBase.h:172
size_type cols() const
Definition vctFixedSizeConstMatrixBase.h:282
vctFixedSizeVector< _elementType, ROWS > ColumnValueType
Definition vctFixedSizeConstMatrixBase.h:175
vctFixedSizeConstMatrixRef< _elementType, __subRows, __subCols, _rowStride, _colStride > Ref(const size_type startRow=0, const size_type startCol=0) const CISST_THROW(std
Definition vctFixedSizeConstMatrixBase.h:418
difference_type row_stride() const
Definition vctFixedSizeConstMatrixBase.h:303
vctFixedSizeVectorRef< _elementType, COLS, COLSTRIDE > RowRefType
Definition vctFixedSizeConstMatrixBase.h:152
bool IsCompact(void) const
Definition vctFixedSizeConstMatrixBase.h:639
size_type rows() const
Definition vctFixedSizeConstMatrixBase.h:277
vctFixedSizeConstMatrixRef< _elementType, _cols, _rows, _colStride, _rowStride > ConstRefTransposeType
Definition vctFixedSizeConstMatrixBase.h:187
vctFixedSizeConstVectorRef< _elementType, DIAGONAL_LENGTH, DIAGONAL_STRIDE > ConstDiagonalRefType
Definition vctFixedSizeConstMatrixBase.h:164
vctFixedSizeConstVectorRef< _elementType, ROWS, ROWSTRIDE > ConstColumnRefType
Definition vctFixedSizeConstMatrixBase.h:156
difference_type col_stride() const
Definition vctFixedSizeConstMatrixBase.h:309
vctFixedSizeConstVectorRef< _elementType, COLS, COLSTRIDE > ConstRowRefType
Definition vctFixedSizeConstMatrixBase.h:148
vctFixedSizeMatrixRef< _elementType, _cols, _rows, _colStride, _rowStride > RefTransposeType
Definition vctFixedSizeConstMatrixBase.h:192
const_reverse_iterator rbegin() const
Definition vctFixedSizeConstMatrixBase.h:252
const_reference Element(size_type rowIndex, size_type colIndex) const
Definition vctFixedSizeConstMatrixBase.h:397
vctFixedSizeVectorRef< _elementType, ROWS, ROWSTRIDE > ColumnRefType
Definition vctFixedSizeConstMatrixBase.h:160
ConstColumnRefType Column(size_type index) const
Definition vctFixedSizeConstMatrixBase.h:406
const_reference at(size_type index) const CISST_THROW(std
Definition vctFixedSizeConstMatrixBase.h:368
size_type size() const
Definition vctFixedSizeConstMatrixBase.h:266
const_pointer Pointer(void) const
Definition vctFixedSizeConstMatrixBase.h:336
ConstRowRefType operator[](size_type index) const
Definition vctFixedSizeConstMatrixBase.h:321
ConstDiagonalRefType Diagonal(void) const
Definition vctFixedSizeConstMatrixBase.h:410
const_reverse_iterator rend() const
Definition vctFixedSizeConstMatrixBase.h:259
const_reference operator()(size_type rowIndex, size_type colIndex) const CISST_THROW(std
Definition vctFixedSizeConstMatrixBase.h:386
vctFixedSizeVectorRef< _elementType, DIAGONAL_LENGTH, DIAGONAL_STRIDE > DiagonalRefType
Definition vctFixedSizeConstMatrixBase.h:168
ConstRowRefType Row(size_type index) const
Definition vctFixedSizeConstMatrixBase.h:402
void ThrowUnlessValidIndex(size_type index) const CISST_THROW(std
Definition vctFixedSizeConstMatrixBase.h:220
const_iterator begin() const
Definition vctFixedSizeConstMatrixBase.h:238
const_iterator end() const
Definition vctFixedSizeConstMatrixBase.h:245
DataType Data
Definition vctFixedSizeConstMatrixBase.h:216
ConstRefTransposeType TransposeRef(void) const
Definition vctFixedSizeConstMatrixRef.h:172
Definition vctForwardDeclarations.h:106
A template for a fixed length vector with fixed spacing in memory.
Definition vctFixedSizeConstVectorBase.h:108
RowConstMatrixRefType AsRowMatrix(void) const
Definition vctFixedSizeConstVectorBase.h:399
ColConstMatrixRefType AsColMatrix(void) const
Definition vctFixedSizeConstVectorBase.h:404
Definition vctFixedSizeMatrixBase.h:1294
vctFixedSizeMatrixRef< value_type, _subRows, _subCols, ROWSTRIDE, COLSTRIDE > Type
Definition vctFixedSizeMatrixBase.h:1297
A template for a fixed size matrix with fixed spacings in memory.
Definition vctFixedSizeMatrixBase.h:60
ThisType & ForceAssign(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
Definition vctFixedSizeMatrixBase.h:588
void SelectRowsFrom(const vctFixedSizeConstMatrixBase< __rows, _cols, __rowStride, __colStride, _elementType, __dataPtrType > &inputMatrix, const vctFixedSizeConstVectorBase< _rows, __indexStride, index_type, __indexDataPtrType > &rowIndexVector)
Definition vctFixedSizeMatrixBase.h:310
ThisType & ElementwiseMinOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __input1RowStride, __input1ColStride, value_type, __input1DataPtrType > &input1Matrix, const vctFixedSizeConstMatrixBase< _rows, _cols, __input2RowStride, __input2ColStride, value_type, __input2DataPtrType > &input2Matrix)
Definition vctFixedSizeMatrixBase.h:765
reference operator()(size_type rowIndex, size_type colIndex) CISST_THROW(std
Definition vctFixedSizeMatrixBase.h:215
void DeSerializeRaw(std::istream &inputStream)
Definition vctFixedSizeMatrixBase.h:1339
ThisType & Divide(const value_type scalar)
Definition vctFixedSizeMatrixBase.h:1064
bool FromStreamRaw(std::istream &inputStream, const char delimiter=' ')
Definition vctFixedSizeMatrixBase.h:1302
ThisType & ClippedAboveOf(const value_type upperBound, const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
Definition vctFixedSizeMatrixBase.h:1006
ThisType & AbsSelf(void)
Definition vctFixedSizeMatrixBase.h:1205
ConstRowRefType operator[](size_type index) const
Definition vctFixedSizeMatrixBase.h:153
ThisType & ElementwiseProductOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __input1RowStride, __input1ColStride, value_type, __input1DataPtrType > &input1Matrix, const vctFixedSizeConstMatrixBase< _rows, _cols, __input2RowStride, __input2ColStride, value_type, __input2DataPtrType > &input2Matrix)
Definition vctFixedSizeMatrixBase.h:741
ThisType & SumOf(const value_type scalar, const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
Definition vctFixedSizeMatrixBase.h:966
void ProductOf(const vctFixedSizeConstMatrixBase< _rows, __input1Cols, __input1RowStride, __input1ColStride, _elementType, __input1DataPtrType > &input1Matrix, const vctFixedSizeConstMatrixBase< __input1Cols, _cols, __input2RowStride, __input2ColStride, _elementType, __input2DataPtrType > &input2Matrix)
Definition vctFixedSizeMatrixBase.h:1248
ThisType & operator-=(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:866
void RowPermutationOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, _elementType, __dataPtrType > &inputMatrix, const index_type permutedRowIndexes[])
Definition vctFixedSizeMatrixBase.h:340
void ExchangeRows(const size_type row1Index, const size_type row2Index)
Definition vctFixedSizeMatrixBase.h:293
reverse_iterator rend()
Definition vctFixedSizeMatrixBase.h:135
bool Zeros(void)
Definition vctFixedSizeMatrixBase.h:437
ThisType & FloorOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:1168
vctFixedSizeConstMatrixRef< _elementType, __subRows, __subCols, _rowStride, _colStride > Ref(const size_type startRow=0, const size_type startCol=0) const CISST_THROW(std
Definition vctFixedSizeMatrixBase.h:286
pointer Pointer(void)
Definition vctFixedSizeMatrixBase.h:168
ConstColumnRefType Column(size_type index) const
Definition vctFixedSizeMatrixBase.h:264
void SelectColsFrom(const vctFixedSizeConstMatrixBase< _rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > &inputMatrix, const vctFixedSizeConstVectorBase< _cols, __indexStride, index_type, __indexDataPtrType > &colIndexVector)
Definition vctFixedSizeMatrixBase.h:320
ThisType & ForceAssign(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &other)
Definition vctFixedSizeMatrixBase.h:594
ThisType & TransposeOf(const vctFixedSizeConstMatrixBase< _cols, _rows, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:1188
ThisType & operator/=(const value_type scalar)
Definition vctFixedSizeMatrixBase.h:1103
const_pointer Pointer(size_type rowIndex, size_type colIndex) const
Definition vctFixedSizeMatrixBase.h:173
ThisType & Add(const value_type scalar)
Definition vctFixedSizeMatrixBase.h:1040
ColumnRefType Column(size_type index)
Definition vctFixedSizeMatrixBase.h:249
void ExchangeColumns(const size_type col1Index, const size_type col2Index)
Definition vctFixedSizeMatrixBase.h:300
ConstDiagonalRefType Diagonal(void) const
Definition vctFixedSizeMatrixBase.h:269
ThisType & ElementwiseRatioOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __input1RowStride, __input1ColStride, value_type, __input1DataPtrType > &input1Matrix, const vctFixedSizeConstMatrixBase< _rows, _cols, __input2RowStride, __input2ColStride, value_type, __input2DataPtrType > &input2Matrix)
Definition vctFixedSizeMatrixBase.h:753
ThisType & Assign(const value_type *elements, bool inputIsRowMajor=true)
Definition vctFixedSizeMatrixBase.h:537
bool FastCopyOf(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &source, bool performSafetyChecks=vctFastCopy::PerformChecks) CISST_THROW(std
Definition vctFixedSizeMatrixBase.h:669
ThisType & DifferenceOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __input1RowStride, __input1ColStride, value_type, __input1DataPtrType > &input1Matrix, const vctFixedSizeConstMatrixBase< _rows, _cols, __input2RowStride, __input2ColStride, value_type, __input2DataPtrType > &input2Matrix)
Definition vctFixedSizeMatrixBase.h:729
ConstRefTransposeType TransposeRef(void) const
Definition vctFixedSizeMatrixBase.h:694
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
ThisType & operator*=(const value_type scalar)
Definition vctFixedSizeMatrixBase.h:1098
ThisType & Multiply(const value_type scalar)
Definition vctFixedSizeMatrixBase.h:1056
ThisType & DifferenceOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix, const value_type scalar)
Definition vctFixedSizeMatrixBase.h:899
ThisType & ElementwiseMaxOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __input1RowStride, __input1ColStride, value_type, __input1DataPtrType > &input1Matrix, const vctFixedSizeConstMatrixBase< _rows, _cols, __input2RowStride, __input2ColStride, value_type, __input2DataPtrType > &input2Matrix)
Definition vctFixedSizeMatrixBase.h:777
ThisType & RatioOf(const value_type scalar, const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
Definition vctFixedSizeMatrixBase.h:996
ThisType & NegationOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:1159
void ColumnInversePermutationOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, _elementType, __dataPtrType > &inputMatrix, const index_type permutedColumnIndexes[])
Definition vctFixedSizeMatrixBase.h:406
vctFixedSizeMatrixRef< _elementType, __subRows, __subCols, _rowStride, _colStride > Ref(const size_type startRow=0, const size_type startCol=0) CISST_THROW(std
Definition vctFixedSizeMatrixBase.h:278
const_reverse_iterator rbegin() const
Definition vctFixedSizeMatrixBase.h:129
RowRefType Row(size_type index)
Definition vctFixedSizeMatrixBase.h:244
ThisType & NegationSelf(void)
Definition vctFixedSizeMatrixBase.h:1213
ThisType & CeilSelf(void)
Definition vctFixedSizeMatrixBase.h:1229
ThisType & ClippedAboveOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix, const value_type upperBound)
Definition vctFixedSizeMatrixBase.h:929
const_reverse_iterator rend() const
Definition vctFixedSizeMatrixBase.h:141
const_pointer Pointer(void) const
Definition vctFixedSizeMatrixBase.h:178
ThisType & Subtract(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:815
ConstRowRefType Row(size_type index) const
Definition vctFixedSizeMatrixBase.h:259
ThisType & ClippedBelowOf(const value_type lowerBound, const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
Definition vctFixedSizeMatrixBase.h:1016
ThisType & ClipBelow(const value_type lowerBound)
Definition vctFixedSizeMatrixBase.h:1080
ThisType & ClippedBelowOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix, const value_type lowerBound)
Definition vctFixedSizeMatrixBase.h:939
ThisType & Assign(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &other)
Definition vctFixedSizeMatrixBase.h:563
void ColumnPermutationOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, _elementType, __dataPtrType > &inputMatrix, const index_type permutedColumnIndexes[])
Definition vctFixedSizeMatrixBase.h:384
DiagonalRefType Diagonal(void)
Definition vctFixedSizeMatrixBase.h:254
const_iterator begin() const
Definition vctFixedSizeMatrixBase.h:109
ThisType & DifferenceOf(const value_type scalar, const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
Definition vctFixedSizeMatrixBase.h:976
ThisType & ElementwiseMultiply(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:824
ThisType & ClipAbove(const value_type upperBound)
Definition vctFixedSizeMatrixBase.h:1072
ThisType & ProductOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix, const value_type scalar)
Definition vctFixedSizeMatrixBase.h:909
ThisType & ProductOf(const value_type scalar, const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
Definition vctFixedSizeMatrixBase.h:986
iterator end()
Definition vctFixedSizeMatrixBase.h:114
ThisType & ElementwiseMin(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:842
ThisType & AddProductOf(const value_type scalar, const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:1110
void RowInversePermutationOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, _elementType, __dataPtrType > &inputMatrix, const index_type permutedRowIndexes[])
Definition vctFixedSizeMatrixBase.h:362
ThisType & CeilOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:1177
ThisType & ElementwiseMax(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:851
const_reference operator()(size_type rowIndex, size_type colIndex) const CISST_THROW(std
Definition vctFixedSizeMatrixBase.h:220
ThisType & SumOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix, const value_type scalar)
Definition vctFixedSizeMatrixBase.h:889
RowRefType operator[](size_type index)
Definition vctFixedSizeMatrixBase.h:148
reference at(size_type rowIndex, size_type colIndex) CISST_THROW(std
Definition vctFixedSizeMatrixBase.h:202
ThisType & AbsOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:1150
ThisType & RatioOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix, const value_type scalar)
Definition vctFixedSizeMatrixBase.h:919
vctFixedSizeMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, typename vctFixedSizeMatrixTraits< _elementType, _rows, _cols, _rowMajor?_cols:1, _rowMajor?1:_rows >::array > ThisType
Definition vctFixedSizeMatrixBase.h:70
ThisType & SumOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __input1RowStride, __input1ColStride, value_type, __input1DataPtrType > &input1Matrix, const vctFixedSizeConstMatrixBase< _rows, _cols, __input2RowStride, __input2ColStride, value_type, __input2DataPtrType > &input2Matrix)
Definition vctFixedSizeMatrixBase.h:717
reverse_iterator rbegin()
Definition vctFixedSizeMatrixBase.h:124
iterator begin()
Definition vctFixedSizeMatrixBase.h:104
const_reference Element(size_type rowIndex, size_type colIndex) const
Definition vctFixedSizeMatrixBase.h:236
bool FastCopyOf(const vctFixedSizeConstMatrixBase< ROWS, COLS, ROWSTRIDE, COLSTRIDE, value_type, __dataPtrType > &source, bool performSafetyChecks=vctFastCopy::PerformChecks) CISST_THROW(std
Definition vctFixedSizeMatrixBase.h:677
ThisType & Subtract(const value_type scalar)
Definition vctFixedSizeMatrixBase.h:1048
const_iterator end() const
Definition vctFixedSizeMatrixBase.h:119
const_reference at(size_type rowIndex, size_type colIndex) const CISST_THROW(std
Definition vctFixedSizeMatrixBase.h:208
ThisType & Add(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:806
ThisType & ElementwiseDivide(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:833
const_reference at(size_type index) const CISST_THROW(std
Definition vctFixedSizeMatrixBase.h:193
ThisType & FloorSelf(void)
Definition vctFixedSizeMatrixBase.h:1221
reference at(size_type index) CISST_THROW(std
Definition vctFixedSizeMatrixBase.h:187
value_type SetAll(const value_type value)
Definition vctFixedSizeMatrixBase.h:421
reference Element(size_type rowIndex, size_type colIndex)
Definition vctFixedSizeMatrixBase.h:231
ThisType & Assign(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
Definition vctFixedSizeMatrixBase.h:475
vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, typename vctFixedSizeMatrixTraits< _elementType, _rows, _cols, _rowMajor?_cols:1, _rowMajor?1:_rows >::array > BaseType
Definition vctFixedSizeMatrixBase.h:74
ThisType & operator+=(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &otherMatrix)
Definition vctFixedSizeMatrixBase.h:860
ThisType & AddElementwiseProductOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride1, __colStride1, value_type, __dataPtrType1 > &matrix1, const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride2, __colStride2, value_type, __dataPtrType2 > &matrix2)
Definition vctFixedSizeMatrixBase.h:1124
void OuterProductOf(const vctFixedSizeConstVectorBase< _rows, __stride1, _elementType, __dataPtrType1 > &columnVector, const vctFixedSizeConstVectorBase< _cols, __stride2, _elementType, __dataPtrType2 > &rowVector)
Definition vctFixedSizeMatrixBase.h:1266
Definition vctFixedSizeMatrixLoopEngines.h:76
static void Run(_outputMatrixType &outputMatrix, const _inputMatrixType &inputMatrix, const _indexVectorType &indexVector)
Definition vctFixedSizeMatrixLoopEngines.h:812
Definition vctForwardDeclarations.h:110
Define common container related types based on the properties of a fixed size container.
Definition vctFixedSizeMatrixTraits.h:47
vctFixedStrideMatrixConstIterator< _elementType, -_colStride, _cols, -_rowStride > const_reverse_iterator
Definition vctFixedSizeMatrixTraits.h:62
@ COLSTRIDE
Definition vctFixedSizeMatrixTraits.h:74
@ ROWSTRIDE
Definition vctFixedSizeMatrixTraits.h:74
vctFixedStrideMatrixIterator< _elementType, _colStride, _cols, _rowStride > iterator
Definition vctFixedSizeMatrixTraits.h:53
@ ROWS
Definition vctFixedSizeMatrixTraits.h:67
@ LENGTH
Definition vctFixedSizeMatrixTraits.h:67
@ COLS
Definition vctFixedSizeMatrixTraits.h:67
vctFixedStrideMatrixConstIterator< _elementType, _colStride, _cols, _rowStride > const_iterator
Definition vctFixedSizeMatrixTraits.h:56
vctFixedStrideMatrixIterator< _elementType, -_colStride, _cols, -_rowStride > reverse_iterator
Definition vctFixedSizeMatrixTraits.h:59
Returns the sum of the two InputType object.
Definition vctStoreBackBinaryOperations.h:76
void cmnDeSerializeRaw(std::istream &inputStream, _elementType &data) CISST_THROW(std
Definition cmnDeSerializer.h:82
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 the class cmnTypeTraits.
STL namespace.
size_t size_type
Definition vctContainerTraits.h:35
ptrdiff_t stride_type
Definition vctContainerTraits.h:37
const_iterator end(void) const
Definition vctDynamicConstMatrixBase.h:209
void vctFixedSizeMatrixBaseAssignDynamicConstMatrixBase(vctFixedSizeMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &fixedSizeMatrix, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &dynamicMatrix)
Definition vctDynamicConstMatrixBase.h:1199
OwnerType::iterator iterator
Definition vctDynamicConstMatrixBase.h:92
const_iterator begin(void) const
Definition vctDynamicConstMatrixBase.h:203
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > ThisType
Definition vctDynamicConstMatrixBase.h:86
Declaration of vctFixedSizeConstMatrixBase.