cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vctDynamicNArrayBase.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 
6  Author(s): Daniel Li, Ofri Sadowsky, Anton Deguet
7  Created on: 2006-07-10
8 
9  (C) Copyright 2006-2013 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 */
20 
21 #pragma once
22 #ifndef _vctDynamicNArrayBase_h
23 #define _vctDynamicNArrayBase_h
24 
33 
41 template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
42 class vctDynamicNArrayBase: public vctDynamicConstNArrayBase<_nArrayOwnerType, _elementType, _dimension>
43 {
44 public:
45  /* define most types from vctContainerTraits and vctNArrayTraits */
46  VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType);
47  VCT_NARRAY_TRAITS_TYPEDEFS(_dimension);
48 
51 
54 
56  typedef _nArrayOwnerType OwnerType;
57 
58  enum {DIMENSION = OwnerType::DIMENSION};
59 
62  typedef typename OwnerType::iterator iterator;
67 
74 
81 
89 
90 
94  {
95  return this->NArray.begin();
96  }
97 
98  /* documented in base class */
99  const_iterator begin(void) const
100  {
101  return BaseType::begin();
102  }
103 
106  iterator end(void)
107  {
108  return this->NArray.end();
109  }
110 
111  /* documented in base class */
112  const_iterator end(void) const
113  {
114  return BaseType::end();
115  }
116 
120  {
121  return this->NArray.rbegin();
122  }
123 
124  /* documented in base class */
126  {
127  return BaseType::rbegin();
128  }
129 
133  {
134  return this->NArray.rend();
135  }
136 
137  /* documented in base class */
139  {
140  return BaseType::rend();
141  }
142 
143 
144  /* documented in base class */
145  const OwnerType & Owner(void) const {
146  return BaseType::Owner();
147  }
148  OwnerType & Owner(void) {
149  return this->NArray;
150  }
151 
152 
156  pointer Pointer(const nsize_type & indices)
157  {
158  return this->NArray.Pointer(indices);
159  }
160 
161  /* documented in base class */
162  const_pointer Pointer(const nsize_type & indices) const
163  {
164  return BaseType::Pointer(indices);
165  }
166 
170  pointer Pointer(void)
171  {
172  return this->NArray.Pointer();
173  }
174 
175  /* documented in base class */
176  const_pointer Pointer(void) const
177  {
178  return BaseType::Pointer();
179  }
180 
181 
186  reference at(size_type metaIndex)
187  throw(std::out_of_range)
188  {
189  this->ThrowUnlessValidIndex(metaIndex);
190  return (begin())[metaIndex];
191  }
192 
193 
194  /* documented in base class */
195  const_reference at(size_type metaIndex) const
196  throw(std::out_of_range)
197  {
198  return BaseType::at(metaIndex);
199  }
200 
201 
206  reference at(const nsize_type & coordinates)
207  throw(std::out_of_range)
208  {
209  this->ThrowUnlessValidIndex(coordinates);
210  return *(Pointer(coordinates));
211  }
212 
213  /* documented in base class */
214  const_reference at(const nsize_type & coordinates) const
215  throw(std::out_of_range)
216  {
217  return BaseType::at(coordinates);
218  }
219 
220 
222  reference operator () (const nsize_type & coordinates)
223  throw(std::out_of_range)
224  {
225  return this->at(coordinates);
226  }
227 
229  const_reference operator () (const nsize_type & coordinates) const
230  throw(std::out_of_range)
231  {
232  return BaseType::operator()(coordinates);
233  }
234 
235 
241  reference Element(const nsize_type & coordinates)
242  {
243  return *(Pointer(coordinates));
244  }
245 
246  /* documented in base class */
247  const_reference Element(const nsize_type & coordinates) const
248  {
249  return BaseType::Element(coordinates);
250  }
251 
252 
259  SubarrayRefType Subarray(const nsize_type & startPosition,
260  const nsize_type & lengths)
261  {
262  SubarrayRefType subarray;
263  subarray.SubarrayOf(*this, startPosition, lengths);
264  return subarray;
265  }
266 
267 
269  ConstSubarrayRefType Subarray(const nsize_type & startPosition,
270  const nsize_type & lengths) const
271  {
272  return BaseType::Subarray(startPosition, lengths);
273  }
274 
275 
282  PermutationRefType Permutation(const ndimension_type & dimensions)
283  {
284  PermutationRefType permutation;
285  permutation.PermutationOf(*this, dimensions);
286  return permutation;
287  }
288 
289 
291  ConstPermutationRefType Permutation(const ndimension_type & dimensions) const
292  {
293  return BaseType::Permutation(dimensions);
294  }
295 
296 
305  SliceRefType Slice(dimension_type dimension, size_type index)
306  throw(std::runtime_error, std::out_of_range)
307  {
308  return SlicesTypes::SliceOf(*this, dimension, index);
309  }
310 
311 
313  ConstSliceRefType Slice(dimension_type dimension, size_type index) const
314  throw(std::runtime_error, std::out_of_range)
315  {
316  return BaseType::Slice(dimension, index);
317  }
318 
319 
325  {
326  return this->Slice(0, index);
327  }
328 
329 
332  {
333  return BaseType::operator[](index);
334  }
335 
336 
341  inline value_type SetAll(const value_type value)
342  {
344  NioSi<typename vctStoreBackBinaryOperations<value_type>::SecondOperand>::
345  Run(*this, value);
346  return value;
347  }
348 
349 
358  inline bool Zeros(void) {
359  if (this->IsCompact()) {
360  memset(this->Pointer(), 0, this->size() * sizeof(value_type));
361  return true;
362  } else {
363  this->SetAll(static_cast<value_type>(0));
364  return false;
365  }
366  }
367 
373  template <class __nArrayOwnerType>
375  if (this->FastCopyCompatible(other)) {
376  this->FastCopyOf(other, false);
377  } else {
379  NoNi<typename vctUnaryOperations<value_type,
380  typename __nArrayOwnerType::value_type>::Identity>::
381  Run(*this, other);
382  }
383  return *this;
384  }
386 
387 
394  template <class __nArrayOwnerType, typename __elementType>
396  {
398  NoNi<typename vctUnaryOperations<value_type,
399  typename __nArrayOwnerType::value_type>::Identity>::
400  Run(*this, other);
401  return *this;
402  }
403 
404  template <class __nArrayOwnerType, typename __elementType>
406  {
407  return this->Assign(other);
408  }
410 
411 
430  inline ThisType & Assign(const value_type * elements)
431  {
432  nstride_type strides;
433  typename nsize_type::const_reverse_iterator sizesIter = this->sizes().rbegin();
434  typename nstride_type::reverse_iterator stridesIter = strides.rbegin();
435  const typename nstride_type::const_reverse_iterator stridesEnd = strides.rend();
436  size_type sizesIter_value;
437  stride_type previous_stride;
438 
439  if (stridesIter != stridesEnd)
440  {
441  *stridesIter = 1;
442  previous_stride = 1;
443  ++stridesIter;
444  }
445 
446  for (; stridesIter != stridesEnd;
447  ++stridesIter, ++sizesIter)
448  {
449  sizesIter_value = (*sizesIter == 0) ? 1 : *sizesIter;
450  *stridesIter = sizesIter_value * previous_stride;
451  previous_stride = *stridesIter;
452  }
453 
455  this->sizes(),
456  strides);
457  this->Assign(tmpRef);
458  return *this;
459  }
460 
461 
480  template <class __nArrayOwnerType, typename __elementType>
482  return this->Assign(other);
483  }
484 
485 
546  template <class __nArrayOwnerType>
548  bool performSafetyChecks = true)
549  throw(std::runtime_error)
550  {
551  return vctFastCopy::NArrayCopy(*this, source, performSafetyChecks);
552  }
554 
555 
572  template <class __nArrayOwnerType1, class __nArrayOwnerType2>
575  {
577  NoNiNi< typename vctBinaryOperations<value_type>::Addition >
578  ::Run(*this, nArray1, nArray2);
579  return *this;
580  }
581 
582  /* documented above */
583  template <class __nArrayOwnerType1, class __nArrayOwnerType2>
586  {
588  NoNiNi< typename vctBinaryOperations<value_type>::Subtraction >
589  ::Run(*this, nArray1, nArray2);
590  return *this;
591  }
592 
593  /* documented above */
594  template <class __nArrayOwnerType1, class __nArrayOwnerType2>
597  {
599  NoNiNi< typename vctBinaryOperations<value_type>::Multiplication >
600  ::Run(*this, nArray1, nArray2);
601  return *this;
602  }
603 
604  /* documented above */
605  template <class __nArrayOwnerType1, class __nArrayOwnerType2>
608  {
610  NoNiNi< typename vctBinaryOperations<value_type>::Division >
611  ::Run(*this, nArray1, nArray2);
612  return *this;
613  }
614 
615  /* documented above */
616  template <class __nArrayOwnerType1, class __nArrayOwnerType2>
619  {
621  NoNiNi< typename vctBinaryOperations<value_type>::Minimum >
622  ::Run(*this, nArray1, nArray2);
623  return *this;
624  }
625 
626  /* documented above */
627  template <class __nArrayOwnerType1, class __nArrayOwnerType2>
630  {
632  NoNiNi< typename vctBinaryOperations<value_type>::Maximum >
633  ::Run(*this, nArray1, nArray2);
634  return *this;
635  }
637 
638 
639 
656  template <class __nArrayOwnerType>
658  {
660  NioNi<typename vctStoreBackBinaryOperations<value_type>::Addition >::
661  Run(*this, otherNArray);
662  return *this;
663  }
664 
665  /* documented above */
666  template <class __nArrayOwnerType>
668  {
670  NioNi< typename vctStoreBackBinaryOperations<value_type>::Subtraction >::
671  Run(*this, otherNArray);
672  return *this;
673  }
674 
675  /* documented above */
676  template <class __nArrayOwnerType>
678  {
680  NioNi< typename vctStoreBackBinaryOperations<value_type>::Multiplication >::
681  Run(*this, otherNArray);
682  return *this;
683  }
684 
685  /* documented above */
686  template <class __nArrayOwnerType>
688  {
690  NioNi< typename vctStoreBackBinaryOperations<value_type>::Division >::
691  Run(*this, otherNArray);
692  return *this;
693  }
694 
695  /* documented above */
696  template <class __nArrayOwnerType>
698  {
700  NioNi< typename vctStoreBackBinaryOperations<value_type>::Minimum >::
701  Run(*this, otherNArray);
702  return *this;
703  }
704 
705  /* documented above */
706  template <class __nArrayOwnerType>
708  {
710  NioNi< typename vctStoreBackBinaryOperations<value_type>::Maximum >::
711  Run(*this, otherNArray);
712  return *this;
713  }
714 
715  /* documented above */
716  template <class __nArrayOwnerType>
718  {
719  return this->Add(otherNArray);
720  }
721 
722  /* documented above */
723  template <class __nArrayOwnerType>
725  {
726  return this->Subtract(otherNArray);
727  }
729 
730 
746  template <class __nArrayOwnerType>
748  const value_type scalar)
749  {
751  NoNiSi< typename vctBinaryOperations<value_type>::Addition >::
752  Run(*this, nArray, scalar);
753  return *this;
754  }
755 
756  /* documented above */
757  template <class __nArrayOwnerType>
759  const value_type scalar)
760  {
762  NoNiSi< typename vctBinaryOperations<value_type>::Subtraction >::
763  Run(*this, nArray, scalar);
764  return *this;
765  }
766 
767  /* documented above */
768  template <class __nArrayOwnerType>
770  const value_type scalar)
771  {
773  NoNiSi< typename vctBinaryOperations<value_type>::Multiplication >::
774  Run(*this, nArray, scalar);
775  return *this;
776  }
777 
778  /* documented above */
779  template <class __nArrayOwnerType>
781  const value_type scalar)
782  {
784  NoNiSi< typename vctBinaryOperations<value_type>::Division >::
785  Run(*this, nArray, scalar);
786  return *this;
787  }
788 
789  /* documented above */
790  template <class __nArrayOwnerType>
792  const value_type lowerBound)
793  {
795  NoNiSi<typename vctBinaryOperations<value_type>::Minimum>::
796  Run(*this, nArray, lowerBound);
797  return *this;
798  }
799 
800  /* documented above */
801  template <class __nArrayOwnerType>
803  const value_type upperBound)
804  {
806  NoNiSi< typename vctBinaryOperations<value_type>::Maximum >::
807  Run(*this, nArray, upperBound);
808  return *this;
809  }
811 
812 
813 
829  template <class __nArrayOwnerType>
830  inline ThisType & SumOf(const value_type scalar,
832  {
834  NoSiNi< typename vctBinaryOperations<value_type>::Addition >::
835  Run(*this, scalar, nArray);
836  return *this;
837  }
838 
839  /* documented above */
840  template <class __nArrayOwnerType>
841  inline ThisType & DifferenceOf(const value_type scalar,
843  {
845  NoSiNi< typename vctBinaryOperations<value_type>::Subtraction >::
846  Run(*this, scalar, nArray);
847  return *this;
848  }
849 
850  /* documented above */
851  template <class __nArrayOwnerType>
852  inline ThisType & ProductOf(const value_type scalar,
854  {
856  NoSiNi< typename vctBinaryOperations<value_type>::Multiplication >::
857  Run(*this, scalar, nArray);
858  return *this;
859  }
860 
861  /* documented above */
862  template <class __nArrayOwnerType>
863  inline ThisType & RatioOf(const value_type scalar,
865  {
867  NoSiNi< typename vctBinaryOperations<value_type>::Division >::
868  Run(*this, scalar, nArray);
869  return *this;
870  }
871 
872  /* documented above */
873  template <class __nArrayOwnerType>
874  inline ThisType & ClippedAboveOf(const value_type upperBound,
876  {
878  NoSiNi< typename vctBinaryOperations<value_type>::Minimum >::
879  Run(*this, upperBound, nArray);
880  return *this;
881  }
882 
883  /* documented above */
884  template <class __nArrayOwnerType>
885  inline ThisType & ClippedBelowOf(const value_type lowerBound,
887  {
889  NoSiNi< typename vctBinaryOperations<value_type>::Maximum >::
890  Run(*this, lowerBound, nArray);
891  return *this;
892  }
894 
895 
911  inline ThisType & Add(const value_type scalar)
912  {
914  NioSi< typename vctStoreBackBinaryOperations<value_type>::Addition >::
915  Run(*this, scalar);
916  return *this;
917  }
918 
919  /* documented above */
920  inline ThisType & Subtract(const value_type scalar)
921  {
923  NioSi< typename vctStoreBackBinaryOperations<value_type>::Subtraction >::
924  Run(*this, scalar);
925  return *this;
926  }
927 
928  /* documented above */
929  inline ThisType & Multiply(const value_type scalar)
930  {
932  NioSi< typename vctStoreBackBinaryOperations<value_type>::Multiplication >::
933  Run(*this, scalar);
934  return *this;
935  }
936 
937  /* documented above */
938  inline ThisType & Divide(const value_type scalar)
939  {
941  NioSi< typename vctStoreBackBinaryOperations<value_type>::Division >::
942  Run(*this, scalar);
943  return *this;
944  }
945 
946  /* documented above */
947  inline ThisType & ClipAbove(const value_type upperBound)
948  {
950  NioSi< typename vctStoreBackBinaryOperations<value_type>::Minimum >::
951  Run(*this, upperBound);
952  return *this;
953  }
954 
955  /* documented above */
956  inline ThisType & ClipBelow(const value_type lowerBound)
957  {
959  NioSi< typename vctStoreBackBinaryOperations<value_type>::Maximum >::
960  Run(*this, lowerBound);
961  return *this;
962  }
963 
964  /* documented above */
965  inline ThisType & operator += (const value_type scalar)
966  {
967  return this->Add(scalar);
968  }
969 
970  /* documented above */
971  inline ThisType & operator -= (const value_type scalar)
972  {
973  return this->Subtract(scalar);
974  }
975 
976  /* documented above */
977  inline ThisType & operator *= (const value_type scalar)
978  {
979  return this->Multiply(scalar);
980  }
981 
982  /* documented above */
983  inline ThisType & operator /= (const value_type scalar)
984  {
985  return this->Divide(scalar);
986  }
988 
989 
990  template <class __nArrayOwnerType>
991  inline ThisType & AddProductOf(const value_type scalar,
993  {
995  NioSiNi<typename vctStoreBackBinaryOperations<value_type>::Addition,
997  Run(*this, scalar, otherNArray);
998 
999  return *this;
1000  }
1001 
1002 
1003  template <class __nArrayOwnerType1, class __nArrayOwnerType2>
1006  {
1008  NioNiNi<typename vctStoreBackBinaryOperations<value_type>::Addition,
1010  Run(*this, nArray1, nArray2);
1011 
1012  return *this;
1013  }
1014 
1015 
1028  template <class __nArrayOwnerType>
1030  {
1032  NoNi<typename vctUnaryOperations<value_type>::AbsValue>::
1033  Run(*this, otherNArray);
1034  return *this;
1035  }
1036 
1037  /* documented above */
1038  template <class __nArrayOwnerType>
1040  {
1042  NoNi<typename vctUnaryOperations<value_type>::Negation>::
1043  Run(*this, otherNArray);
1044  return *this;
1045  }
1046 
1047  /* documented above */
1048  template <class __nArrayOwnerType>
1050  {
1052  NoNi<typename vctUnaryOperations<value_type>::Floor>::
1053  Run(*this, otherNArray);
1054  return *this;
1055  }
1056 
1057  /* documented above */
1058  template <class __nArrayOwnerType>
1060  {
1062  NoNi<typename vctUnaryOperations<value_type>::Ceil>::
1063  Run(*this, otherNArray);
1064  return *this;
1065  }
1066 
1068 
1079  inline ThisType & AbsSelf(void)
1080  {
1082  Nio<typename vctStoreBackUnaryOperations<value_type>::MakeAbs>::
1083  Run(*this);
1084  return *this;
1085  }
1086 
1087  /* documented above */
1088  inline ThisType & NegationSelf(void)
1089  {
1091  Nio<typename vctStoreBackUnaryOperations<value_type>::MakeNegation>::
1092  Run(*this);
1093  return *this;
1094  }
1095 
1096  /* documented above */
1097  inline ThisType & FloorSelf(void)
1098  {
1100  Nio<typename vctStoreBackUnaryOperations<value_type>::MakeFloor>::
1101  Run(*this);
1102  return *this;
1103  }
1104 
1105  /* documented above */
1106  inline ThisType & CeilSelf(void)
1107  {
1109  Nio<typename vctStoreBackUnaryOperations<value_type>::MakeCeil>::
1110  Run(*this);
1111  return *this;
1112  }
1114 };
1115 
1116 
1117 #endif // _vctDynamicNArrayBase_h
1118 
ConstPermutationRefType Permutation(const ndimension_type &dimensions) const
Definition: vctDynamicConstNArrayBase.h:482
ThisType & ElementwiseDivide(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:687
ThisType & Divide(const value_type scalar)
Definition: vctDynamicNArrayBase.h:938
ThisType & SumOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
Definition: vctDynamicNArrayBase.h:747
void ThrowUnlessValidIndex(size_type index) const
Definition: vctDynamicConstNArrayBase.h:240
reference operator()(const nsize_type &coordinates)
Definition: vctDynamicNArrayBase.h:222
dimension_type dimension(void) const
Definition: vctDynamicConstNArrayBase.h:332
ThisType & Add(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:657
const_reverse_iterator rbegin(void) const
Definition: vctDynamicConstNArrayBase.h:287
ThisType & SumOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition: vctDynamicNArrayBase.h:573
ThisType & operator=(const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
Definition: vctDynamicNArrayBase.h:405
BaseType::ConstPermutationRefType ConstPermutationRefType
Definition: vctDynamicNArrayBase.h:78
_nArrayOwnerType OwnerType
Definition: vctDynamicNArrayBase.h:56
const nsize_type & sizes(void) const
Definition: vctDynamicConstNArrayBase.h:308
ThisType & ProductOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
Definition: vctDynamicNArrayBase.h:769
const_pointer Pointer(void) const
Definition: vctDynamicConstNArrayBase.h:436
ConstSubarrayRefType Subarray(const nsize_type &startPosition, const nsize_type &lengths) const
Definition: vctDynamicNArrayBase.h:269
Container class for the dynamic nArray engines.
Definition: vctDynamicNArrayLoopEngines.h:43
ThisType & ElementwiseMinOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition: vctDynamicNArrayBase.h:617
PermutationRefType Permutation(const ndimension_type &dimensions)
Definition: vctDynamicNArrayBase.h:282
ThisType & ElementwiseMin(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:697
const_reverse_iterator rend(void) const
Definition: vctDynamicNArrayBase.h:138
Definition: vctDynamicConstNArrayBase.h:155
ThisType & Assign(const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
Definition: vctDynamicNArrayBase.h:395
OwnerType::reverse_iterator reverse_iterator
Definition: vctDynamicNArrayBase.h:64
ThisType & AbsSelf(void)
Definition: vctDynamicNArrayBase.h:1079
ThisType & FloorSelf(void)
Definition: vctDynamicNArrayBase.h:1097
void SubarrayOf(vctDynamicNArrayBase< __ownerType, _elementType, DIMENSION > &otherNArray, const nsize_type &startPosition, const nsize_type &lengths)
Definition: vctDynamicNArrayRef.h:202
ThisType & AddElementwiseProductOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition: vctDynamicNArrayBase.h:1004
vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > BaseType
Definition: vctDynamicNArrayBase.h:53
ThisType & Add(const value_type scalar)
Definition: vctDynamicNArrayBase.h:911
ThisType & Subtract(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:667
ConstPermutationRefType Permutation(const ndimension_type &dimensions) const
Definition: vctDynamicNArrayBase.h:291
ThisType & RatioOf(const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition: vctDynamicNArrayBase.h:863
size_t size_type
Definition: vctContainerTraits.h:35
const_reference at(size_type metaIndex) const
Definition: vctDynamicConstNArrayBase.h:399
BaseType::SlicesTypes SlicesTypes
Definition: vctDynamicNArrayBase.h:85
ThisType & CeilOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:1059
void PermutationOf(vctDynamicNArrayBase< __ownerType, _elementType, DIMENSION > &otherNArray, const ndimension_type &dimensions)
Definition: vctDynamicNArrayRef.h:218
ThisType & AbsOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:1029
iterator end(void)
Definition: vctDynamicNArrayBase.h:106
ConstSliceRefType Slice(dimension_type dimension, size_type index) const
Definition: vctDynamicConstNArrayBase.h:498
const_reverse_iterator rend(void) const
Definition: vctDynamicConstNArrayBase.h:294
ThisType & DifferenceOf(const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition: vctDynamicNArrayBase.h:841
Declaration of vctStoreBackBinaryOperations.
Dynamic nArray referencing existing memory (const)
Definition: vctDynamicConstNArrayRef.h:89
const_reverse_iterator rbegin(void) const
Definition: vctDynamicNArrayBase.h:125
ThisType & RatioOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
Definition: vctDynamicNArrayBase.h:780
ThisType & CeilSelf(void)
Definition: vctDynamicNArrayBase.h:1106
ThisType & ClippedBelowOf(const value_type lowerBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition: vctDynamicNArrayBase.h:885
ThisType & operator+=(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:717
Definition: vctDynamicNArrayRefOwner.h:36
Define unary operations on an object as classes.
Definition: vctUnaryOperations.h:55
OwnerType::const_iterator const_iterator
Definition: vctDynamicNArrayBase.h:63
pointer Pointer(const nsize_type &indices)
Definition: vctDynamicNArrayBase.h:156
reference at(const nsize_type &coordinates)
Definition: vctDynamicNArrayBase.h:206
vctDynamicNArrayBase ThisType
Definition: vctDynamicNArrayBase.h:50
Definition: vctDynamicNArrayBase.h:58
ThisType & SumOf(const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition: vctDynamicNArrayBase.h:830
ThisType & ElementwiseRatioOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition: vctDynamicNArrayBase.h:606
Definition: vctForwardDeclarations.h:77
ConstSliceRefType Slice(dimension_type dimension, size_type index) const
Definition: vctDynamicNArrayBase.h:313
SliceRefType Slice(dimension_type dimension, size_type index)
Definition: vctDynamicNArrayBase.h:305
ThisType & ProductOf(const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition: vctDynamicNArrayBase.h:852
const_reference at(const nsize_type &coordinates) const
Definition: vctDynamicNArrayBase.h:214
bool FastCopyCompatible(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &source) const
Definition: vctDynamicConstNArrayBase.h:735
reverse_iterator rbegin(void)
Definition: vctDynamicNArrayBase.h:119
pointer Pointer(void)
Definition: vctDynamicNArrayBase.h:170
BaseType::ConstSliceRefType ConstSliceRefType
Definition: vctDynamicNArrayBase.h:86
BaseType::ConstSubarrayRefType ConstSubarrayRefType
Definition: vctDynamicNArrayBase.h:71
BaseType::PermutationRefType PermutationRefType
Definition: vctDynamicNArrayBase.h:79
ThisType & Assign(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &other)
Definition: vctDynamicNArrayBase.h:374
reference Element(const nsize_type &coordinates)
Definition: vctDynamicNArrayBase.h:241
VCT_NARRAY_TRAITS_TYPEDEFS(_dimension)
const_reference operator()(const nsize_type &coordinates) const
Definition: vctDynamicConstNArrayBase.h:418
ThisType & ClippedAboveOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type lowerBound)
Definition: vctDynamicNArrayBase.h:791
Dynamic nArray referencing existing memory.
Definition: vctDynamicNArrayRef.h:87
ThisType & operator/=(const value_type scalar)
Definition: vctDynamicNArrayBase.h:983
const_pointer Pointer(const nsize_type &indices) const
Definition: vctDynamicNArrayBase.h:162
const OwnerType & Owner(void) const
Definition: vctDynamicConstNArrayBase.h:428
ThisType & ClipBelow(const value_type lowerBound)
Definition: vctDynamicNArrayBase.h:956
iterator begin(void)
Definition: vctDynamicNArrayBase.h:93
SlicesTypes::SliceRefType SliceRefType
Definition: vctDynamicConstNArrayBase.h:199
const_pointer Pointer(void) const
Definition: vctDynamicNArrayBase.h:176
const_iterator end(void) const
Definition: vctDynamicNArrayBase.h:112
const_reference Element(const nsize_type &coordinates) const
Definition: vctDynamicConstNArrayBase.h:455
SlicesTypes::ConstSliceRefType ConstSliceRefType
Definition: vctDynamicConstNArrayBase.h:198
BaseType::SliceRefType SliceRefType
Definition: vctDynamicNArrayBase.h:87
reverse_iterator rend(void)
Definition: vctDynamicNArrayBase.h:132
ConstSliceRefType operator[](size_type index) const
Definition: vctDynamicConstNArrayBase.h:509
Declaration of vctStoreBackUnaryOperations.
vctDynamicNArrayTypes< DIMENSION >::template SlicesTypes< _elementType > SlicesTypes
Definition: vctDynamicConstNArrayBase.h:196
SliceRefType operator[](size_type index)
Definition: vctDynamicNArrayBase.h:324
ThisType & FloorOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:1049
ThisType & AddProductOf(const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:991
ThisType & NegationSelf(void)
Definition: vctDynamicNArrayBase.h:1088
ThisType & ElementwiseMax(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:707
bool Zeros(void)
Definition: vctDynamicNArrayBase.h:358
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
Definition: vctDynamicNArrayBase.h:42
ptrdiff_t stride_type
Definition: vctContainerTraits.h:37
reference at(size_type metaIndex)
Definition: vctDynamicNArrayBase.h:186
ThisType & Subtract(const value_type scalar)
Definition: vctDynamicNArrayBase.h:920
ThisType & ElementwiseMultiply(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:677
Definition: vctForwardDeclarations.h:74
size_type size(void) const
Definition: vctDynamicConstNArrayBase.h:302
ThisType & operator*=(const value_type scalar)
Definition: vctDynamicNArrayBase.h:977
const_iterator begin(void) const
Definition: vctDynamicNArrayBase.h:99
bool IsCompact(void) const
Definition: vctDynamicConstNArrayBase.h:725
const nstride_type & strides(void) const
Definition: vctDynamicConstNArrayBase.h:320
const_reference Element(const nsize_type &coordinates) const
Definition: vctDynamicNArrayBase.h:247
ThisType & ClipAbove(const value_type upperBound)
Definition: vctDynamicNArrayBase.h:947
const OwnerType & Owner(void) const
Definition: vctDynamicNArrayBase.h:145
OwnerType::const_reverse_iterator const_reverse_iterator
Definition: vctDynamicNArrayBase.h:65
ThisType & ClippedBelowOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type upperBound)
Definition: vctDynamicNArrayBase.h:802
OwnerType NArray
Definition: vctDynamicConstNArrayBase.h:227
OwnerType & Owner(void)
Definition: vctDynamicNArrayBase.h:148
SubarrayRefType Subarray(const nsize_type &startPosition, const nsize_type &lengths)
Definition: vctDynamicNArrayBase.h:259
ConstSliceRefType operator[](size_type index) const
Definition: vctDynamicNArrayBase.h:331
value_type SetAll(const value_type value)
Definition: vctDynamicNArrayBase.h:341
Returns the product of the two InputType object.
Definition: vctBinaryOperations.h:116
ThisType & ElementwiseMaxOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition: vctDynamicNArrayBase.h:628
ThisType & NegationOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:1039
ThisType & DifferenceOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
Definition: vctDynamicNArrayBase.h:758
ThisType & operator-=(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition: vctDynamicNArrayBase.h:724
ConstSubarrayRefType Subarray(const nsize_type &startPosition, const nsize_type &lengths) const
Definition: vctDynamicConstNArrayBase.h:467
static bool NArrayCopy(_destinationNArrayType &destination, const _sourceNArrayType &source, bool performSafetyChecks)
Definition: vctFastCopy.h:288
ThisType & Multiply(const value_type scalar)
Definition: vctDynamicNArrayBase.h:929
BaseType::SubarrayRefType SubarrayRefType
Definition: vctDynamicNArrayBase.h:72
ThisType & ClippedAboveOf(const value_type upperBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition: vctDynamicNArrayBase.h:874
const_iterator end(void) const
Definition: vctDynamicConstNArrayBase.h:280
ThisType & ElementwiseProductOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition: vctDynamicNArrayBase.h:595
ThisType & ForceAssign(const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
Definition: vctDynamicNArrayBase.h:481
bool FastCopyOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &source, bool performSafetyChecks=true)
Definition: vctDynamicNArrayBase.h:547
ThisType & Assign(const value_type *elements)
Definition: vctDynamicNArrayBase.h:430
const_iterator begin(void) const
Definition: vctDynamicConstNArrayBase.h:273
OwnerType::iterator iterator
Definition: vctDynamicNArrayBase.h:62
ThisType & DifferenceOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition: vctDynamicNArrayBase.h:584
Declaration of vctDynamicConstNArrayBase.
const_reference at(size_type metaIndex) const
Definition: vctDynamicNArrayBase.h:195