cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vctDynamicVectorBase.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 _vctDynamicVectorBase_h
21 #define _vctDynamicVectorBase_h
22 
28 #include <cstdarg>
29 
34 
35 
36 #ifndef DOXYGEN
37 // forward declaration of auxiliary function to multiply matrix * vector
38 template <class _resultVectorOwnerType, class _matrixOwnerType, class _vectorOwnerType, class _elementType>
39 inline
43 
44 // forward declaration of auxiliary function to multiply matrix * vector
45 template <class _resultVectorOwnerType, class _vectorOwnerType, class _matrixOwnerType, class _elementType>
46 inline
50 #endif // DOXYGEN
51 
60 template <class _vectorOwnerType, typename _elementType>
61 class vctDynamicVectorBase : public vctDynamicConstVectorBase<_vectorOwnerType, _elementType>
62 {
63 public:
65 
66  VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType);
67 
71 
72  typedef _vectorOwnerType VectorOwnerType;
73 
74  typedef typename BaseType::iterator iterator;
78 
79  typedef typename BaseType::CopyType CopyType;
81 
82 
84  typedef class cmnTypeTraits<value_type> TypeTraits;
86 
87 
88 public:
91  iterator begin(void) {
92  return this->Vector.begin();
93  }
94 
97  iterator end(void) {
98  return this->Vector.end();
99  }
100 
104  return this->Vector.rbegin();
105  }
106 
110  return this->Vector.rend();
111  }
112 
113  /* documented in base class */
114  const_iterator begin(void) const {
115  return BaseType::begin();
116  }
117 
118  /* documented in base class */
119  const_iterator end(void) const {
120  return BaseType::end();
121  }
122 
123  /* documented in base class */
125  return BaseType::rbegin();
126  }
127 
128  /* documented in base class */
130  return BaseType::rend();
131  }
132 
135  reference operator[](index_type index) {
136  return *Pointer(index);
137  }
138 
139  /* documented in base class */
140  const_reference operator[](index_type index) const {
141  return BaseType::operator[](index);
142  }
143 
144  /* documented in base class */
145  const VectorOwnerType & Owner(void) const {
146  return BaseType::Owner();
147  }
149  return this->Vector;
150  }
151 
155  pointer Pointer(index_type index = 0) {
156  return this->Vector.Pointer(index);
157  }
158 
159  /* documented in base class */
160  const_pointer Pointer(index_type index = 0) const {
161  return BaseType::Pointer(index);
162  }
163 
170  reference at(index_type index) throw(std::out_of_range) {
171  this->ThrowUnlessValidIndex(index);
172  return *(Pointer(index));
173  }
174 
175  /* documented in base class */
176  const_reference at(index_type index) const throw(std::out_of_range) {
177  return BaseType::at(index);
178  }
179 
181  inline reference operator() (index_type index) throw(std::out_of_range) {
182  return this->at(index);
183  }
184 
185  /* documented in base class */
186  inline const_reference operator() (index_type index) const throw(std::out_of_range) {
187  return BaseType::operator()(index);
188  }
189 
190 
195  reference Element(index_type index) {
196  return *(Pointer(index));
197  }
198 
199  /* documented in base class */
200  const_reference Element(index_type index) const {
201  return BaseType::Element(index);
202  }
203 
204 
209  inline value_type SetAll(const value_type value) {
212  Run(*this, value);
213  return value;
214  }
215 
216 
225  inline bool Zeros(void) {
226  if (this->IsCompact()) {
227  memset(this->Pointer(), 0, this->size() * sizeof(value_type));
228  return true;
229  } else {
230  this->SetAll(static_cast<value_type>(0));
231  return false;
232  }
233  }
234 
235 
241  template <class __vectorOwnerType>
243  if (this->FastCopyCompatible(other)) {
244  this->FastCopyOf(other, false);
245  } else {
247  VoVi<typename vctUnaryOperations<value_type,
248  typename __vectorOwnerType::value_type>::Identity>::
249  Run(*this, other);
250  }
251  return *this;
252  }
254 
262  template <class __vectorOwnerType>
264  size_type length, size_type startPositionThis = 0, size_type startPositionOther = 0) {
265  vctDynamicVectorRef<value_type> thisRef(*this, startPositionThis, length);
266  vctDynamicConstVectorRef<value_type> otherRef(other, startPositionOther, length);
267  thisRef.Assign(otherRef);
268  return *this;
269  }
271 
278  template <class __vectorOwnerType, typename __elementType>
281  VoVi<typename vctUnaryOperations<value_type,
282  typename __vectorOwnerType::value_type>::Identity>::
283  Run(*this, other);
284  return *this;
285  }
286 
287  template <class __vectorOwnerType, typename __elementType>
289  return this->Assign(other);
290  }
291 
292  template <size_type __size, stride_type __stride, class __elementType, class __dataPtrType>
294  & other) {
297  Run(*this, vctDynamicConstVectorRef<__elementType>(other));
298  return *this;
299  }
301 
302 
326  template <class __vectorOwnerType, typename __elementType>
328  return this->Assign(other);
329  }
330 
331  template <size_type __size, stride_type __stride, class __elementType, class __dataPtrType>
333  & other) {
334  return this->Assign(other);
335  }
337 
338 
398  template <class __vectorOwnerType>
400  bool performSafetyChecks = true)
401  throw(std::runtime_error)
402  {
403  return vctFastCopy::VectorCopy(*this, source, performSafetyChecks);
404  }
405 
406  template <size_type __size, stride_type __stride, class __dataPtrType>
408  bool performSafetyChecks = true)
409  throw(std::runtime_error)
410  {
411  return vctFastCopy::VectorCopy(*this, source, performSafetyChecks);
412  }
414 
415 
416 
429  inline ThisType & Assign(const value_type * elements)
430  {
433  Run(*this, vctDynamicConstVectorRef<value_type>(this->size(), elements));
434  return *this;
435  }
436 
450  inline ThisType & Assign(value_type element0, value_type element1, ...) throw(std::runtime_error) {
451  const size_type size = this->size();
452  if (size < 2) {
453  cmnThrow(std::runtime_error("vctDynamicVector: Assign from va_list requires size >= 2"));
454  }
455  this->at(0) = element0;
456  this->at(1) = element1;
457  va_list nextArg;
458  va_start(nextArg, element1);
459  for (index_type i = 2; i < size; ++i) {
460  this->at(i) = value_type( va_arg(nextArg, ElementVaArgPromotion) );
461  }
462  va_end(nextArg);
463  return *this;
464  }
465 
466 
473  template <class __vectorOwnerType, class __elementType>
475  __elementType lastElement) {
476  vctDynamicVectorRef<value_type> firstElements(*this, 0, otherVector.size() - 1);
479  Run(firstElements, otherVector);
480  (*this)[otherVector.size()] = value_type(lastElement);
481  return *this;
482  }
483 
484 
494 
497  value_type & X(void) {
498  CMN_ASSERT(this->size() > 0);
499  return *(Pointer(0));
500  }
501 
502  // we have to redeclare it here, shadowed
503  const value_type & X(void) const {
504  return BaseType::X();
505  }
506 
507 
510  value_type & Y(void) {
511  CMN_ASSERT(this->size() > 1);
512  return *(Pointer(1));
513  }
514 
515  // we have to redeclare it here, shadowed
516  const value_type & Y(void) const {
517  return BaseType::Y();
518  }
519 
520 
523  value_type & Z(void) {
524  CMN_ASSERT(this->size() > 2);
525  return *(Pointer(2));
526  }
527 
528  // we have to redeclare it here, shadowed
529  const value_type & Z(void) const {
530  return BaseType::Z();
531  }
532 
535  value_type & W(void) {
536  CMN_ASSERT(this->size() > 3);
537  return *(Pointer(3));
538  }
539 
540  // we have to redeclare it here, shadowed
541  const value_type & W(void) const {
542  return BaseType::W();
543  }
544 
550  CMN_ASSERT(this->size() > 1);
551  return vctDynamicVectorRef<_elementType>(2, Pointer(0), this->stride());
552  }
553 
557  CMN_ASSERT(this->size() > 2);
558  return vctDynamicVectorRef<_elementType>(2, Pointer(0), 2 * this->stride());
559  }
560 
564  CMN_ASSERT(this->size() > 3);
565  return vctDynamicVectorRef<_elementType>(2, Pointer(0), 3 * this->stride());
566  }
567 
571  CMN_ASSERT(this->size() > 2);
572  return vctDynamicVectorRef<_elementType>(2, Pointer(1), this->stride());
573  }
574 
578  CMN_ASSERT(this->size() > 3);
579  return vctDynamicVectorRef<_elementType>(2, Pointer(1), 2 * this->stride());
580  }
581 
585  CMN_ASSERT(this->size() > 3);
586  return vctDynamicVectorRef<_elementType>(2, Pointer(2), this->stride());
587  }
588 
589  /* documented in base class */
591  return BaseType::XY();
592  }
593 
594  /* documented in base class */
596  return BaseType::XZ();
597  }
598 
599  /* documented in base class */
601  return BaseType::XW();
602  }
603 
604  /* documented in base class */
606  return BaseType::YZ();
607  }
608 
609  /* documented in base class */
611  return BaseType::YW();
612  }
613 
614  /* documented in base class */
616  return BaseType::ZW();
617  }
618 
625  CMN_ASSERT(this->size() > 2);
626  return vctDynamicVectorRef<_elementType>(3, Pointer(0), this->stride());
627  }
628 
632  CMN_ASSERT(this->size() > 3);
633  return vctDynamicVectorRef<_elementType>(3, Pointer(1), this->stride());
634  }
635 
636  /* documented in base class */
638  return BaseType::XYZ();
639  }
640 
641  /* documented in base class */
643  return BaseType::YZW();
644  }
645 
652  CMN_ASSERT(this->size() > 3);
653  return vctDynamicVectorRef<_elementType>(4, Pointer(0), this->stride());
654  }
655 
656  /* documented in base class */
658  return BaseType::XYZW();
659  }
660 
664  Ref(const size_type size, const size_type startPosition = 0) throw (std::out_of_range) {
665  if ((startPosition + size) > this->size()) {
666  cmnThrow(std::out_of_range("vctDynamicConstVectorBase::Ref: reference is out of range"));
667  }
668  return vctDynamicVectorRef<_elementType>(size, Pointer(startPosition), this->stride());
669  }
670 
672  Ref(const size_type size, const size_type startPosition = 0) const throw (std::out_of_range) {
673  return BaseType::Ref(size, startPosition);
674  }
676 
682  template <class __inputVectorOwner, class __indexVectorOwner>
683  inline void SelectFrom(
686  {
688  }
689 
694  template <class __vectorOwnerType1, class __vectorOwnerType2>
695  inline void CrossProductOf(
698  {
699  CMN_ASSERT(this->size() == 3);
700  CMN_ASSERT(inputVector1.size() == 3);
701  CMN_ASSERT(inputVector2.size() == 3);
702  (*this)[0] = inputVector1[1] * inputVector2[2] - inputVector1[2] * inputVector2[1];
703  (*this)[1] = inputVector1[2] * inputVector2[0] - inputVector1[0] * inputVector2[2];
704  (*this)[2] = inputVector1[0] * inputVector2[1] - inputVector1[1] * inputVector2[0];
705  }
706 
708 
709 
710 
727  template <class __vectorOwnerType1, class __vectorOwnerType2>
732  ::Run(*this, vector1, vector2);
733  return *this;
734  }
735 
736  /* documented above */
737  template <class __vectorOwnerType1, class __vectorOwnerType2>
742  ::Run(*this, vector1, vector2);
743  return *this;
744  }
745 
746  /* documented above */
747  template <class __vectorOwnerType1, class __vectorOwnerType2>
752  ::Run(*this, vector1, vector2);
753  return *this;
754  }
755 
756  /* documented above */
757  template <class __vectorOwnerType1, class __vectorOwnerType2>
762  ::Run(*this, vector1, vector2);
763  return *this;
764  }
765 
766  /* documented above */
767  template <class __vectorOwnerType1, class __vectorOwnerType2>
772  ::Run(*this, vector1, vector2);
773  return *this;
774  }
775 
776  /* documented above */
777  template <class __vectorOwnerType1, class __vectorOwnerType2>
782  ::Run(*this, vector1, vector2);
783  return *this;
784  }
785 
786  /* documented above */
787  template <class __vectorOwnerType1, class __vectorOwnerType2>
792  ::Run(*this, boundVector, vector);
793  return *this;
794  }
796 
797 
798 
815  template <class __vectorOwnerType>
819  Run(*this, otherVector);
820  return *this;
821  }
822 
823  /* documented above */
824  template <class __vectorOwnerType>
828  Run(*this, otherVector);
829  return *this;
830  }
831 
832  /* documented above */
833  template <class __vectorOwnerType>
837  Run(*this, otherVector);
838  return *this;
839  }
840 
841  /* documented above */
842  template <class __vectorOwnerType>
846  Run(*this, otherVector);
847  return *this;
848  }
849 
850  /* documented above */
851  template <class __vectorOwnerType>
855  Run(*this, otherVector);
856  return *this;
857  }
858 
859  /* documented above */
860  template <class __vectorOwnerType>
864  Run(*this, otherVector);
865  return *this;
866  }
867 
868  /* documented above */
869  template <class __vectorOwnerType>
873  Run(*this, boundVector);
874  return *this;
875  }
876 
877  /* documented above */
878  template <class __vectorOwnerType>
880  return this->Add(otherVector);
881  }
882 
883  /* documented above */
884  template <class __vectorOwnerType>
886  return this->Subtract(otherVector);
887  }
889 
890 
896  template <class __vectorOwnerType>
900  Run(*this, otherVector);
901  return *this;
902  }
904 
920  template <class __vectorOwnerType>
922  const value_type scalar) {
925  Run(*this, vector, scalar);
926  return *this;
927  }
928 
929  /* documented above */
930  template <class __vectorOwnerType>
932  const value_type scalar) {
935  Run(*this, vector, scalar);
936  return *this;
937  }
938 
939  /* documented above */
940  template <class __vectorOwnerType>
942  const value_type scalar) {
945  Run(*this, vector, scalar);
946  return *this;
947  }
948 
949  /* documented above */
950  template <class __vectorOwnerType>
952  const value_type scalar) {
955  Run(*this, vector, scalar);
956  return *this;
957  }
958 
959  /* documented above */
960  template <class __vectorOwnerType>
962  const value_type upperBound) {
965  Run(*this, vector, upperBound);
966  return *this;
967  }
968 
969  /* documented above */
970  template <class __vectorOwnerType>
972  const value_type lowerBound) {
975  Run(*this, vector, lowerBound);
976  return *this;
977  }
978 
979  /* documented above */
980  template <class __vectorOwnerType>
982  const value_type bound) {
985  Run(*this, vector, bound);
986  return *this;
987  }
989 
990 
991 
1007  template <class __vectorOwnerType>
1008  inline ThisType & SumOf(const value_type scalar,
1012  Run(*this, scalar, vector);
1013  return *this;
1014  }
1015 
1016  /* documented above */
1017  template <class __vectorOwnerType>
1018  inline ThisType & DifferenceOf(const value_type scalar,
1022  Run(*this, scalar, vector);
1023  return *this;
1024  }
1025 
1026  /* documented above */
1027  template <class __vectorOwnerType>
1028  inline ThisType & ProductOf(const value_type scalar,
1032  Run(*this, scalar, vector);
1033  return *this;
1034  }
1035 
1036  /* documented above */
1037  template <class __vectorOwnerType>
1038  inline ThisType & RatioOf(const value_type scalar,
1042  Run(*this, scalar, vector);
1043  return *this;
1044  }
1045 
1046  /* documented above */
1047  template <class __vectorOwnerType>
1048  inline ThisType & ClippedAboveOf(const value_type upperBound,
1052  Run(*this, upperBound, vector);
1053  return *this;
1054  }
1055 
1056  /* documented above */
1057  template <class __vectorOwnerType>
1058  inline ThisType & ClippedBelowOf(const value_type lowerBound,
1062  Run(*this, lowerBound, vector);
1063  return *this;
1064  }
1065 
1066  /* documented above */
1067  template <class __vectorOwnerType>
1068  inline ThisType & ClippedInOf(const value_type bound,
1072  Run(*this, bound, vector);
1073  return *this;
1074  }
1076 
1077 
1078 
1094  inline ThisType & Add(const value_type scalar) {
1097  Run(*this, scalar);
1098  return *this;
1099  }
1100 
1101  /* documented above */
1102  inline ThisType & Subtract(const value_type scalar) {
1105  Run(*this, scalar);
1106  return *this;
1107  }
1108 
1109  /* documented above */
1110  inline ThisType & Multiply(const value_type scalar) {
1113  Run(*this, scalar);
1114  return *this;
1115  }
1116 
1117  /* documented above */
1118  inline ThisType & Divide(const value_type scalar) {
1121  Run(*this, scalar);
1122  return *this;
1123  }
1124 
1125  /* documented above */
1126  inline ThisType & ClipAbove(const value_type upperBound) {
1129  Run(*this, upperBound);
1130  return *this;
1131  }
1132 
1133  /* documented above */
1134  inline ThisType & ClipBelow(const value_type lowerBound) {
1137  Run(*this, lowerBound);
1138  return *this;
1139  }
1140 
1141  /* documented above */
1142  inline ThisType & ClipIn(const value_type bound) {
1145  Run(*this, bound);
1146  return *this;
1147  }
1148 
1149  /* documented above */
1150  inline ThisType & operator += (const value_type scalar) {
1151  return this->Add(scalar);
1152  }
1153 
1154  /* documented above */
1155  inline ThisType & operator -= (const value_type scalar) {
1156  return this->Subtract(scalar);
1157  }
1158 
1159  /* documented above */
1160  inline ThisType & operator *= (const value_type scalar) {
1161  return this->Multiply(scalar);
1162  }
1163 
1164  /* documented above */
1165  inline ThisType & operator /= (const value_type scalar) {
1166  return this->Divide(scalar);
1167  }
1169 
1170  template <class __vectorOwnerType>
1171  inline ThisType & AddProductOf(const value_type scalar,
1173  {
1175  VioSiVi<
1178  Run(*this, scalar, otherVector);
1179  return *this;
1180  }
1181 
1182  template <class __vectorOwnerType1, class __vectorOwnerType2>
1185  {
1187  VioViVi<
1190  Run(*this, vector1, vector2);
1191  return *this;
1192  }
1193 
1194 
1195 
1200 
1210  template <class __matrixOwnerType, class __vectorOwnerType>
1213  vctMultiplyMatrixVector(*this, inputMatrix, inputVector);
1214  return *this;
1215  }
1216 
1217 
1227  template <class __vectorOwnerType, class __matrixOwnerType>
1230  vctMultiplyVectorMatrix(*this, inputVector, inputMatrix);
1231  return *this;
1232  }
1233 
1235 
1236 
1254 #ifndef SWIG
1256  {
1257  public:
1259  };
1260 #endif
1261 
1275  template <class __vectorOwnerType>
1279  Run(*this, otherVector);
1280  return *this;
1281  }
1282 
1283  /* documented above */
1284  template <class __vectorOwnerType>
1288  Run(*this, otherVector);
1289  return *this;
1290  }
1291 
1292  /* documented above */
1293  template <class __vectorOwnerType>
1297  Run(*this, otherVector);
1298  return *this;
1299  }
1300 
1301  /* documented above */
1302  template <class __vectorOwnerType>
1306  Run(*this, otherVector);
1307  return *this;
1308  }
1309 
1310  /* documented above */
1311  template <class __vectorOwnerType>
1312  inline ThisType & NormalizedOf(const vctDynamicConstVectorBase<__vectorOwnerType, _elementType> & otherVector) throw(std::runtime_error) {
1313  *this = otherVector;
1314  this->NormalizedSelf();
1315  return *this;
1316  }
1318 
1330  inline ThisType & AbsSelf(void) {
1333  Run(*this);
1334  return *this;
1335  }
1336 
1337  /* documented above */
1338  inline ThisType & NegationSelf(void) {
1341  Run(*this);
1342  return *this;
1343  }
1344 
1345  /* documented above */
1346  inline ThisType & FloorSelf(void) {
1349  Run(*this);
1350  return *this;
1351  }
1352 
1353  /* documented above */
1354  inline ThisType & CeilSelf(void) {
1357  Run(*this);
1358  return *this;
1359  }
1360 
1361  inline ThisType & NormalizedSelf(void) throw(std::runtime_error) {
1362  value_type norm = value_type(this->Norm());
1363  if (norm >= TypeTraits::Tolerance()) {
1364  this->Divide(norm);
1365  } else {
1366  cmnThrow(std::runtime_error("Division by quasi zero detected in vctDynamicVector NormalizedSelf()"));
1367  }
1368  return *this;
1369  }
1371 
1372 
1373 };
1374 
1375 
1376 #endif // _vctDynamicVectorBase_h
size_t index_type
Definition: vctContainerTraits.h:36
vctDynamicVectorRef< _elementType > XZ(void)
Definition: vctDynamicVectorBase.h:556
OwnerType Vector
Definition: vctDynamicConstVectorBase.h:126
value_type & Y(void)
Definition: vctDynamicVectorBase.h:510
const value_type & Y(void) const
Definition: vctDynamicConstVectorBase.h:251
ThisType & ClipBelow(const value_type lowerBound)
Definition: vctDynamicVectorBase.h:1134
ThisType & ElementwiseDivide(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:843
vctDynamicConstVectorRef< _elementType > YZW(void) const
Definition: vctDynamicConstVectorBase.h:327
A vector object of dynamic size.
Definition: vctDynamicVector.h:127
const_iterator end(void) const
Definition: vctDynamicConstVectorBase.h:145
BaseType::const_iterator const_iterator
Definition: vctDynamicVectorBase.h:76
ThisType & DifferenceOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
Definition: vctDynamicVectorBase.h:931
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:328
#define CMN_ASSERT(expr)
Definition: cmnAssert.h:90
vctDynamicConstVectorRef< _elementType > YZ(void) const
Definition: vctDynamicConstVectorBase.h:296
ThisType & AbsSelf(void)
Definition: vctDynamicVectorBase.h:1330
const_pointer Pointer(index_type index=0) const
Definition: vctDynamicVectorBase.h:160
vctDynamicVectorRef< _elementType > XY(void)
Definition: vctDynamicVectorBase.h:549
vctDynamicVectorRef< _elementType > YZ(void)
Definition: vctDynamicVectorBase.h:570
ThisType & SumOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
Definition: vctDynamicVectorBase.h:921
vctDynamicVectorRef< _elementType > Ref(const size_type size, const size_type startPosition=0)
Definition: vctDynamicVectorBase.h:664
const_reverse_iterator rbegin(void) const
Definition: vctDynamicConstVectorBase.h:151
const value_type & W(void) const
Definition: vctDynamicVectorBase.h:541
Dynamic vector referencing existing memory (const)
Definition: vctDynamicConstVectorRef.h:79
ThisType & Subtract(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:825
const_reference at(size_type index) const
Definition: vctDynamicConstVectorBase.h:190
ThisType & FloorSelf(void)
Definition: vctDynamicVectorBase.h:1346
const_reference Element(index_type index) const
Definition: vctDynamicVectorBase.h:200
ThisType & ElementwiseMax(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:861
void vctMultiplyVectorMatrix(vctDynamicVectorBase< _resultVectorOwnerType, _elementType > &result, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix)
Definition: vctDynamicMatrixRef.h:409
const_reference operator()(size_type index) const
Definition: vctDynamicConstVectorBase.h:196
bool FastCopyOf(const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &source, bool performSafetyChecks=true)
Definition: vctDynamicVectorBase.h:399
const_iterator begin(void) const
Definition: vctDynamicVectorBase.h:114
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:479
vctDynamicVectorRef< _elementType > XYZ(void)
Definition: vctDynamicVectorBase.h:624
vctDynamicConstVectorRef< _elementType > YZ(void) const
Definition: vctDynamicVectorBase.h:605
value_type & W(void)
Definition: vctDynamicVectorBase.h:535
vctDynamicConstVectorRef< _elementType > XZ(void) const
Definition: vctDynamicVectorBase.h:595
vctDynamicConstVectorRef< _elementType > XY(void) const
Definition: vctDynamicVectorBase.h:590
const value_type & Z(void) const
Definition: vctDynamicVectorBase.h:529
ThisType & SumOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
Definition: vctDynamicVectorBase.h:728
ThisType & ProductOf(const value_type scalar, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
Definition: vctDynamicVectorBase.h:1028
ThisType & Assign(const value_type *elements)
Definition: vctDynamicVectorBase.h:429
const_reference at(index_type index) const
Definition: vctDynamicVectorBase.h:176
ThisType & Assign(const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &other)
Definition: vctDynamicVectorBase.h:242
BaseType::iterator iterator
Definition: vctDynamicVectorBase.h:74
static bool VectorCopy(_destinationVectorType &destination, const _sourceVectorType &source, bool performSafetyChecks)
Definition: vctFastCopy.h:165
const value_type & X(void) const
Definition: vctDynamicConstVectorBase.h:243
ThisType & operator+=(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:879
Dynamic vector referencing existing memory.
Definition: vctDynamicVectorRef.h:77
ThisType & ElementwiseClipIn(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &boundVector)
Definition: vctDynamicVectorBase.h:870
vctDynamicConstVectorRef< _elementType > Ref(const size_type size, const size_type startPosition=0) const
Definition: vctDynamicConstVectorBase.h:346
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:609
VectorOwnerType & Owner(void)
Definition: vctDynamicVectorBase.h:148
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:535
cmnVaArgPromotion< _elementType >::Type VaArgPromotion
Definition: cmnTypeTraits.h:167
ThisType & CeilOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:1303
vctDynamicVectorRef< _elementType > YW(void)
Definition: vctDynamicVectorBase.h:577
ThisType & Subtract(const value_type scalar)
Definition: vctDynamicVectorBase.h:1102
size_t size_type
Definition: vctContainerTraits.h:35
_vectorOwnerType VectorOwnerType
Definition: vctDynamicVectorBase.h:72
ThisType & NormalizedOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:1312
ThisType & ElementwiseClippedInOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &boundVector, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector)
Definition: vctDynamicVectorBase.h:788
reference operator()(index_type index)
Definition: vctDynamicVectorBase.h:181
ThisType & Assign(const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &other)
Definition: vctDynamicVectorBase.h:279
TypeTraits::VaArgPromotion ElementVaArgPromotion
Definition: vctDynamicVectorBase.h:85
void ThrowUnlessValidIndex(size_type index) const
Definition: vctDynamicConstVectorBase.h:130
iterator begin(void)
Definition: vctDynamicVectorBase.h:91
const_iterator begin(void) const
Definition: vctDynamicConstVectorBase.h:139
ThisType & Assign(const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &other, size_type length, size_type startPositionThis=0, size_type startPositionOther=0)
Definition: vctDynamicVectorBase.h:263
ThisType & Add(const value_type scalar)
Definition: vctDynamicVectorBase.h:1094
ThisType & operator-=(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:885
ThisType & FloorOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:1294
ThisType & DifferenceOf(const value_type scalar, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
Definition: vctDynamicVectorBase.h:1018
vctDynamicConstVectorRef< _elementType > YZW(void) const
Definition: vctDynamicVectorBase.h:642
Declaration of vctDynamicConstVectorRef.
vctDynamicConstVectorRef< _elementType > XYZW(void) const
Definition: vctDynamicVectorBase.h:657
const_reverse_iterator rend(void) const
Definition: vctDynamicConstVectorBase.h:157
Returns the sum of the two InputType object.
Definition: vctStoreBackBinaryOperations.h:76
ThisType & ElementwiseProductOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
Definition: vctDynamicVectorBase.h:748
Declaration of vctStoreBackBinaryOperations.
const value_type & Z(void) const
Definition: vctDynamicConstVectorBase.h:259
ThisType & SumOf(const value_type scalar, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
Definition: vctDynamicVectorBase.h:1008
Definition: vctDynamicConstMatrixBase.h:77
BaseType::CopyType CopyType
Definition: vctDynamicVectorBase.h:79
vctDynamicVectorRef< _elementType > XYZW(void)
Definition: vctDynamicVectorBase.h:651
ThisType & AddElementwiseProductOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
Definition: vctDynamicVectorBase.h:1183
const value_type & X(void) const
Definition: vctDynamicVectorBase.h:503
const value_type & Y(void) const
Definition: vctDynamicVectorBase.h:516
ThisType & Divide(const value_type scalar)
Definition: vctDynamicVectorBase.h:1118
ThisType & Assign(value_type element0, value_type element1,...)
Definition: vctDynamicVectorBase.h:450
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:895
Define unary operations on an object as classes.
Definition: vctUnaryOperations.h:55
size_type size(void) const
Definition: vctDynamicConstVectorBase.h:164
bool FastCopyOf(const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &source, bool performSafetyChecks=true)
Definition: vctDynamicVectorBase.h:407
ThisType & RatioOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
Definition: vctDynamicVectorBase.h:951
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:820
ThisType & ClipIn(const value_type bound)
Definition: vctDynamicVectorBase.h:1142
ThisType & ElementwiseMaxOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
Definition: vctDynamicVectorBase.h:778
vctDynamicConstVectorRef< _elementType > YW(void) const
Definition: vctDynamicConstVectorBase.h:303
const_iterator end(void) const
Definition: vctDynamicVectorBase.h:119
reference at(index_type index)
Definition: vctDynamicVectorBase.h:170
Definition: vctDynamicVectorBase.h:1255
vctDynamicConstVectorRef< _elementType > XW(void) const
Definition: vctDynamicConstVectorBase.h:289
vctDynamicVectorRef< _elementType > YZW(void)
Definition: vctDynamicVectorBase.h:631
vctDynamicConstVectorBase< _vectorOwnerType, _elementType > BaseType
Definition: vctDynamicVectorBase.h:70
ThisType & ConcatenationOf(const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &otherVector, __elementType lastElement)
Definition: vctDynamicVectorBase.h:474
const VectorOwnerType & Owner(void) const
Definition: vctDynamicVectorBase.h:145
vctDynamicVectorBase ThisType
Definition: vctDynamicVectorBase.h:68
reference Element(index_type index)
Definition: vctDynamicVectorBase.h:195
ThisType & NegationSelf(void)
Definition: vctDynamicVectorBase.h:1338
vctDynamicConstVectorRef< _elementType > XZ(void) const
Definition: vctDynamicConstVectorBase.h:282
vctDynamicConstVectorRef< _elementType > XW(void) const
Definition: vctDynamicVectorBase.h:600
vctDynamicConstVectorRef< _elementType > XY(void) const
Definition: vctDynamicConstVectorBase.h:275
ThisType & ElementwiseMultiply(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:834
ThisType & Assign(const vctFixedSizeConstVectorBase< __size, __stride, __elementType, __dataPtrType > &other)
Definition: vctDynamicVectorBase.h:293
BaseType::VectorValueType VectorValueType
Definition: vctDynamicVectorBase.h:80
vctDynamicConstVectorRef< _elementType > ZW(void) const
Definition: vctDynamicConstVectorBase.h:310
value_type & X(void)
Definition: vctDynamicVectorBase.h:497
bool Zeros(void)
Definition: vctDynamicVectorBase.h:225
ThisType & operator*=(const value_type scalar)
Definition: vctDynamicVectorBase.h:1160
ThisType & ForceAssign(const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &other)
Definition: vctDynamicVectorBase.h:327
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:255
ThisType & NormalizedSelf(void)
Definition: vctDynamicVectorBase.h:1361
difference_type stride() const
Definition: vctDynamicConstVectorBase.h:169
const_reference operator[](index_type index) const
Definition: vctDynamicVectorBase.h:140
ThisType & Add(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:816
ThisType & ProductOf(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &inputMatrix, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &inputVector)
Definition: vctDynamicVectorBase.h:1211
ThisType & SwapElementsWith(vctDynamicVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:897
ThisType & RatioOf(const value_type scalar, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
Definition: vctDynamicVectorBase.h:1038
ThisType & AddProductOf(const value_type scalar, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:1171
vctDynamicConstVectorRef< _elementType > XYZ(void) const
Definition: vctDynamicVectorBase.h:637
const value_type & W(void) const
Definition: vctDynamicConstVectorBase.h:266
bool FastCopyCompatible(const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &source) const
Definition: vctDynamicConstVectorBase.h:592
#define cmnThrow(a)
Definition: MinimalCmn.h:4
const_reference operator[](index_type index) const
Definition: vctDynamicConstVectorBase.h:181
ThisType & ElementwiseMin(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:852
ThisType & ClippedAboveOf(const value_type upperBound, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
Definition: vctDynamicVectorBase.h:1048
const_pointer Pointer(index_type index=0) const
Definition: vctDynamicConstVectorBase.h:221
static void Run(_outputVectorType &output, const _inputVectorType &input, const _indexVectorType &index)
Definition: vctDynamicVectorLoopEngines.h:1086
Declaration of vctStoreBackUnaryOperations.
pointer Pointer(index_type index=0)
Definition: vctDynamicVectorBase.h:155
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:97
void vctMultiplyMatrixVector(vctDynamicVectorBase< _resultVectorOwnerType, _elementType > &result, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector)
Definition: vctDynamicMatrixRef.h:394
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
vctDynamicConstVectorRef< _elementType > YW(void) const
Definition: vctDynamicVectorBase.h:610
vctDynamicVectorRef< value_type > Type
Definition: vctDynamicVectorBase.h:1258
Definition: vctDynamicVectorRefOwner.h:39
value_type SetAll(const value_type value)
Definition: vctDynamicVectorBase.h:209
ThisType & ElementwiseRatioOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
Definition: vctDynamicVectorBase.h:758
reverse_iterator rend(void)
Definition: vctDynamicVectorBase.h:109
Declaration of vctDynamicConstVectorBase.
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:403
ThisType & ClippedAboveOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type upperBound)
Definition: vctDynamicVectorBase.h:961
vctDynamicConstVectorRef< _elementType > XYZW(void) const
Definition: vctDynamicConstVectorBase.h:337
ThisType & DifferenceOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
Definition: vctDynamicVectorBase.h:738
ThisType & CeilSelf(void)
Definition: vctDynamicVectorBase.h:1354
const_reverse_iterator rend(void) const
Definition: vctDynamicVectorBase.h:129
vctDynamicConstVectorRef< _elementType > XYZ(void) const
Definition: vctDynamicConstVectorBase.h:320
ThisType & Multiply(const value_type scalar)
Definition: vctDynamicVectorBase.h:1110
vctDynamicVectorRef< _elementType > XW(void)
Definition: vctDynamicVectorBase.h:563
Definition: vctVarStrideVectorIterator.h:222
Definition: vctDynamicConstVectorBase.h:77
BaseType::reverse_iterator reverse_iterator
Definition: vctDynamicVectorBase.h:75
ThisType & ClippedBelowOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type lowerBound)
Definition: vctDynamicVectorBase.h:971
reverse_iterator rbegin(void)
Definition: vctDynamicVectorBase.h:103
A template for a fixed length vector with fixed spacing in memory.
Definition: vctFixedSizeConstVectorBase.h:107
ThisType & ClipAbove(const value_type upperBound)
Definition: vctDynamicVectorBase.h:1126
ThisType & ElementwiseMinOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
Definition: vctDynamicVectorBase.h:768
void SelectFrom(const vctDynamicConstVectorBase< __inputVectorOwner, _elementType > &input, const vctDynamicConstVectorBase< __indexVectorOwner, index_type > &index)
Definition: vctDynamicVectorBase.h:683
vctDynamicVectorRef< _elementType > ZW(void)
Definition: vctDynamicVectorBase.h:584
NormType Norm(void) const
Definition: vctDynamicConstVectorBase.h:386
vctDynamicConstVectorRef< _elementType > Ref(const size_type size, const size_type startPosition=0) const
Definition: vctDynamicVectorBase.h:672
iterator end(void)
Definition: vctDynamicVectorBase.h:97
const_reference Element(size_type index) const
Definition: vctDynamicConstVectorBase.h:205
vctDynamicConstVectorRef< _elementType > ZW(void) const
Definition: vctDynamicVectorBase.h:615
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition: cmnTypeTraits.h:155
ThisType & ClippedInOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type bound)
Definition: vctDynamicVectorBase.h:981
Returns the product of the two InputType object.
Definition: vctBinaryOperations.h:116
ThisType & AbsOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:1276
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:181
bool IsCompact(void) const
Definition: vctDynamicConstVectorBase.h:578
ThisType & operator=(const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &other)
Definition: vctDynamicVectorBase.h:288
ThisType & NegationOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:1285
ThisType & ProductOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &inputVector, const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &inputMatrix)
Definition: vctDynamicVectorBase.h:1228
BaseType::const_reverse_iterator const_reverse_iterator
Definition: vctDynamicVectorBase.h:77
Definition: vctVarStrideVectorIterator.h:56
const OwnerType & Owner(void) const
Definition: vctDynamicConstVectorBase.h:213
void CrossProductOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &inputVector2)
Definition: vctDynamicVectorBase.h:695
Container class for the vector loop based engines.
Definition: vctDynamicVectorLoopEngines.h:66
ThisType & ProductOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
Definition: vctDynamicVectorBase.h:941
reference operator[](index_type index)
Definition: vctDynamicVectorBase.h:135
const_reverse_iterator rbegin(void) const
Definition: vctDynamicVectorBase.h:124
ThisType & ClippedBelowOf(const value_type lowerBound, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
Definition: vctDynamicVectorBase.h:1058
ThisType & ForceAssign(const vctFixedSizeConstVectorBase< __size, __stride, __elementType, __dataPtrType > &other)
Definition: vctDynamicVectorBase.h:332
value_type & Z(void)
Definition: vctDynamicVectorBase.h:523
ThisType & ClippedInOf(const value_type bound, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
Definition: vctDynamicVectorBase.h:1068
ThisType & operator/=(const value_type scalar)
Definition: vctDynamicVectorBase.h:1165
Definition: vctDynamicVectorBase.h:61