cisst-saw
Loading...
Searching...
No Matches
vctDynamicConstVectorBase.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-2023 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 _vctDynamicConstVectorBase_h
21#define _vctDynamicConstVectorBase_h
22
27
33
40
41#include <iostream>
42#include <iomanip>
43#include <sstream>
44
45/* Forward declarations */
46#ifndef DOXYGEN
47template <class _vectorOwnerType, class __vectorOwnerType, class _elementType,
48 class _elementOperationType>
52
53template <class _vectorOwnerType, class _elementType,
54 class _elementOperationType>
57 const _elementType & scalar);
58#endif // DOXYGEN
59
60
76template <class _vectorOwnerType, typename _elementType>
78{
79public:
80 /* define most types from vctContainerTraits */
82
85
87 typedef _vectorOwnerType OwnerType;
88
90 typedef typename OwnerType::iterator iterator;
91
93 typedef typename OwnerType::const_iterator const_iterator;
94
96 typedef typename OwnerType::reverse_iterator reverse_iterator;
97
99 typedef typename OwnerType::const_reverse_iterator const_reverse_iterator;
100
103
107
111
113
117 typedef typename TypeTraits::BoolType BoolType;
118
122
123
124protected:
127
128
130 inline void ThrowUnlessValidIndex(size_type index) const CISST_THROW(std::out_of_range) {
131 if (! ValidIndex(index)) {
132 cmnThrow(std::out_of_range("vctDynamicVector: Invalid index"));
133 }
134 }
135
136public:
140 const_iterator begin(void) const {
141 return Vector.begin();
142 }
143 const_iterator cbegin(void) const {
144 return Vector.begin();
145 }
146
147
151 const_iterator end(void) const {
152 return Vector.end();
153 }
154 const_iterator cend(void) const {
155 return Vector.end();
156 }
157
158
163 return Vector.rbegin();
164 }
166 return Vector.rbegin();
167 }
168
169
174 return Vector.rend();
175 }
177 return Vector.rend();
178 }
179
180
184 size_type size(void) const {
185 return Vector.size();
186 }
187
189 difference_type stride() const {
190 return Vector.stride();
191 }
192
195 bool empty() const {
196 return (size() == 0);
197 }
198
201 const_reference operator[](index_type index) const {
202 return *Pointer(index);
203 }
204
210 const_reference at(size_type index) const CISST_THROW(std::out_of_range) {
212 return *(Pointer(index));
213 }
214
216 inline const_reference operator() (size_type index) const CISST_THROW(std::out_of_range) {
217 return this->at(index);
218 }
219
220
225 const_reference Element(size_type index) const {
226 return *(Pointer(index));
227 }
228
229
233 const OwnerType & Owner(void) const {
234 return this->Vector;
235 }
236
237
241 const_pointer Pointer(index_type index = 0) const {
242 return Vector.Pointer(index);
243 }
244
245
247 inline bool ValidIndex(size_type index) const {
248 return (index < size());
249 }
250
251
258
260
263 const value_type & X(void) const {
264 CMN_ASSERT(this->size() > 0);
265 return *(Pointer(0));
266 }
267
268
271 const value_type & Y(void) const {
272 CMN_ASSERT(this->size() > 1);
273 return *(Pointer(1));
274 }
275
276
279 const value_type & Z(void) const {
280 CMN_ASSERT(this->size() > 2);
281 return *(Pointer(2));
282 }
283
286 const value_type & W(void) const {
287 CMN_ASSERT(this->size() > 3);
288 return *(Pointer(3));
289 }
290
296 CMN_ASSERT(this->size() > 1);
298 }
299
303 CMN_ASSERT(this->size() > 2);
304 return vctDynamicConstVectorRef<_elementType>(2, Pointer(0), 2 * this->stride());
305 }
306
310 CMN_ASSERT(this->size() > 3);
311 return vctDynamicConstVectorRef<_elementType>(2, Pointer(0), 3 * this->stride());
312 }
313
317 CMN_ASSERT(this->size() > 2);
319 }
320
324 CMN_ASSERT(this->size() > 3);
325 return vctDynamicConstVectorRef<_elementType>(2, Pointer(1), 2 * this->stride());
326 }
327
331 CMN_ASSERT(this->size() > 3);
333 }
334
341 CMN_ASSERT(this->size() > 2);
343 }
344
348 CMN_ASSERT(this->size() > 3);
350 }
351
358 CMN_ASSERT(this->size() > 3);
360 }
361
363
365 vctDynamicConstVectorRef<_elementType>
366 Ref(const size_type size, const size_type startPosition = 0) const CISST_THROW(std::out_of_range) {
367 if ((startPosition + size) > this->size()) {
368 cmnThrow(std::out_of_range("vctDynamicConstVectorBase::Ref: reference is out of range"));
369 }
370 return vctDynamicConstVectorRef<_elementType>(size, Pointer(startPosition), this->stride());
371 }
372
376
379 inline value_type SumOfElements(void) const {
380 return vctDynamicVectorLoopEngines::
381 SoVi<typename vctBinaryOperations<value_type>::Addition,
383 Run(*this);
384 }
385
388 inline value_type ProductOfElements(void) const {
389 return vctDynamicVectorLoopEngines::
390 SoVi<typename vctBinaryOperations<value_type>::Multiplication,
392 Run(*this);
393 }
394
397 inline value_type NormSquare(void) const {
398 return vctDynamicVectorLoopEngines::
399 SoVi<typename vctBinaryOperations<value_type>::Addition,
401 Run(*this);
402 }
403
406 inline NormType Norm(void) const {
407 return sqrt(NormType(NormSquare()));
408 }
409
414 inline bool IsNormalized(void) const {
416 return true;
417 } else {
418 return false;
419 }
420 }
421
435 inline bool IsNormalized(_elementType tolerance) const {
436 if (vctUnaryOperations<_elementType>::AbsValue::Operate(_elementType(Norm() - 1)) < tolerance) {
437 return true;
438 } else {
439 return false;
440 }
441 }
442
447 inline value_type L1Norm(void) const {
448 return vctDynamicVectorLoopEngines::
449 SoVi<typename vctBinaryOperations<value_type>::Addition,
451 Run(*this);
452 }
453
460 inline value_type LinfNorm(void) const {
461 return this->MaxAbsElement();
462 }
463
466 inline value_type MaxElement(void) const {
467 return vctDynamicVectorLoopEngines::
468 SoVi<typename vctBinaryOperations<value_type>::Maximum,
470 Run(*this);
471 }
472
475 inline value_type MinElement(void) const {
476 return vctDynamicVectorLoopEngines::
477 SoVi<typename vctBinaryOperations<value_type>::Minimum,
479 Run(*this);
480 }
481
488 inline value_type MaxAbsElement(void) const {
489 return vctDynamicVectorLoopEngines::
490 SoVi<typename vctBinaryOperations<value_type>::Maximum,
492 Run(*this);
493 }
494
499 inline value_type MinAbsElement(void) const {
500 return vctDynamicVectorLoopEngines::
501 SoVi<typename vctBinaryOperations<value_type>::Minimum,
503 Run(*this);
504 }
505
513 inline void MinAndMaxElement(value_type & minElement, value_type & maxElement) const
514 {
515 vctDynamicVectorLoopEngines::MinAndMax::Run((*this), minElement, maxElement);
516 }
517
520 inline bool IsPositive(void) const {
521 return vctDynamicVectorLoopEngines::
522 SoVi<typename vctBinaryOperations<bool>::And,
524 Run(*this);
525 }
526
529 inline bool IsNonNegative(void) const {
530 return vctDynamicVectorLoopEngines::
531 SoVi<typename vctBinaryOperations<bool>::And,
533 Run(*this);
534 }
535
538 inline bool IsNonPositive(void) const {
539 return vctDynamicVectorLoopEngines::
540 SoVi<typename vctBinaryOperations<bool>::And,
542 Run(*this);
543 }
544
547 inline bool IsNegative (void) const {
548 return vctDynamicVectorLoopEngines::
549 SoVi< typename vctBinaryOperations<bool>::And,
551 Run(*this);
552 }
553
556 inline bool All(void) const {
557 return vctDynamicVectorLoopEngines::
558 SoVi< typename vctBinaryOperations<bool>::And,
560 Run(*this);
561 }
562
565 inline bool Any(void) const {
566 return vctDynamicVectorLoopEngines::
567 SoVi< typename vctBinaryOperations<bool>::Or,
569 Run(*this);
570 }
571
574 inline bool IsFinite(void) const {
575 return vctDynamicVectorLoopEngines::
576 SoVi< typename vctBinaryOperations<bool>::And,
578 Run(*this);
579 }
580
583 inline bool HasNaN(void) const {
584 return vctDynamicVectorLoopEngines::
585 SoVi< typename vctBinaryOperations<bool>::Or,
587 Run(*this);
588 }
589
590
591
594
598 inline bool IsCompact(void) const {
599 return (this->stride() == 1);
600 }
601
605 inline bool IsFortran(void) const {
606 return this->IsCompact();
607 }
608
611 template <class __vectorOwnerType>
613 {
614 return vctFastCopy::VectorCopyCompatible(*this, source);
615 }
616
619 template <size_type __size, stride_type __stride, class __dataPtrType>
624
625
626
632 template <class __vectorOwnerType>
634 return vctDynamicVectorLoopEngines::
635 SoViVi<typename vctBinaryOperations<value_type>::Addition,
637 Run(*this, otherVector);
638 }
639
640
644
656 template <class __vectorOwnerType>
658 return vctDynamicVectorLoopEngines::
659 SoViVi<typename vctBinaryOperations<bool>::And,
661 Run(*this, otherVector);
662 }
663
664 /* documented above */
665 template <class __vectorOwnerType>
667 return Equal(otherVector);
668 }
669
670 /* documented above */
671 template <class __vectorOwnerType>
673 value_type tolerance) const {
674 return ((*this - otherVector).LinfNorm() <= tolerance);
675 }
676
677 /* documented above */
678 template <class __vectorOwnerType>
680 return ((*this - otherVector).LinfNorm() <= TypeTraits::Tolerance());
681 }
682
683 /* documented above */
684 template <class __vectorOwnerType>
686 return vctDynamicVectorLoopEngines::
687 SoViVi<typename vctBinaryOperations<bool>::Or,
689 Run(*this, otherVector);
690 }
691
692 /* documented above */
693 template <class __vectorOwnerType>
695 return NotEqual(otherVector);
696 }
697
698 /* documented above */
699 template <class __vectorOwnerType>
701 return vctDynamicVectorLoopEngines::
702 SoViVi<typename vctBinaryOperations<bool>::And,
704 Run(*this, otherVector);
705 }
706
707 /* documented above */
708 template <class __vectorOwnerType>
710 return vctDynamicVectorLoopEngines::
711 SoViVi<typename vctBinaryOperations<bool>::And,
713 Run(*this, otherVector);
714 }
715
716 /* documented above */
717 template <class __vectorOwnerType>
719 return vctDynamicVectorLoopEngines::
720 SoViVi<typename vctBinaryOperations<bool>::And,
722 Run(*this, otherVector);
723 }
724
725 /* documented above */
726 template <class __vectorOwnerType>
728 return vctDynamicVectorLoopEngines::
729 SoViVi<typename vctBinaryOperations<bool>::And,
731 Run(*this, otherVector);
732 }
733
734
735
739
751 template <class __vectorOwnerType>
755 _vectorOwnerType, __vectorOwnerType, value_type,
757 }
758
759
760 /* documented above */
761 template <class __vectorOwnerType>
765 _vectorOwnerType, __vectorOwnerType, value_type,
767 }
768
769 /* documented above */
770 template <class __vectorOwnerType>
774 _vectorOwnerType, __vectorOwnerType, value_type,
776 }
777
778 /* documented above */
779 template <class __vectorOwnerType>
786
787 /* documented above */
788 template <class __vectorOwnerType>
792 _vectorOwnerType, __vectorOwnerType, value_type,
794 }
795
796 /* documented above */
797 template <class __vectorOwnerType>
804
805
806
810
822 inline bool Equal(const value_type & scalar) const {
823 return vctDynamicVectorLoopEngines::
824 SoViSi<typename vctBinaryOperations<bool>::And,
826 Run(*this, scalar);
827 }
828
829 /* documented above */
830 inline bool operator == (const value_type & scalar) const {
831 return Equal(scalar);
832 }
833
834 /* documented above */
835 inline bool NotEqual(const value_type & scalar) const {
836 return vctDynamicVectorLoopEngines::
837 SoViSi<typename vctBinaryOperations<bool>::Or,
839 Run(*this, scalar);
840 }
841
842 /* documented above */
843 inline bool operator != (const value_type & scalar) const {
844 return NotEqual(scalar);
845 }
846
847 /* documented above */
848 inline bool Lesser(const value_type & scalar) const {
849 return vctDynamicVectorLoopEngines::
850 SoViSi<typename vctBinaryOperations<bool>::And,
852 Run(*this, scalar);
853 }
854
855 /* documented above */
856 inline bool LesserOrEqual(const value_type & scalar) const {
857 return vctDynamicVectorLoopEngines::
858 SoViSi<typename vctBinaryOperations<bool>::And,
860 Run(*this, scalar);
861 }
862
863 /* documented above */
864 inline bool Greater(const value_type & scalar) const {
865 return vctDynamicVectorLoopEngines::
866 SoViSi<typename vctBinaryOperations<bool>::And,
868 Run(*this, scalar);
869 }
870
871 /* documented above */
872 inline bool GreaterOrEqual(const value_type & scalar) const {
873 return vctDynamicVectorLoopEngines::
874 SoViSi<typename vctBinaryOperations<bool>::And,
876 Run(*this, scalar);
877 }
878
879
883
895
896 /* documented above */
898
899 /* documented above */
901
902 /* documented above */
904
905 /* documented above */
907
908 /* documented above */
911
929#ifndef SWIG
931 {
932 public:
934 };
935#endif // SWIG
936
940
948 inline VectorReturnType Abs(void) const;
949
950 /* documented above */
951 inline VectorReturnType Negation(void) const;
952
953 /* documented above */
954 inline VectorReturnType Floor(void) const;
955
956 /* documented above */
957 inline VectorReturnType Ceil(void) const;
958
959 /* documented above */
960 inline VectorReturnType Normalized(void) const CISST_THROW(std::runtime_error);
962
963
964 std::string ToString(void) const {
965 std::stringstream outputStream;
966 ToStream(outputStream);
967 return outputStream.str();
968 }
969
970 void ToStream(std::ostream & outputStream) const
971 {
972 size_type index;
973 const size_type mySize = size();
974 // preserve the formatting flags as they were
975 const std::streamsize width = outputStream.width(12);
976 const std::streamsize precision = outputStream.precision(6);
977 bool showpoint = ((outputStream.flags() & std::ios_base::showpoint) != 0);
978 outputStream << std::setprecision(6) << std::showpoint;
979 for (index = 0; index < mySize; ++index) {
980 outputStream << std::setw(12) << (*this)[index];
981 if (index < (mySize-1)) {
982 outputStream << " ";
983 }
984 }
985 // resume the formatting flags
986 outputStream << std::setprecision(precision) << std::setw(width);
987 if (!showpoint) {
988 outputStream << std::noshowpoint;
989 }
990 }
991
992
993 void ToStreamRaw(std::ostream & outputStream, const char delimiter = ' ',
994 bool headerOnly = false, const std::string & headerPrefix = "") const
995 {
996 size_type index;
997 const size_type mySize = size();
998 if (headerOnly) {
999 for (index = 0; index < mySize; ++index) {
1000 outputStream << headerPrefix << "-v" << index;
1001 if (index < (mySize-1)) {
1002 outputStream << delimiter;
1003 }
1004 }
1005 } else {
1006 for (index = 0; index < mySize; ++index) {
1007 outputStream << (*this)[index];
1008 if (index < (mySize-1)) {
1009 outputStream << delimiter;
1010 }
1011 }
1012 }
1013 }
1014
1016 void SerializeRaw(std::ostream & outputStream) const
1017 {
1018 const size_type mySize = size();
1019 size_type index;
1020 cmnSerializeSizeRaw(outputStream, mySize);
1021 for (index = 0; index < mySize; ++index) {
1022 cmnSerializeRaw(outputStream, this->Element(index));
1023 }
1024 }
1025
1026};
1027
1028
1029
1030/* documented in class. Implementation moved here for .Net 2003 */
1031template <class _vectorOwnerType, class _elementType>
1036}
1037
1038/* documented in class. Implementation moved here for .Net 2003 */
1039template <class _vectorOwnerType, class _elementType>
1044}
1045
1046/* documented in class. Implementation moved here for .Net 2003 */
1047template <class _vectorOwnerType, class _elementType>
1052}
1053
1054/* documented in class. Implementation moved here for .Net 2003 */
1055template <class _vectorOwnerType, class _elementType>
1060}
1061
1062/* documented in class. Implementation moved here for .Net 2003 */
1063template <class _vectorOwnerType, class _elementType>
1068}
1069
1070/* documented in class. Implementation moved here for .Net 2003 */
1071template <class _vectorOwnerType, class _elementType>
1076}
1077
1078
1086template <class _vector1OwnerType, class _vector2OwnerType, class _elementType>
1089 return vector1.DotProduct(vector2);
1090}
1091
1099template <class _vector1OwnerType, class _vector2OwnerType, class _elementType>
1102 return vector1.DotProduct(vector2);
1103}
1104
1106template <class _vectorOwnerType, typename _elementType>
1108 return vector.All();
1109}
1110
1112template <class _vectorOwnerType, typename _elementType>
1114 return vector.Any();
1115}
1116
1118template <class _vectorOwnerType, typename _elementType>
1119std::ostream & operator << (std::ostream & output,
1121 vector.ToStream(output);
1122 return output;
1123}
1124
1125#ifndef DOXYGEN
1126template <vct::size_type __size, class _vectorOwnerType, class __elementType>
1127std::ostream & operator << (std::ostream & output,
1128 const vctDynamicConstVectorBase< _vectorOwnerType, vctFixedSizeVector<__elementType, __size> > & vector)
1129{
1130 vct::size_type numElements = vector.size();
1131 vct::size_type counter;
1132 for (counter = 0; counter < numElements; ++counter) {
1133 output << "[ ";
1134 vector[counter].ToStream(output);
1135 output << "]\n";
1136 }
1137 return output;
1138}
1139#endif // DOXYGEN
1140
1141
1142// helper function declared and used in vctFixedSizeVectorBase.h
1143template <vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType, class _vectorOwnerType>
1151
1152
1153
1154#endif // _vctDynamicConstVectorBase_h
Definition vctDynamicConstVectorBase.h:931
vctDynamicConstVectorRef< value_type > Type
Definition vctDynamicConstVectorBase.h:933
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
Returns the product of the two InputType object.
Definition vctBinaryOperations.h:116
Test for non equality between input1 and input2.
Definition vctBinaryOperations.h:302
Definition vctForwardDeclarations.h:119
Dynamic vector referencing existing memory (const).
Definition vctDynamicConstVectorRef.h:79
vctDynamicConstVectorRef()
Definition vctDynamicConstVectorRef.h:92
ThisType & Assign(const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &other)
Definition vctDynamicVectorBase.h:242
Definition vctForwardDeclarations.h:131
static void Run(const _inputVectorType &inputVector, typename _inputVectorType::value_type &minValue, typename _inputVectorType::value_type &maxValue)
Definition vctDynamicVectorLoopEngines.h:1043
Dynamic vector referencing existing memory.
Definition vctDynamicVectorRef.h:78
static bool VectorCopyCompatible(const _vector1Type &vector1, const _vector2Type &vector2)
Definition vctFastCopy.h:125
A template for a fixed length vector with fixed spacing in memory.
Definition vctFixedSizeConstVectorBase.h:108
A template for a fixed length vector with fixed spacing in memory.
Definition vctFixedSizeVectorBase.h:77
Implementation of a fixed-size vector using template metaprogramming.
Definition vctFixedSizeVector.h:54
Definition vctDynamicVector.h:395
Returns the absolute value of the input as an OutputType object.
Definition vctUnaryOperations.h:80
static OutputElementType Operate(const InputElementType &input)
Definition vctUnaryOperations.h:86
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.
#define CMN_ASSERT(expr)
Definition cmnAssert.h:97
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
Declaration of vctBinaryOperations.
Basic traits for the cisstVector containers.
#define VCT_CONTAINER_TRAITS_TYPEDEFS(type)
Definition vctContainerTraits.h:50
value_type MaxElement(void) const
Definition vctDynamicConstMatrixBase.h:494
const_iterator end(void) const
Definition vctDynamicConstMatrixBase.h:209
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
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
cmnTypeTraits< value_type > TypeTraits
Definition vctDynamicConstMatrixBase.h:147
bool IsNonPositive(void) const
Definition vctDynamicConstMatrixBase.h:566
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
value_type MinElement(void) const
Definition vctDynamicConstMatrixBase.h:503
OwnerType::iterator iterator
Definition vctDynamicConstMatrixBase.h:92
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
size_type size(void) const
Definition vctDynamicConstMatrixBase.h:228
bool IsCompact(void) const
Definition vctDynamicConstMatrixBase.h:641
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
MatrixReturnType Floor(void) const
std::string ToString(void)
Definition vctDynamicConstMatrixBase.h:1007
void SerializeRaw(std::ostream &outputStream) const
Definition vctDynamicConstMatrixBase.h:1107
TypeTraits::BoolType BoolType
Definition vctDynamicConstMatrixBase.h:152
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
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
bool LesserOrEqual(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:758
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
value_type LinfNorm(void) const
Definition vctDynamicConstMatrixBase.h:488
BoolMatrixReturnType ElementwiseLesser(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:817
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
const_iterator begin(void) const
Definition vctDynamicConstMatrixBase.h:203
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
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
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
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
difference_type stride(dimension_type dimension) const
Definition vctDynamicConstNArrayBase.h:325
void vctFixedSizeVectorBaseAssignDynamicConstVectorBase(vctFixedSizeVectorBase< _size, _stride, _elementType, _dataPtrType > &fixedSizeVector, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &dynamicVector)
Definition vctDynamicConstVectorBase.h:1144
const_iterator cend(void) const
Definition vctDynamicConstVectorBase.h:154
OwnerType Vector
Definition vctDynamicConstVectorBase.h:126
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareScalar(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector, const _elementType &scalar)
Definition vctDynamicVector.h:699
vctDynamicVector< _elementType > VectorValueType
Definition vctDynamicConstVectorBase.h:106
const value_type & Y(void) const
Definition vctDynamicConstVectorBase.h:271
vctDynamicConstVectorRef< _elementType > XW(void) const
Definition vctDynamicConstVectorBase.h:309
const value_type & Z(void) const
Definition vctDynamicConstVectorBase.h:279
const_reverse_iterator crend(void) const
Definition vctDynamicConstVectorBase.h:176
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareVector(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector2)
Definition vctDynamicVector.h:688
vctDynamicConstVectorRef< _elementType > XYZW(void) const
Definition vctDynamicConstVectorBase.h:357
const value_type & W(void) const
Definition vctDynamicConstVectorBase.h:286
vctDynamicConstVectorRef< _elementType > XY(void) const
Definition vctDynamicConstVectorBase.h:295
vctDynamicVector< _elementType > CopyType
Definition vctDynamicConstVectorBase.h:102
const value_type & X(void) const
Definition vctDynamicConstVectorBase.h:263
vctDynamicConstVectorRef< _elementType > YZ(void) const
Definition vctDynamicConstVectorBase.h:316
value_type DotProduct(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition vctDynamicConstVectorBase.h:633
vctDynamicConstVectorRef< _elementType > XYZ(void) const
Definition vctDynamicConstVectorBase.h:340
_elementType vctDotProduct(const vctDynamicConstVectorBase< _vector1OwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vector2OwnerType, _elementType > &vector2)
Definition vctDynamicConstVectorBase.h:1087
const_iterator cbegin(void) const
Definition vctDynamicConstVectorBase.h:143
vctDynamicVector< _elementType > VectorReturnType
Definition vctDynamicConstVectorBase.h:110
const_reverse_iterator crbegin(void) const
Definition vctDynamicConstVectorBase.h:165
vctDynamicConstVectorRef< _elementType > YW(void) const
Definition vctDynamicConstVectorBase.h:323
vctDynamicConstVectorRef< _elementType > XZ(void) const
Definition vctDynamicConstVectorBase.h:302
vctReturnDynamicVector< BoolType > BoolVectorReturnType
Definition vctDynamicConstVectorBase.h:121
vctDynamicConstVectorRef< _elementType > ZW(void) const
Definition vctDynamicConstVectorBase.h:330
vctDynamicConstVectorRef< _elementType > YZW(void) const
Definition vctDynamicConstVectorBase.h:347
bool IsNormalized(void) const
Definition vctDynamicConstVectorBase.h:414
std::ostream & operator<<(std::ostream &output, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector)
Definition vctDynamicConstVectorBase.h:1119
_elementType operator*(const vctDynamicConstVectorBase< _vector1OwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vector2OwnerType, _elementType > &vector2)
Definition vctDynamicConstVectorBase.h:1100
Declaration of vctDynamicVectorLoopEngines.
Forward declarations and #define for cisstVector.
Declaration of vctUnaryOperations.