22 #include "itkNumericTraits.h"
23 #include <vnl/vnl_vector_ref.h>
57 template<
class T,
unsigned int NVectorDimension=3>
71 itkStaticConstMacro(
Dimension,
unsigned int, NVectorDimension);
84 {
return NVectorDimension; }
113 template<
class TVectorValueType >
118 template<
class TVectorValueType >
130 for(
unsigned int i=0; i<NVectorDimension; i++)
132 (*this)[i] =
static_cast< ValueType >((*this)[i] * value);
140 for(
unsigned int i=0; i<NVectorDimension; i++)
142 (*this)[i] =
static_cast< ValueType >((*this)[i] / value);
172 for(
unsigned int i=0; i<NVectorDimension; i++)
174 result[i] =
static_cast< ValueType >((*this)[i] * value);
184 for(
unsigned int i=0; i<NVectorDimension; i++)
186 result[i] =
static_cast< ValueType >((*this)[i] / value);
217 template <
typename TCoordRepB >
220 for(
unsigned int i=0; i<NVectorDimension; i++ )
222 (*this)[i] =
static_cast<T
>( pa[i] );
229 template<
class T,
unsigned int NVectorDimension >
231 Vector<T,NVectorDimension>
237 template<
class T,
unsigned int NVectorDimension >
239 const Vector<T,NVectorDimension> & v);
241 template<
class T,
unsigned int NVectorDimension >
243 Vector<T,NVectorDimension> & v);
246 const Vector<double,3> & );
249 const Vector<float,3> & );
252 const Vector<int,3> & );
258 #define ITK_TEMPLATE_Vector(_, EXPORT, x, y) namespace itk { \
259 _(2(class EXPORT Vector< ITK_TEMPLATE_2 x >)) \
260 _(1(EXPORT std::ostream& operator<<(std::ostream&, \
261 const Vector< ITK_TEMPLATE_2 x >&))) \
262 _(1(EXPORT std::istream& operator>>(std::istream&, \
263 Vector< ITK_TEMPLATE_2 x >&))) \
264 namespace Templates { typedef Vector< ITK_TEMPLATE_2 x > Vector##y; } \
267 #if ITK_TEMPLATE_EXPLICIT
268 # include "Templates/itkVector+-.h"
279 #include "itkNumericTraitsVectorPixel.h"