cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-2015 Johns Hopkins University (JHU), All Rights Reserved.
9 
10 --- begin cisst license - do not edit ---
11 
12 This software is provided "as is" under an open source license, with
13 no warranty. The complete license can be found in license.txt and
14 http://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 
30 #include <cisstCommon/cmnThrow.h>
31 #include <cisstCommon/cmnAssert.h>
33 
40 
41 #include <iostream>
42 #include <iomanip>
43 #include <sstream>
44 
45 /* Forward declarations */
46 #ifndef DOXYGEN
47 template <class _vectorOwnerType, class __vectorOwnerType, class _elementType,
48  class _elementOperationType>
52 
53 template <class _vectorOwnerType, class _elementType,
54  class _elementOperationType>
57  const _elementType & scalar);
58 #endif // DOXYGEN
59 
60 
76 template <class _vectorOwnerType, typename _elementType>
78 {
79 public:
80  /* define most types from vctContainerTraits */
81  VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType);
82 
85 
87  typedef _vectorOwnerType OwnerType;
88 
90  typedef typename OwnerType::iterator iterator;
91 
94 
97 
100 
103 
107 
111 
113 
117  typedef typename TypeTraits::BoolType BoolType;
118 
122 
123 
124 protected:
127 
128 
130  inline void ThrowUnlessValidIndex(size_type index) const throw(std::out_of_range) {
131  if (! ValidIndex(index)) {
132  cmnThrow(std::out_of_range("vctDynamicVector: Invalid index"));
133  }
134  }
135 
136 public:
139  const_iterator begin(void) const {
140  return Vector.begin();
141  }
142 
145  const_iterator end(void) const {
146  return Vector.end();
147  }
148 
152  return Vector.rbegin();
153  }
154 
158  return Vector.rend();
159  }
160 
164  size_type size(void) const {
165  return Vector.size();
166  }
167 
170  return Vector.stride();
171  }
172 
175  bool empty() const {
176  return (size() == 0);
177  }
178 
181  const_reference operator[](index_type index) const {
182  return *Pointer(index);
183  }
184 
190  const_reference at(size_type index) const throw(std::out_of_range) {
191  ThrowUnlessValidIndex(index);
192  return *(Pointer(index));
193  }
194 
196  inline const_reference operator() (size_type index) const throw(std::out_of_range) {
197  return this->at(index);
198  }
199 
200 
205  const_reference Element(size_type index) const {
206  return *(Pointer(index));
207  }
208 
209 
213  const OwnerType & Owner(void) const {
214  return this->Vector;
215  }
216 
217 
221  const_pointer Pointer(index_type index = 0) const {
222  return Vector.Pointer(index);
223  }
224 
225 
227  inline bool ValidIndex(size_type index) const {
228  return (index < size());
229  }
230 
231 
240 
243  const value_type & X(void) const {
244  CMN_ASSERT(this->size() > 0);
245  return *(Pointer(0));
246  }
247 
248 
251  const value_type & Y(void) const {
252  CMN_ASSERT(this->size() > 1);
253  return *(Pointer(1));
254  }
255 
256 
259  const value_type & Z(void) const {
260  CMN_ASSERT(this->size() > 2);
261  return *(Pointer(2));
262  }
263 
266  const value_type & W(void) const {
267  CMN_ASSERT(this->size() > 3);
268  return *(Pointer(3));
269  }
270 
276  CMN_ASSERT(this->size() > 1);
278  }
279 
283  CMN_ASSERT(this->size() > 2);
284  return vctDynamicConstVectorRef<_elementType>(2, Pointer(0), 2 * this->stride());
285  }
286 
290  CMN_ASSERT(this->size() > 3);
291  return vctDynamicConstVectorRef<_elementType>(2, Pointer(0), 3 * this->stride());
292  }
293 
297  CMN_ASSERT(this->size() > 2);
299  }
300 
304  CMN_ASSERT(this->size() > 3);
305  return vctDynamicConstVectorRef<_elementType>(2, Pointer(1), 2 * this->stride());
306  }
307 
311  CMN_ASSERT(this->size() > 3);
313  }
314 
321  CMN_ASSERT(this->size() > 2);
323  }
324 
328  CMN_ASSERT(this->size() > 3);
330  }
331 
338  CMN_ASSERT(this->size() > 3);
340  }
341 
343 
346  Ref(const size_type size, const size_type startPosition = 0) const throw (std::out_of_range) {
347  if ((startPosition + size) > this->size()) {
348  cmnThrow(std::out_of_range("vctDynamicConstVectorBase::Ref: reference is out of range"));
349  }
350  return vctDynamicConstVectorRef<_elementType>(size, Pointer(startPosition), this->stride());
351  }
352 
356 
359  inline value_type SumOfElements(void) const {
363  Run(*this);
364  }
365 
368  inline value_type ProductOfElements(void) const {
372  Run(*this);
373  }
374 
377  inline value_type NormSquare(void) const {
381  Run(*this);
382  }
383 
386  inline NormType Norm(void) const {
387  return sqrt(NormType(NormSquare()));
388  }
389 
394  inline bool IsNormalized(void) const {
396  return true;
397  } else {
398  return false;
399  }
400  }
401 
415  inline bool IsNormalized(_elementType tolerance) const {
416  if (vctUnaryOperations<_elementType>::AbsValue::Operate(_elementType(Norm() - 1)) < tolerance) {
417  return true;
418  } else {
419  return false;
420  }
421  }
422 
427  inline value_type L1Norm(void) const {
431  Run(*this);
432  }
433 
440  inline value_type LinfNorm(void) const {
441  return this->MaxAbsElement();
442  }
443 
446  inline value_type MaxElement(void) const {
450  Run(*this);
451  }
452 
455  inline value_type MinElement(void) const {
459  Run(*this);
460  }
461 
468  inline value_type MaxAbsElement(void) const {
472  Run(*this);
473  }
474 
479  inline value_type MinAbsElement(void) const {
483  Run(*this);
484  }
485 
493  inline void MinAndMaxElement(value_type & minElement, value_type & maxElement) const
494  {
495  vctDynamicVectorLoopEngines::MinAndMax::Run((*this), minElement, maxElement);
496  }
497 
500  inline bool IsPositive(void) const {
504  Run(*this);
505  }
506 
509  inline bool IsNonNegative(void) const {
513  Run(*this);
514  }
515 
518  inline bool IsNonPositive(void) const {
522  Run(*this);
523  }
524 
527  inline bool IsNegative (void) const {
531  Run(*this);
532  }
533 
536  inline bool All(void) const {
540  Run(*this);
541  }
542 
545  inline bool Any(void) const {
549  Run(*this);
550  }
551 
554  inline bool IsFinite(void) const {
558  Run(*this);
559  }
560 
563  inline bool HasNaN(void) const {
567  Run(*this);
568  }
570 
571 
574 
578  inline bool IsCompact(void) const {
579  return (this->stride() == 1);
580  }
581 
585  inline bool IsFortran(void) const {
586  return this->IsCompact();
587  }
588 
591  template <class __vectorOwnerType>
593  {
594  return vctFastCopy::VectorCopyCompatible(*this, source);
595  }
596 
599  template <size_type __size, stride_type __stride, class __dataPtrType>
601  {
602  return vctFastCopy::VectorCopyCompatible(*this, source);
603  }
605 
606 
612  template <class __vectorOwnerType>
613  inline value_type DotProduct(const vctDynamicConstVectorBase<__vectorOwnerType, _elementType> & otherVector) const {
617  Run(*this, otherVector);
618  }
619 
620 
636  template <class __vectorOwnerType>
637  inline bool Equal(const vctDynamicConstVectorBase<__vectorOwnerType, _elementType> & otherVector) const {
641  Run(*this, otherVector);
642  }
643 
644  /* documented above */
645  template <class __vectorOwnerType>
647  return Equal(otherVector);
648  }
649 
650  /* documented above */
651  template <class __vectorOwnerType>
653  value_type tolerance) const {
654  return ((*this - otherVector).LinfNorm() <= tolerance);
655  }
656 
657  /* documented above */
658  template <class __vectorOwnerType>
660  return ((*this - otherVector).LinfNorm() <= TypeTraits::Tolerance());
661  }
662 
663  /* documented above */
664  template <class __vectorOwnerType>
669  Run(*this, otherVector);
670  }
671 
672  /* documented above */
673  template <class __vectorOwnerType>
675  return NotEqual(otherVector);
676  }
677 
678  /* documented above */
679  template <class __vectorOwnerType>
684  Run(*this, otherVector);
685  }
686 
687  /* documented above */
688  template <class __vectorOwnerType>
693  Run(*this, otherVector);
694  }
695 
696  /* documented above */
697  template <class __vectorOwnerType>
702  Run(*this, otherVector);
703  }
704 
705  /* documented above */
706  template <class __vectorOwnerType>
711  Run(*this, otherVector);
712  }
714 
715 
731  template <class __vectorOwnerType>
735  _vectorOwnerType, __vectorOwnerType, value_type,
736  typename vctBinaryOperations<bool, value_type, value_type>::Equal>(*this, otherVector);
737  }
738 
739 
740  /* documented above */
741  template <class __vectorOwnerType>
745  _vectorOwnerType, __vectorOwnerType, value_type,
747  }
748 
749  /* documented above */
750  template <class __vectorOwnerType>
754  _vectorOwnerType, __vectorOwnerType, value_type,
755  typename vctBinaryOperations<bool, value_type, value_type>::Lesser>(*this, otherVector);
756  }
757 
758  /* documented above */
759  template <class __vectorOwnerType>
763  _vectorOwnerType, __vectorOwnerType, value_type,
765  }
766 
767  /* documented above */
768  template <class __vectorOwnerType>
772  _vectorOwnerType, __vectorOwnerType, value_type,
774  }
775 
776  /* documented above */
777  template <class __vectorOwnerType>
781  _vectorOwnerType, __vectorOwnerType, value_type,
783  }
785 
786 
802  inline bool Equal(const value_type & scalar) const {
806  Run(*this, scalar);
807  }
808 
809  /* documented above */
810  inline bool operator == (const value_type & scalar) const {
811  return Equal(scalar);
812  }
813 
814  /* documented above */
815  inline bool NotEqual(const value_type & scalar) const {
819  Run(*this, scalar);
820  }
821 
822  /* documented above */
823  inline bool operator != (const value_type & scalar) const {
824  return NotEqual(scalar);
825  }
826 
827  /* documented above */
828  inline bool Lesser(const value_type & scalar) const {
832  Run(*this, scalar);
833  }
834 
835  /* documented above */
836  inline bool LesserOrEqual(const value_type & scalar) const {
840  Run(*this, scalar);
841  }
842 
843  /* documented above */
844  inline bool Greater(const value_type & scalar) const {
848  Run(*this, scalar);
849  }
850 
851  /* documented above */
852  inline bool GreaterOrEqual(const value_type & scalar) const {
856  Run(*this, scalar);
857  }
859 
874  BoolVectorReturnType ElementwiseEqual(const value_type & scalar) const;
875 
876  /* documented above */
877  BoolVectorReturnType ElementwiseNotEqual(const value_type & scalar) const;
878 
879  /* documented above */
880  BoolVectorReturnType ElementwiseLesser(const value_type & scalar) const;
881 
882  /* documented above */
883  BoolVectorReturnType ElementwiseLesserOrEqual(const value_type & scalar) const;
884 
885  /* documented above */
886  BoolVectorReturnType ElementwiseGreater(const value_type & scalar) const;
887 
888  /* documented above */
889  BoolVectorReturnType ElementwiseGreaterOrEqual(const value_type & scalar) const;
891 
909 #ifndef SWIG
911  {
912  public:
914  };
915 #endif // SWIG
916 
928  inline VectorReturnType Abs(void) const;
929 
930  /* documented above */
931  inline VectorReturnType Negation(void) const;
932 
933  /* documented above */
934  inline VectorReturnType Floor(void) const;
935 
936  /* documented above */
937  inline VectorReturnType Ceil(void) const;
938 
939  /* documented above */
940  inline VectorReturnType Normalized(void) const throw(std::runtime_error);
942 
943 
944  std::string ToString(void) const {
945  std::stringstream outputStream;
946  ToStream(outputStream);
947  return outputStream.str();
948  }
949 
950  void ToStream(std::ostream & outputStream) const
951  {
952  size_type index;
953  const size_type mySize = size();
954  // preserve the formatting flags as they were
955  const std::streamsize width = outputStream.width(12);
956  const std::streamsize precision = outputStream.precision(6);
957  bool showpoint = ((outputStream.flags() & std::ios_base::showpoint) != 0);
958  outputStream << std::setprecision(6) << std::showpoint;
959  for (index = 0; index < mySize; ++index) {
960  outputStream << std::setw(12) << (*this)[index];
961  if (index < (mySize-1)) {
962  outputStream << " ";
963  }
964  }
965  // resume the formatting flags
966  outputStream << std::setprecision(precision) << std::setw(width);
967  if (!showpoint) {
968  outputStream << std::noshowpoint;
969  }
970  }
971 
972 
973  void ToStreamRaw(std::ostream & outputStream, const char delimiter = ' ',
974  bool headerOnly = false, const std::string & headerPrefix = "") const
975  {
976  size_type index;
977  const size_type mySize = size();
978  if (headerOnly) {
979  for (index = 0; index < mySize; ++index) {
980  outputStream << headerPrefix << "-v" << index;
981  if (index < (mySize-1)) {
982  outputStream << delimiter;
983  }
984  }
985  } else {
986  for (index = 0; index < mySize; ++index) {
987  outputStream << (*this)[index];
988  if (index < (mySize-1)) {
989  outputStream << delimiter;
990  }
991  }
992  }
993  }
994 
996  void SerializeRaw(std::ostream & outputStream) const
997  {
998  const size_type mySize = size();
999  size_type index;
1000  cmnSerializeSizeRaw(outputStream, mySize);
1001  for (index = 0; index < mySize; ++index) {
1002  cmnSerializeRaw(outputStream, this->Element(index));
1003  }
1004  }
1005 
1006 };
1007 
1008 
1009 
1010 /* documented in class. Implementation moved here for .Net 2003 */
1011 template <class _vectorOwnerType, class _elementType>
1014  return vctDynamicVectorElementwiseCompareScalar<_vectorOwnerType, value_type,
1016 }
1017 
1018 /* documented in class. Implementation moved here for .Net 2003 */
1019 template <class _vectorOwnerType, class _elementType>
1022  return vctDynamicVectorElementwiseCompareScalar<_vectorOwnerType, value_type,
1024 }
1025 
1026 /* documented in class. Implementation moved here for .Net 2003 */
1027 template <class _vectorOwnerType, class _elementType>
1030  return vctDynamicVectorElementwiseCompareScalar<_vectorOwnerType, value_type,
1032 }
1033 
1034 /* documented in class. Implementation moved here for .Net 2003 */
1035 template <class _vectorOwnerType, class _elementType>
1038  return vctDynamicVectorElementwiseCompareScalar<_vectorOwnerType, value_type,
1040 }
1041 
1042 /* documented in class. Implementation moved here for .Net 2003 */
1043 template <class _vectorOwnerType, class _elementType>
1046  return vctDynamicVectorElementwiseCompareScalar<_vectorOwnerType, value_type,
1048 }
1049 
1050 /* documented in class. Implementation moved here for .Net 2003 */
1051 template <class _vectorOwnerType, class _elementType>
1054  return vctDynamicVectorElementwiseCompareScalar<_vectorOwnerType, value_type,
1056 }
1057 
1058 
1066 template <class _vector1OwnerType, class _vector2OwnerType, class _elementType>
1069  return vector1.DotProduct(vector2);
1070 }
1071 
1079 template <class _vector1OwnerType, class _vector2OwnerType, class _elementType>
1082  return vector1.DotProduct(vector2);
1083 }
1084 
1086 template <class _vectorOwnerType, typename _elementType>
1088  return vector.All();
1089 }
1090 
1092 template <class _vectorOwnerType, typename _elementType>
1094  return vector.Any();
1095 }
1096 
1098 template <class _vectorOwnerType, typename _elementType>
1099 std::ostream & operator << (std::ostream & output,
1101  vector.ToStream(output);
1102  return output;
1103 }
1104 
1105 #ifndef DOXYGEN
1106 template <vct::size_type __size, class _vectorOwnerType, class __elementType>
1107 std::ostream & operator << (std::ostream & output,
1108  const vctDynamicConstVectorBase< _vectorOwnerType, vctFixedSizeVector<__elementType, __size> > & vector)
1109 {
1110  vct::size_type numElements = vector.size();
1111  vct::size_type counter;
1112  for (counter = 0; counter < numElements; ++counter) {
1113  output << "[ ";
1114  vector[counter].ToStream(output);
1115  output << "]\n";
1116  }
1117  return output;
1118 }
1119 #endif // DOXYGEN
1120 
1121 
1122 // helper function declared and used in vctFixedSizeVectorBase.h
1123 template <vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType, class _vectorOwnerType>
1127 {
1128  vctDynamicVectorRef<_elementType> tempRef(fixedSizeVector);
1129  tempRef.Assign(dynamicVector);
1130 }
1131 
1132 
1133 
1134 #endif // _vctDynamicConstVectorBase_h
size_t index_type
Definition: vctContainerTraits.h:36
bool IsPositive(void) const
Definition: vctDynamicConstVectorBase.h:500
OwnerType Vector
Definition: vctDynamicConstVectorBase.h:126
const value_type & Y(void) const
Definition: vctDynamicConstVectorBase.h:251
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:667
bool ValidIndex(size_type index) const
Definition: vctDynamicConstVectorBase.h:227
vctDynamicVector< _elementType > CopyType
Definition: vctDynamicConstVectorBase.h:102
vctReturnDynamicVector< BoolType > BoolVectorReturnType
Definition: vctDynamicConstVectorBase.h:121
vctDynamicConstVectorRef< _elementType > YZW(void) const
Definition: vctDynamicConstVectorBase.h:327
bool AlmostEqual(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector, value_type tolerance) const
Definition: vctDynamicConstVectorBase.h:652
A vector object of dynamic size.
Definition: vctDynamicVector.h:127
const_iterator end(void) const
Definition: vctDynamicConstVectorBase.h:145
cmnTypeTraits< value_type > TypeTraits
Definition: vctDynamicConstVectorBase.h:112
Assert macros definitions.
_vectorOwnerType OwnerType
Definition: vctDynamicConstVectorBase.h:87
#define CMN_ASSERT(expr)
Definition: cmnAssert.h:90
vctDynamicConstVectorRef< _elementType > YZ(void) const
Definition: vctDynamicConstVectorBase.h:296
bool IsFinite(void) const
Definition: vctDynamicConstVectorBase.h:554
VectorReturnType Ceil(void) const
Definition: vctDynamicVector.h:663
const_reverse_iterator rbegin(void) const
Definition: vctDynamicConstVectorBase.h:151
Returns the absolute value of the input as an OutputType object.
Definition: vctUnaryOperations.h:80
bool Greater(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:698
Dynamic vector referencing existing memory (const)
Definition: vctDynamicConstVectorRef.h:79
bool Equal(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:637
const_reference at(size_type index) const
Definition: vctDynamicConstVectorBase.h:190
const_reference operator()(size_type index) const
Definition: vctDynamicConstVectorBase.h:196
Portability across compilers and operating systems tools.
Test if input1 is lesser than input2.
Definition: vctBinaryOperations.h:322
OwnerType::iterator iterator
Definition: vctDynamicConstVectorBase.h:90
Declaration of cmnSerializer and functions cmnSerializeRaw.
vctDynamicConstVectorBase< _vectorOwnerType, _elementType > ThisType
Definition: vctDynamicConstVectorBase.h:84
static Type Tolerance(void)
Definition: cmnTypeTraits.h:170
BoolVectorReturnType ElementwiseGreater(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:770
bool GreaterOrEqual(const value_type &scalar) const
Definition: vctDynamicConstVectorBase.h:852
Forward declarations and #define for cisstVector.
ThisType & Assign(const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &other)
Definition: vctDynamicVectorBase.h:242
Test for non equality between input1 and input2.
Definition: vctBinaryOperations.h:302
value_type MinAbsElement(void) const
Definition: vctDynamicConstVectorBase.h:479
const value_type & X(void) const
Definition: vctDynamicConstVectorBase.h:243
Dynamic vector referencing existing memory.
Definition: vctDynamicVectorRef.h:77
std::ostream & operator<<(std::ostream &output, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector)
Definition: vctDynamicConstVectorBase.h:1099
vctDynamicConstVectorRef< _elementType > Ref(const size_type size, const size_type startPosition=0) const
Definition: vctDynamicConstVectorBase.h:346
void cmnSerializeSizeRaw(std::ostream &outputStream, const size_t &data)
Definition: cmnSerializer.h:93
bool GreaterOrEqual(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:707
size_t size_type
Definition: vctContainerTraits.h:35
BoolVectorReturnType ElementwiseNotEqual(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:743
void ThrowUnlessValidIndex(size_type index) const
Definition: vctDynamicConstVectorBase.h:130
value_type ProductOfElements(void) const
Definition: vctDynamicConstVectorBase.h:368
const_iterator begin(void) const
Definition: vctDynamicConstVectorBase.h:139
Definition: vctUnaryOperations.h:178
Test for equality between input1 and input2.
Definition: vctBinaryOperations.h:282
bool operator==(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:646
bool FastCopyCompatible(const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &source) const
Definition: vctDynamicConstVectorBase.h:600
bool HasNaN(void) const
Definition: vctDynamicConstVectorBase.h:563
Returns the square of the input as an OutputType object.
Definition: vctUnaryOperations.h:119
BoolVectorReturnType ElementwiseGreaterOrEqual(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:779
BoolVectorReturnType ElementwiseLesser(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:752
_elementType operator*(const vctDynamicConstVectorBase< _vector1OwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vector2OwnerType, _elementType > &vector2)
Definition: vctDynamicConstVectorBase.h:1080
vctDynamicVector< _elementType > VectorValueType
Definition: vctDynamicConstVectorBase.h:106
const_reverse_iterator rend(void) const
Definition: vctDynamicConstVectorBase.h:157
const value_type & Z(void) const
Definition: vctDynamicConstVectorBase.h:259
Returns the input as an OutputType object.
Definition: vctUnaryOperations.h:65
Implementation of a fixed-size vector using template metaprogramming.
Definition: vctFixedSizeVector.h:52
value_type DotProduct(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:613
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareScalar(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector, const _elementType &scalar)
Definition: vctDynamicVector.h:696
bool IsNonPositive(void) const
Definition: vctDynamicConstVectorBase.h:518
OwnerType::const_reverse_iterator const_reverse_iterator
Definition: vctDynamicConstVectorBase.h:99
Test if input1 is greater than input2.
Definition: vctBinaryOperations.h:363
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
bool LesserOrEqual(const value_type &scalar) const
Definition: vctDynamicConstVectorBase.h:836
Define unary operations on an object as classes.
Definition: vctUnaryOperations.h:55
size_type size(void) const
Definition: vctDynamicConstVectorBase.h:164
Definition: vctUnaryOperations.h:186
bool Lesser(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:680
ptrdiff_t difference_type
Definition: vctContainerTraits.h:38
void ToStreamRaw(std::ostream &outputStream, const char delimiter= ' ', bool headerOnly=false, const std::string &headerPrefix="") const
Definition: vctDynamicConstVectorBase.h:973
Declaration of vctDynamicVectorLoopEngines.
vctDynamicConstVectorRef< _elementType > YW(void) const
Definition: vctDynamicConstVectorBase.h:303
void SerializeRaw(std::ostream &outputStream) const
Definition: vctDynamicConstVectorBase.h:996
Test if input1 is greater than or equal to input2.
Definition: vctBinaryOperations.h:384
vctDynamicConstVectorRef< _elementType > XW(void) const
Definition: vctDynamicConstVectorBase.h:289
bool LesserOrEqual(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:689
bool AlmostEqual(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:659
bool Greater(const value_type &scalar) const
Definition: vctDynamicConstVectorBase.h:844
Definition: vctDynamicVector.h:392
std::string ToString(void) const
Definition: vctDynamicConstVectorBase.h:944
value_type LinfNorm(void) const
Definition: vctDynamicConstVectorBase.h:440
Declaration of the class cmnTypeTraits.
vctDynamicConstVectorRef< _elementType > XZ(void) const
Definition: vctDynamicConstVectorBase.h:282
value_type NormSquare(void) const
Definition: vctDynamicConstVectorBase.h:377
vctDynamicConstVectorRef< value_type > Type
Definition: vctDynamicConstVectorBase.h:913
vctDynamicConstVectorRef< _elementType > XY(void) const
Definition: vctDynamicConstVectorBase.h:275
Basic traits for the cisstVector containers.
Definition: vctUnaryOperations.h:154
bool Lesser(const value_type &scalar) const
Definition: vctDynamicConstVectorBase.h:828
VectorReturnType Negation(void) const
Definition: vctDynamicVector.h:639
_elementType vctDotProduct(const vctDynamicConstVectorBase< _vector1OwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vector2OwnerType, _elementType > &vector2)
Definition: vctDynamicConstVectorBase.h:1067
void cmnSerializeRaw(std::ostream &outputStream, const _elementType &data)
Definition: cmnSerializer.h:78
vctDynamicConstVectorRef< _elementType > ZW(void) const
Definition: vctDynamicConstVectorBase.h:310
bool IsNegative(void) const
Definition: vctDynamicConstVectorBase.h:527
Definition: vctDynamicConstVectorBase.h:910
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:981
difference_type stride() const
Definition: vctDynamicConstVectorBase.h:169
bool Any(void) const
Definition: vctDynamicConstVectorBase.h:545
bool IsNormalized(void) const
Definition: vctDynamicConstVectorBase.h:394
VectorReturnType Floor(void) const
Definition: vctDynamicVector.h:651
Definition: vctUnaryOperations.h:170
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareVector(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector2)
Definition: vctDynamicVector.h:685
const value_type & W(void) const
Definition: vctDynamicConstVectorBase.h:266
Declaration of vctBinaryOperations.
vctDynamicVector< _elementType > VectorReturnType
Definition: vctDynamicConstVectorBase.h:110
bool FastCopyCompatible(const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &source) const
Definition: vctDynamicConstVectorBase.h:592
#define cmnThrow(a)
Definition: MinimalCmn.h:4
value_type MaxElement(void) const
Definition: vctDynamicConstVectorBase.h:446
void vctFixedSizeVectorBaseAssignDynamicConstVectorBase(vctFixedSizeVectorBase< _size, _stride, _elementType, _dataPtrType > &fixedSizeVector, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &dynamicVector)
Definition: vctDynamicConstVectorBase.h:1124
const_reference operator[](index_type index) const
Definition: vctDynamicConstVectorBase.h:181
BoolVectorReturnType ElementwiseLesserOrEqual(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:761
const_pointer Pointer(index_type index=0) const
Definition: vctDynamicConstVectorBase.h:221
Definition: vctUnaryOperations.h:146
A template for a fixed length vector with fixed spacing in memory.
Definition: vctFixedSizeVectorBase.h:76
Definition: vctDynamicVectorRefOwner.h:39
VectorReturnType Normalized(void) const
Definition: vctDynamicVector.h:675
bool vctAny(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector)
Definition: vctDynamicConstVectorBase.h:1093
Test if input1 is lesser than or equal to input2.
Definition: vctBinaryOperations.h:343
bool IsNormalized(_elementType tolerance) const
Definition: vctDynamicConstVectorBase.h:415
bool IsFortran(void) const
Definition: vctDynamicConstVectorBase.h:585
bool empty() const
Definition: vctDynamicConstVectorBase.h:175
value_type SumOfElements(void) const
Definition: vctDynamicConstVectorBase.h:359
vctDynamicConstVectorRef< _elementType > XYZW(void) const
Definition: vctDynamicConstVectorBase.h:337
void ToStream(std::ostream &outputStream) const
Definition: vctDynamicConstVectorBase.h:950
vctDynamicConstVectorRef< _elementType > XYZ(void) const
Definition: vctDynamicConstVectorBase.h:320
OwnerType::reverse_iterator reverse_iterator
Definition: vctDynamicConstVectorBase.h:96
Definition: vctVarStrideVectorIterator.h:222
Definition: vctDynamicConstVectorBase.h:77
A template for a fixed length vector with fixed spacing in memory.
Definition: vctFixedSizeConstVectorBase.h:107
bool IsNonNegative(void) const
Definition: vctDynamicConstVectorBase.h:509
static bool VectorCopyCompatible(const _vector1Type &vector1, const _vector2Type &vector2)
Definition: vctFastCopy.h:129
bool All(void) const
Definition: vctDynamicConstVectorBase.h:536
NormType Norm(void) const
Definition: vctDynamicConstVectorBase.h:386
Declaration of vctUnaryOperations.
const_reference Element(size_type index) const
Definition: vctDynamicConstVectorBase.h:205
bool Equal(const value_type &scalar) const
Definition: vctDynamicConstVectorBase.h:802
Declaration of the template function cmnThrow.
VectorReturnType Abs(void) const
Definition: vctDynamicVector.h:627
bool NotEqual(const value_type &scalar) const
Definition: vctDynamicConstVectorBase.h:815
bool vctAll(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector)
Definition: vctDynamicConstVectorBase.h:1087
value_type L1Norm(void) const
Definition: vctDynamicConstVectorBase.h:427
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition: cmnTypeTraits.h:155
bool operator!=(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:674
bool NotEqual(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:665
Definition: vctUnaryOperations.h:194
Returns the product of the two InputType object.
Definition: vctBinaryOperations.h:116
bool IsCompact(void) const
Definition: vctDynamicConstVectorBase.h:578
value_type MaxAbsElement(void) const
Definition: vctDynamicConstVectorBase.h:468
OwnerType::const_iterator const_iterator
Definition: vctDynamicConstVectorBase.h:93
value_type MinElement(void) const
Definition: vctDynamicConstVectorBase.h:455
void MinAndMaxElement(value_type &minElement, value_type &maxElement) const
Definition: vctDynamicConstVectorBase.h:493
Definition: vctVarStrideVectorIterator.h:56
const OwnerType & Owner(void) const
Definition: vctDynamicConstVectorBase.h:213
BoolVectorReturnType ElementwiseEqual(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Definition: vctDynamicConstVectorBase.h:733
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:732
static void Run(const _inputVectorType &inputVector, typename _inputVectorType::value_type &minValue, typename _inputVectorType::value_type &maxValue)
Definition: vctDynamicVectorLoopEngines.h:1037
bool BoolType
Definition: cmnTypeTraits.h:164
TypeTraits::BoolType BoolType
Definition: vctDynamicConstVectorBase.h:117
Definition: vctUnaryOperations.h:162