cisst-saw
Loading...
Searching...
No Matches
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 Author(s): Daniel Li, Ofri Sadowsky, Anton Deguet
6 Created on: 2006-07-10
7
8 (C) Copyright 2006-2018 Johns Hopkins University (JHU), All Rights Reserved.
9
10--- begin cisst license - do not edit ---
11
12This software is provided "as is" under an open source license, with
13no warranty. The complete license can be found in license.txt and
14http://www.cisst.org/cisst/license.txt.
15
16--- end cisst license ---
17*/
18
19#pragma once
20#ifndef _vctDynamicNArrayBase_h
21#define _vctDynamicNArrayBase_h
22
27
31
39template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
40class vctDynamicNArrayBase: public vctDynamicConstNArrayBase<_nArrayOwnerType, _elementType, _dimension>
41{
42public:
43 /* define most types from vctContainerTraits and vctNArrayTraits */
46
49
52
54 typedef _nArrayOwnerType OwnerType;
55
57
60 typedef typename OwnerType::iterator iterator;
65
72
79
87
88
92 {
93 return this->NArray.begin();
94 }
95
96 /* documented in base class */
98 {
99 return BaseType::begin();
100 }
101
105 {
106 return this->NArray.end();
107 }
108
109 /* documented in base class */
110 const_iterator end(void) const
111 {
112 return BaseType::end();
113 }
114
118 {
119 return this->NArray.rbegin();
120 }
121
122 /* documented in base class */
124 {
125 return BaseType::rbegin();
126 }
127
131 {
132 return this->NArray.rend();
133 }
134
135 /* documented in base class */
137 {
138 return BaseType::rend();
139 }
140
141
142 /* documented in base class */
143 const OwnerType & Owner(void) const {
144 return BaseType::Owner();
145 }
146 OwnerType & Owner(void) {
147 return this->NArray;
148 }
149
150
154 pointer Pointer(const nsize_type & indices)
155 {
156 return this->NArray.Pointer(indices);
157 }
158
159 /* documented in base class */
160 const_pointer Pointer(const nsize_type & indices) const
161 {
162 return BaseType::Pointer(indices);
163 }
164
168 pointer Pointer(void)
169 {
170 return this->NArray.Pointer();
171 }
172
173 /* documented in base class */
174 const_pointer Pointer(void) const
175 {
176 return BaseType::Pointer();
177 }
178
179
184 reference at(size_type metaIndex)
185 CISST_THROW(std::out_of_range)
186 {
187 this->ThrowUnlessValidIndex(metaIndex);
188 return (begin())[metaIndex];
189 }
190
191
192 /* documented in base class */
193 const_reference at(size_type metaIndex) const
194 CISST_THROW(std::out_of_range)
195 {
196 return BaseType::at(metaIndex);
197 }
198
199
204 reference at(const nsize_type & coordinates)
205 CISST_THROW(std::out_of_range)
206 {
207 this->ThrowUnlessValidIndex(coordinates);
208 return *(Pointer(coordinates));
209 }
210
211 /* documented in base class */
212 const_reference at(const nsize_type & coordinates) const
213 CISST_THROW(std::out_of_range)
214 {
215 return BaseType::at(coordinates);
216 }
217
218
220 reference operator () (const nsize_type & coordinates)
221 CISST_THROW(std::out_of_range)
222 {
223 return this->at(coordinates);
224 }
225
227 const_reference operator () (const nsize_type & coordinates) const
228 CISST_THROW(std::out_of_range)
229 {
230 return BaseType::operator()(coordinates);
231 }
232
233
239 reference Element(const nsize_type & coordinates)
240 {
241 return *(Pointer(coordinates));
242 }
243
244 /* documented in base class */
245 const_reference Element(const nsize_type & coordinates) const
246 {
247 return BaseType::Element(coordinates);
248 }
249
250
257 SubarrayRefType Subarray(const nsize_type & startPosition,
258 const nsize_type & lengths)
259 {
260 SubarrayRefType subarray;
261 subarray.SubarrayOf(*this, startPosition, lengths);
262 return subarray;
263 }
264
265
267 ConstSubarrayRefType Subarray(const nsize_type & startPosition,
268 const nsize_type & lengths) const
269 {
270 return BaseType::Subarray(startPosition, lengths);
271 }
272
273
280 PermutationRefType Permutation(const ndimension_type & dimensions)
281 {
282 PermutationRefType permutation;
283 permutation.PermutationOf(*this, dimensions);
284 return permutation;
285 }
286
287
289 ConstPermutationRefType Permutation(const ndimension_type & dimensions) const
290 {
291 return BaseType::Permutation(dimensions);
292 }
293
294
303 SliceRefType Slice(dimension_type dimension, size_type index)
304 {
305 return SlicesTypes::SliceOf(*this, dimension, index);
306 }
307
308
310 ConstSliceRefType Slice(dimension_type dimension, size_type index) const
311 {
312 return BaseType::Slice(dimension, index);
313 }
314
315
320 SliceRefType operator[](size_type index)
321 {
322 return this->Slice(0, index);
323 }
324
325
327 ConstSliceRefType operator[](size_type index) const
328 {
329 return BaseType::operator[](index);
330 }
331
332
337 inline value_type SetAll(const value_type value)
338 {
340 NioSi<typename vctStoreBackBinaryOperations<value_type>::SecondOperand>::
341 Run(*this, value);
342 return value;
343 }
344
345
354 inline bool Zeros(void) {
355 if (this->IsCompact()) {
356 memset(this->Pointer(), 0, this->size() * sizeof(value_type));
357 return true;
358 } else {
359 this->SetAll(static_cast<value_type>(0));
360 return false;
361 }
362 }
363
369 template <class __nArrayOwnerType>
371 if (this->FastCopyCompatible(other)) {
372 this->FastCopyOf(other, false);
373 } else {
375 NoNi<typename vctUnaryOperations<value_type,
376 typename __nArrayOwnerType::value_type>::Identity>::
377 Run(*this, other);
378 }
379 return *this;
380 }
381
382
383
390 template <class __nArrayOwnerType, typename __elementType>
392 {
394 NoNi<typename vctUnaryOperations<value_type,
395 typename __nArrayOwnerType::value_type>::Identity>::
396 Run(*this, other);
397 return *this;
398 }
399
400 template <class __nArrayOwnerType, typename __elementType>
402 {
403 return this->Assign(other);
404 }
405
406
407
426 inline ThisType & Assign(const value_type * elements)
427 {
428 nstride_type strides;
429 typename nsize_type::const_reverse_iterator sizesIter = this->sizes().rbegin();
430 typename nstride_type::reverse_iterator stridesIter = strides.rbegin();
431 const typename nstride_type::const_reverse_iterator stridesEnd = strides.rend();
432 size_type sizesIter_value;
433 stride_type previous_stride;
434
435 if (stridesIter != stridesEnd)
436 {
437 *stridesIter = 1;
438 previous_stride = 1;
439 ++stridesIter;
440 }
441
442 for (; stridesIter != stridesEnd;
443 ++stridesIter, ++sizesIter)
444 {
445 sizesIter_value = (*sizesIter == 0) ? 1 : *sizesIter;
446 *stridesIter = sizesIter_value * previous_stride;
447 previous_stride = *stridesIter;
448 }
449
451 this->sizes(),
452 strides);
453 this->Assign(tmpRef);
454 return *this;
455 }
456
457
476 template <class __nArrayOwnerType, typename __elementType>
480
481
542 template <class __nArrayOwnerType>
544 bool performSafetyChecks = true)
545 CISST_THROW(std::runtime_error)
546 {
547 return vctFastCopy::NArrayCopy(*this, source, performSafetyChecks);
548 }
549
550
551
555
568 template <class __nArrayOwnerType1, class __nArrayOwnerType2>
571 {
573 NoNiNi< typename vctBinaryOperations<value_type>::Addition >
574 ::Run(*this, nArray1, nArray2);
575 return *this;
576 }
577
578 /* documented above */
579 template <class __nArrayOwnerType1, class __nArrayOwnerType2>
582 {
584 NoNiNi< typename vctBinaryOperations<value_type>::Subtraction >
585 ::Run(*this, nArray1, nArray2);
586 return *this;
587 }
588
589 /* documented above */
590 template <class __nArrayOwnerType1, class __nArrayOwnerType2>
593 {
595 NoNiNi< typename vctBinaryOperations<value_type>::Multiplication >
596 ::Run(*this, nArray1, nArray2);
597 return *this;
598 }
599
600 /* documented above */
601 template <class __nArrayOwnerType1, class __nArrayOwnerType2>
604 {
606 NoNiNi< typename vctBinaryOperations<value_type>::Division >
607 ::Run(*this, nArray1, nArray2);
608 return *this;
609 }
610
611 /* documented above */
612 template <class __nArrayOwnerType1, class __nArrayOwnerType2>
615 {
617 NoNiNi< typename vctBinaryOperations<value_type>::Minimum >
618 ::Run(*this, nArray1, nArray2);
619 return *this;
620 }
621
622 /* documented above */
623 template <class __nArrayOwnerType1, class __nArrayOwnerType2>
626 {
628 NoNiNi< typename vctBinaryOperations<value_type>::Maximum >
629 ::Run(*this, nArray1, nArray2);
630 return *this;
631 }
632
633
634
635
639
652 template <class __nArrayOwnerType>
654 {
656 NioNi<typename vctStoreBackBinaryOperations<value_type>::Addition >::
657 Run(*this, otherNArray);
658 return *this;
659 }
660
661 /* documented above */
662 template <class __nArrayOwnerType>
664 {
666 NioNi< typename vctStoreBackBinaryOperations<value_type>::Subtraction >::
667 Run(*this, otherNArray);
668 return *this;
669 }
670
671 /* documented above */
672 template <class __nArrayOwnerType>
674 {
676 NioNi< typename vctStoreBackBinaryOperations<value_type>::Multiplication >::
677 Run(*this, otherNArray);
678 return *this;
679 }
680
681 /* documented above */
682 template <class __nArrayOwnerType>
684 {
686 NioNi< typename vctStoreBackBinaryOperations<value_type>::Division >::
687 Run(*this, otherNArray);
688 return *this;
689 }
690
691 /* documented above */
692 template <class __nArrayOwnerType>
694 {
696 NioNi< typename vctStoreBackBinaryOperations<value_type>::Minimum >::
697 Run(*this, otherNArray);
698 return *this;
699 }
700
701 /* documented above */
702 template <class __nArrayOwnerType>
704 {
706 NioNi< typename vctStoreBackBinaryOperations<value_type>::Maximum >::
707 Run(*this, otherNArray);
708 return *this;
709 }
710
711 /* documented above */
712 template <class __nArrayOwnerType>
714 {
715 return this->Add(otherNArray);
716 }
717
718 /* documented above */
719 template <class __nArrayOwnerType>
721 {
722 return this->Subtract(otherNArray);
723 }
724
725
726
730
742 template <class __nArrayOwnerType>
744 const value_type scalar)
745 {
747 NoNiSi< typename vctBinaryOperations<value_type>::Addition >::
748 Run(*this, nArray, scalar);
749 return *this;
750 }
751
752 /* documented above */
753 template <class __nArrayOwnerType>
755 const value_type scalar)
756 {
758 NoNiSi< typename vctBinaryOperations<value_type>::Subtraction >::
759 Run(*this, nArray, scalar);
760 return *this;
761 }
762
763 /* documented above */
764 template <class __nArrayOwnerType>
766 const value_type scalar)
767 {
769 NoNiSi< typename vctBinaryOperations<value_type>::Multiplication >::
770 Run(*this, nArray, scalar);
771 return *this;
772 }
773
774 /* documented above */
775 template <class __nArrayOwnerType>
777 const value_type scalar)
778 {
780 NoNiSi< typename vctBinaryOperations<value_type>::Division >::
781 Run(*this, nArray, scalar);
782 return *this;
783 }
784
785 /* documented above */
786 template <class __nArrayOwnerType>
788 const value_type lowerBound)
789 {
791 NoNiSi<typename vctBinaryOperations<value_type>::Minimum>::
792 Run(*this, nArray, lowerBound);
793 return *this;
794 }
795
796 /* documented above */
797 template <class __nArrayOwnerType>
799 const value_type upperBound)
800 {
802 NoNiSi< typename vctBinaryOperations<value_type>::Maximum >::
803 Run(*this, nArray, upperBound);
804 return *this;
805 }
806
807
808
809
813
825 template <class __nArrayOwnerType>
826 inline ThisType & SumOf(const value_type scalar,
828 {
830 NoSiNi< typename vctBinaryOperations<value_type>::Addition >::
831 Run(*this, scalar, nArray);
832 return *this;
833 }
834
835 /* documented above */
836 template <class __nArrayOwnerType>
837 inline ThisType & DifferenceOf(const value_type scalar,
839 {
841 NoSiNi< typename vctBinaryOperations<value_type>::Subtraction >::
842 Run(*this, scalar, nArray);
843 return *this;
844 }
845
846 /* documented above */
847 template <class __nArrayOwnerType>
848 inline ThisType & ProductOf(const value_type scalar,
850 {
852 NoSiNi< typename vctBinaryOperations<value_type>::Multiplication >::
853 Run(*this, scalar, nArray);
854 return *this;
855 }
856
857 /* documented above */
858 template <class __nArrayOwnerType>
859 inline ThisType & RatioOf(const value_type scalar,
861 {
863 NoSiNi< typename vctBinaryOperations<value_type>::Division >::
864 Run(*this, scalar, nArray);
865 return *this;
866 }
867
868 /* documented above */
869 template <class __nArrayOwnerType>
870 inline ThisType & ClippedAboveOf(const value_type upperBound,
872 {
874 NoSiNi< typename vctBinaryOperations<value_type>::Minimum >::
875 Run(*this, upperBound, nArray);
876 return *this;
877 }
878
879 /* documented above */
880 template <class __nArrayOwnerType>
881 inline ThisType & ClippedBelowOf(const value_type lowerBound,
883 {
885 NoSiNi< typename vctBinaryOperations<value_type>::Maximum >::
886 Run(*this, lowerBound, nArray);
887 return *this;
888 }
889
890
891
895
907 inline ThisType & Add(const value_type scalar)
908 {
910 NioSi< typename vctStoreBackBinaryOperations<value_type>::Addition >::
911 Run(*this, scalar);
912 return *this;
913 }
914
915 /* documented above */
916 inline ThisType & Subtract(const value_type scalar)
917 {
919 NioSi< typename vctStoreBackBinaryOperations<value_type>::Subtraction >::
920 Run(*this, scalar);
921 return *this;
922 }
923
924 /* documented above */
925 inline ThisType & Multiply(const value_type scalar)
926 {
928 NioSi< typename vctStoreBackBinaryOperations<value_type>::Multiplication >::
929 Run(*this, scalar);
930 return *this;
931 }
932
933 /* documented above */
934 inline ThisType & Divide(const value_type scalar)
935 {
937 NioSi< typename vctStoreBackBinaryOperations<value_type>::Division >::
938 Run(*this, scalar);
939 return *this;
940 }
941
942 /* documented above */
943 inline ThisType & ClipAbove(const value_type upperBound)
944 {
946 NioSi< typename vctStoreBackBinaryOperations<value_type>::Minimum >::
947 Run(*this, upperBound);
948 return *this;
949 }
950
951 /* documented above */
952 inline ThisType & ClipBelow(const value_type lowerBound)
953 {
955 NioSi< typename vctStoreBackBinaryOperations<value_type>::Maximum >::
956 Run(*this, lowerBound);
957 return *this;
958 }
959
960 /* documented above */
961 inline ThisType & operator += (const value_type scalar)
962 {
963 return this->Add(scalar);
964 }
965
966 /* documented above */
967 inline ThisType & operator -= (const value_type scalar)
968 {
969 return this->Subtract(scalar);
970 }
971
972 /* documented above */
973 inline ThisType & operator *= (const value_type scalar)
974 {
975 return this->Multiply(scalar);
976 }
977
978 /* documented above */
979 inline ThisType & operator /= (const value_type scalar)
980 {
981 return this->Divide(scalar);
982 }
983
984
985
986 template <class __nArrayOwnerType>
987 inline ThisType & AddProductOf(const value_type scalar,
989 {
991 NioSiNi<typename vctStoreBackBinaryOperations<value_type>::Addition,
993 Run(*this, scalar, otherNArray);
994
995 return *this;
996 }
997
998
999 template <class __nArrayOwnerType1, class __nArrayOwnerType2>
1002 {
1004 NioNiNi<typename vctStoreBackBinaryOperations<value_type>::Addition,
1006 Run(*this, nArray1, nArray2);
1007
1008 return *this;
1009 }
1010
1011
1015
1024 template <class __nArrayOwnerType>
1026 {
1028 NoNi<typename vctUnaryOperations<value_type>::AbsValue>::
1029 Run(*this, otherNArray);
1030 return *this;
1031 }
1032
1033 /* documented above */
1034 template <class __nArrayOwnerType>
1036 {
1038 NoNi<typename vctUnaryOperations<value_type>::Negation>::
1039 Run(*this, otherNArray);
1040 return *this;
1041 }
1042
1043 /* documented above */
1044 template <class __nArrayOwnerType>
1046 {
1048 NoNi<typename vctUnaryOperations<value_type>::Floor>::
1049 Run(*this, otherNArray);
1050 return *this;
1051 }
1052
1053 /* documented above */
1054 template <class __nArrayOwnerType>
1056 {
1058 NoNi<typename vctUnaryOperations<value_type>::Ceil>::
1059 Run(*this, otherNArray);
1060 return *this;
1061 }
1062
1064
1068
1075 inline ThisType & AbsSelf(void)
1076 {
1078 Nio<typename vctStoreBackUnaryOperations<value_type>::MakeAbs>::
1079 Run(*this);
1080 return *this;
1081 }
1082
1083 /* documented above */
1084 inline ThisType & NegationSelf(void)
1085 {
1087 Nio<typename vctStoreBackUnaryOperations<value_type>::MakeNegation>::
1088 Run(*this);
1089 return *this;
1090 }
1091
1092 /* documented above */
1093 inline ThisType & FloorSelf(void)
1094 {
1096 Nio<typename vctStoreBackUnaryOperations<value_type>::MakeFloor>::
1097 Run(*this);
1098 return *this;
1099 }
1100
1101 /* documented above */
1102 inline ThisType & CeilSelf(void)
1103 {
1105 Nio<typename vctStoreBackUnaryOperations<value_type>::MakeCeil>::
1106 Run(*this);
1107 return *this;
1108 }
1109
1110};
1111
1112
1113#endif // _vctDynamicNArrayBase_h
Returns the product of the two InputType object.
Definition vctBinaryOperations.h:116
Definition vctForwardDeclarations.h:171
Dynamic nArray referencing existing memory (const).
Definition vctDynamicConstNArrayRef.h:91
Definition vctDynamicNArrayBase.h:41
BaseType::ConstSubarrayRefType ConstSubarrayRefType
Definition vctDynamicNArrayBase.h:69
ThisType & AddProductOf(const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:987
ThisType & ElementwiseRatioOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition vctDynamicNArrayBase.h:602
ThisType & SumOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
Definition vctDynamicNArrayBase.h:743
ThisType & ClippedAboveOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type lowerBound)
Definition vctDynamicNArrayBase.h:787
ThisType & ElementwiseProductOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition vctDynamicNArrayBase.h:591
ThisType & ClipAbove(const value_type upperBound)
Definition vctDynamicNArrayBase.h:943
const_pointer Pointer(const nsize_type &indices) const
Definition vctDynamicNArrayBase.h:160
ThisType & NegationSelf(void)
Definition vctDynamicNArrayBase.h:1084
const_reference at(const nsize_type &coordinates) const CISST_THROW(std
Definition vctDynamicNArrayBase.h:212
reverse_iterator rbegin(void)
Definition vctDynamicNArrayBase.h:117
ThisType & Add(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:653
ThisType & DifferenceOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition vctDynamicNArrayBase.h:580
const_reverse_iterator rend(void) const
Definition vctDynamicNArrayBase.h:136
const_reverse_iterator rbegin(void) const
Definition vctDynamicNArrayBase.h:123
BaseType::PermutationRefType PermutationRefType
Definition vctDynamicNArrayBase.h:77
const_reference Element(const nsize_type &coordinates) const
Definition vctDynamicNArrayBase.h:245
ThisType & Subtract(const value_type scalar)
Definition vctDynamicNArrayBase.h:916
const OwnerType & Owner(void) const
Definition vctDynamicNArrayBase.h:143
ConstPermutationRefType Permutation(const ndimension_type &dimensions) const
Definition vctDynamicNArrayBase.h:289
SliceRefType operator[](size_type index)
Definition vctDynamicNArrayBase.h:320
iterator end(void)
Definition vctDynamicNArrayBase.h:104
ThisType & ClippedAboveOf(const value_type upperBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition vctDynamicNArrayBase.h:870
ThisType & RatioOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
Definition vctDynamicNArrayBase.h:776
OwnerType::reverse_iterator reverse_iterator
Definition vctDynamicNArrayBase.h:62
ThisType & DifferenceOf(const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition vctDynamicNArrayBase.h:837
value_type SetAll(const value_type value)
Definition vctDynamicNArrayBase.h:337
ThisType & Assign(const value_type *elements)
Definition vctDynamicNArrayBase.h:426
ThisType & operator/=(const value_type scalar)
Definition vctDynamicNArrayBase.h:979
ThisType & SumOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition vctDynamicNArrayBase.h:569
ConstSliceRefType operator[](size_type index) const
Definition vctDynamicNArrayBase.h:327
ThisType & Multiply(const value_type scalar)
Definition vctDynamicNArrayBase.h:925
ThisType & ElementwiseDivide(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:683
ThisType & ElementwiseMaxOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition vctDynamicNArrayBase.h:624
SliceRefType Slice(dimension_type dimension, size_type index)
Definition vctDynamicNArrayBase.h:303
OwnerType::const_reverse_iterator const_reverse_iterator
Definition vctDynamicNArrayBase.h:63
ThisType & Divide(const value_type scalar)
Definition vctDynamicNArrayBase.h:934
ThisType & ProductOf(const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition vctDynamicNArrayBase.h:848
ThisType & operator-=(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:720
ThisType & ElementwiseMax(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:703
iterator begin(void)
Definition vctDynamicNArrayBase.h:91
ThisType & AddElementwiseProductOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition vctDynamicNArrayBase.h:1000
ThisType & SumOf(const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition vctDynamicNArrayBase.h:826
ThisType & ClippedBelowOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type upperBound)
Definition vctDynamicNArrayBase.h:798
ThisType & Subtract(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:663
const_pointer Pointer(void) const
Definition vctDynamicNArrayBase.h:174
ThisType & NegationOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:1035
OwnerType & Owner(void)
Definition vctDynamicNArrayBase.h:146
ThisType & ClipBelow(const value_type lowerBound)
Definition vctDynamicNArrayBase.h:952
ThisType & ClippedBelowOf(const value_type lowerBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition vctDynamicNArrayBase.h:881
ThisType & ForceAssign(const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
Definition vctDynamicNArrayBase.h:477
ThisType & AbsOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:1025
ThisType & CeilSelf(void)
Definition vctDynamicNArrayBase.h:1102
pointer Pointer(const nsize_type &indices)
Definition vctDynamicNArrayBase.h:154
vctDynamicNArrayOwner< _elementType, _dimension > OwnerType
Definition vctDynamicNArrayBase.h:54
ConstSubarrayRefType Subarray(const nsize_type &startPosition, const nsize_type &lengths) const
Definition vctDynamicNArrayBase.h:267
reference at(size_type metaIndex) CISST_THROW(std
Definition vctDynamicNArrayBase.h:184
BaseType::ConstPermutationRefType ConstPermutationRefType
Definition vctDynamicNArrayBase.h:76
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
ThisType & Assign(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &other)
Definition vctDynamicNArrayBase.h:370
reverse_iterator rend(void)
Definition vctDynamicNArrayBase.h:130
ConstSliceRefType Slice(dimension_type dimension, size_type index) const
Definition vctDynamicNArrayBase.h:310
const_iterator end(void) const
Definition vctDynamicNArrayBase.h:110
ThisType & operator=(const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
Definition vctDynamicNArrayBase.h:401
bool FastCopyOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &source, bool performSafetyChecks=true) CISST_THROW(std
Definition vctDynamicNArrayBase.h:543
ThisType & ProductOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
Definition vctDynamicNArrayBase.h:765
ThisType & FloorSelf(void)
Definition vctDynamicNArrayBase.h:1093
const_iterator begin(void) const
Definition vctDynamicNArrayBase.h:97
reference Element(const nsize_type &coordinates)
Definition vctDynamicNArrayBase.h:239
bool Zeros(void)
Definition vctDynamicNArrayBase.h:354
ThisType & DifferenceOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
Definition vctDynamicNArrayBase.h:754
vctDynamicConstNArrayBase< vctDynamicNArrayOwner< _elementType, _dimension >, _elementType, _dimension > BaseType
Definition vctDynamicNArrayBase.h:51
PermutationRefType Permutation(const ndimension_type &dimensions)
Definition vctDynamicNArrayBase.h:280
ThisType & ElementwiseMultiply(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:673
BaseType::ConstSliceRefType ConstSliceRefType
Definition vctDynamicNArrayBase.h:84
ThisType & AbsSelf(void)
Definition vctDynamicNArrayBase.h:1075
reference at(const nsize_type &coordinates) CISST_THROW(std
Definition vctDynamicNArrayBase.h:204
ThisType & FloorOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:1045
ThisType & operator+=(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:713
ThisType & RatioOf(const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
Definition vctDynamicNArrayBase.h:859
ThisType & Assign(const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
Definition vctDynamicNArrayBase.h:391
const_reference at(size_type metaIndex) const CISST_THROW(std
Definition vctDynamicNArrayBase.h:193
ThisType & operator*=(const value_type scalar)
Definition vctDynamicNArrayBase.h:973
reference operator()(const nsize_type &coordinates) CISST_THROW(std
Definition vctDynamicNArrayBase.h:220
ThisType & ElementwiseMinOf(const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
Definition vctDynamicNArrayBase.h:613
ThisType & CeilOf(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:1055
ThisType & ElementwiseMin(const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Definition vctDynamicNArrayBase.h:693
ThisType & Add(const value_type scalar)
Definition vctDynamicNArrayBase.h:907
SubarrayRefType Subarray(const nsize_type &startPosition, const nsize_type &lengths)
Definition vctDynamicNArrayBase.h:257
VCT_NARRAY_TRAITS_TYPEDEFS(_dimension)
Container class for the dynamic nArray engines.
Definition vctDynamicNArrayLoopEngines.h:42
vctVarStrideNArrayConstIterator< ThisType, false > const_reverse_iterator
Definition vctDynamicNArrayOwner.h:52
vctVarStrideNArrayIterator< ThisType, true > iterator
Definition vctDynamicNArrayOwner.h:49
vctVarStrideNArrayConstIterator< ThisType, true > const_iterator
Definition vctDynamicNArrayOwner.h:50
vctVarStrideNArrayIterator< ThisType, false > reverse_iterator
Definition vctDynamicNArrayOwner.h:51
@ DIMENSION
Definition vctDynamicNArrayOwner.h:43
void SubarrayOf(vctDynamicNArrayBase< __ownerType, _elementType, DIMENSION > &otherNArray, const nsize_type &startPosition, const nsize_type &lengths)
Definition vctDynamicNArrayRef.h:202
void PermutationOf(vctDynamicNArrayBase< __ownerType, _elementType, DIMENSION > &otherNArray, const ndimension_type &dimensions)
Definition vctDynamicNArrayRef.h:218
static bool NArrayCopy(_destinationNArrayType &destination, const _sourceNArrayType &source, bool performSafetyChecks)
Definition vctFastCopy.h:284
Define unary operations on an object as classes.
Definition vctUnaryOperations.h:56
#define CISST_THROW(exceptionParameter)
Somewhat portable compilation warning message. This works with very recent versions of gcc (4....
Definition cmnPortability.h:559
STL namespace.
size_type size(void) const
Definition vctDynamicConstMatrixBase.h:228
bool IsCompact(void) const
Definition vctDynamicConstMatrixBase.h:641
const nsize_type & sizes(void) const
Definition vctDynamicConstMatrixBase.h:233
const nstride_type & strides(void) const
Definition vctDynamicConstMatrixBase.h:258
void ThrowUnlessValidIndex(size_type index) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:171
bool FastCopyCompatible(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &source) const
Definition vctDynamicConstMatrixBase.h:677
Declaration of vctDynamicConstNArrayBase.
dimension_type dimension(void) const
Definition vctDynamicConstNArrayBase.h:331
OwnerType NArray
Definition vctDynamicConstNArrayBase.h:226
Declaration of vctStoreBackBinaryOperations.
Declaration of vctStoreBackUnaryOperations.