@@ -33,7 +33,7 @@ namespace itk
3333 * type held at each pixel in an Image or at each vertex of an Mesh.
3434 * The template parameter T can be any data type that behaves like a
3535 * primitive (or atomic) data type (int, short, float, complex).
36- * The NVectorDimension defines the number of components in the vector array.
36+ * The VVectorDimension defines the number of components in the vector array.
3737 *
3838 * CovariantVector is not a dynamically extendible array like std::vector. It is
3939 * intended to be used like a mathematical vector.
@@ -65,13 +65,13 @@ namespace itk
6565 * \endsphinx
6666 */
6767
68- template <typename T, unsigned int NVectorDimension = 3 >
69- class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimension >
68+ template <typename T, unsigned int VVectorDimension = 3 >
69+ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, VVectorDimension >
7070{
7171public:
7272 /* * Standard class type aliases. */
7373 using Self = CovariantVector;
74- using Superclass = FixedArray<T, NVectorDimension >;
74+ using Superclass = FixedArray<T, VVectorDimension >;
7575
7676 /* * ValueType can be used to declare a variable that is the same type
7777 * as a data element held in an CovariantVector. */
@@ -82,19 +82,19 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
8282 using ComponentType = T;
8383
8484 /* * Dimension of the Space */
85- static constexpr unsigned int Dimension = NVectorDimension ;
85+ static constexpr unsigned int Dimension = VVectorDimension ;
8686
8787 /* * I am a covariant vector. */
8888 using CovariantVectorType = Self;
8989
9090 /* * The Array type from which this CovariantVector is derived. */
91- using BaseArray = FixedArray<T, NVectorDimension >;
91+ using BaseArray = FixedArray<T, VVectorDimension >;
9292
9393 /* * Get the dimension (size) of the vector. */
9494 static unsigned int
9595 GetCovariantVectorDimension ()
9696 {
97- return NVectorDimension ;
97+ return VVectorDimension ;
9898 }
9999
100100 /* * Set a vnl_vector_ref referencing the same memory block. */
@@ -127,7 +127,7 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
127127 /* * Pass-through constructor for the Array base class. Implicit casting is
128128 * performed to initialize constructor from any another one of datatype. */
129129 template <typename TVectorValueType>
130- CovariantVector (const CovariantVector<TVectorValueType, NVectorDimension > & r)
130+ CovariantVector (const CovariantVector<TVectorValueType, VVectorDimension > & r)
131131 : BaseArray(r)
132132 {}
133133 CovariantVector (const ValueType r[Dimension])
@@ -137,22 +137,22 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
137137 /* * Assignment operator with implicit casting from another data type */
138138 template <typename TCovariantVectorValueType>
139139 Self &
140- operator =(const CovariantVector<TCovariantVectorValueType, NVectorDimension > & r)
140+ operator =(const CovariantVector<TCovariantVectorValueType, VVectorDimension > & r)
141141 {
142142 BaseArray::operator =(r);
143143 return *this ;
144144 }
145145
146146 /* * Pass-through assignment operator for the Array base class. */
147147 CovariantVector &
148- operator =(const ValueType r[NVectorDimension ]);
148+ operator =(const ValueType r[VVectorDimension ]);
149149
150150 /* * Scalar operator*=. Scales elements by a scalar. */
151151 template <typename Tt>
152152 inline const Self &
153153 operator *=(const Tt & value)
154154 {
155- for (unsigned int i = 0 ; i < NVectorDimension ; ++i)
155+ for (unsigned int i = 0 ; i < VVectorDimension ; ++i)
156156 {
157157 (*this )[i] = static_cast <ValueType>((*this )[i] * value);
158158 }
@@ -164,7 +164,7 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
164164 const Self &
165165 operator /=(const Tt & value)
166166 {
167- for (unsigned int i = 0 ; i < NVectorDimension ; ++i)
167+ for (unsigned int i = 0 ; i < VVectorDimension ; ++i)
168168 {
169169 (*this )[i] = static_cast <ValueType>((*this )[i] / value);
170170 }
@@ -200,15 +200,15 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
200200
201201 /* * operator*. Performs the scalar product with a vector (contravariant).
202202 * This scalar product is invariant under affine transformations */
203- ValueType operator *(const Vector<T, NVectorDimension > & other) const ;
203+ ValueType operator *(const Vector<T, VVectorDimension > & other) const ;
204204
205205 /* * Scalar operator*. Scale the elements of a vector by a scalar.
206206 * Return a new vector. */
207207 inline Self operator *(const ValueType & val) const
208208 {
209209 Self result;
210210
211- for (unsigned int i = 0 ; i < NVectorDimension ; ++i)
211+ for (unsigned int i = 0 ; i < VVectorDimension ; ++i)
212212 {
213213 result[i] = static_cast <ValueType>((*this )[i] * val);
214214 }
@@ -223,7 +223,7 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
223223 {
224224 Self result;
225225
226- for (unsigned int i = 0 ; i < NVectorDimension ; ++i)
226+ for (unsigned int i = 0 ; i < VVectorDimension ; ++i)
227227 {
228228 result[i] = static_cast <ValueType>((*this )[i] / val);
229229 }
@@ -238,7 +238,7 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
238238 static unsigned int
239239 GetNumberOfComponents ()
240240 {
241- return NVectorDimension ;
241+ return VVectorDimension ;
242242 }
243243
244244 /* * Divides the covariant vector components by the norm and return the norm */
@@ -253,9 +253,9 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
253253 * Casting is done with C-Like rules */
254254 template <typename TCoordRepB>
255255 void
256- CastFrom (const CovariantVector<TCoordRepB, NVectorDimension > & pa)
256+ CastFrom (const CovariantVector<TCoordRepB, VVectorDimension > & pa)
257257 {
258- for (unsigned int i = 0 ; i < NVectorDimension ; ++i)
258+ for (unsigned int i = 0 ; i < VVectorDimension ; ++i)
259259 {
260260 (*this )[i] = static_cast <T>(pa[i]);
261261 }
@@ -264,17 +264,17 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
264264
265265/* * Premultiply Operator for product of a vector and a scalar.
266266 * CovariantVector< T, N > = T * CovariantVector< T,N > */
267- template <typename T, unsigned int NVectorDimension >
268- inline CovariantVector<T, NVectorDimension > operator *(const T & scalar, const CovariantVector<T, NVectorDimension > & v)
267+ template <typename T, unsigned int VVectorDimension >
268+ inline CovariantVector<T, VVectorDimension > operator *(const T & scalar, const CovariantVector<T, VVectorDimension > & v)
269269{
270270 return v.operator *(scalar);
271271}
272272
273273/* * Performs the scalar product of a covariant with a contravariant.
274274 * This scalar product is invariant under affine transformations */
275- template <typename T, unsigned int NVectorDimension >
276- inline T operator *(const Vector<T, NVectorDimension > & contravariant,
277- const CovariantVector<T, NVectorDimension > & covariant)
275+ template <typename T, unsigned int VVectorDimension >
276+ inline T operator *(const Vector<T, VVectorDimension > & contravariant,
277+ const CovariantVector<T, VVectorDimension > & covariant)
278278{
279279 return covariant.operator *(contravariant);
280280}
@@ -289,9 +289,9 @@ ITKCommon_EXPORT void
289289CrossProduct (CovariantVector<int , 3 >, const Vector<int , 3 > &, const Vector<int , 3 > &);
290290
291291
292- template <typename T, unsigned int NVectorDimension >
292+ template <typename T, unsigned int VVectorDimension >
293293inline void
294- swap (CovariantVector<T, NVectorDimension > & a, CovariantVector<T, NVectorDimension > & b)
294+ swap (CovariantVector<T, VVectorDimension > & a, CovariantVector<T, VVectorDimension > & b)
295295{
296296 a.swap (b);
297297}
0 commit comments