23 #include "vnl/vnl_vector_ref.h"
61 template<
class T,
unsigned int NVectorDimension = 3 >
75 itkStaticConstMacro(
Dimension,
unsigned int, NVectorDimension);
115 template<
class TVectorValueType >
121 template<
class TVectorValueType >
135 for (
unsigned int i = 0; i < NVectorDimension; i++ )
137 ( *this )[i] =
static_cast< ValueType >( ( *this )[i] * value );
147 for (
unsigned int i = 0; i < NVectorDimension; i++ )
149 ( *this )[i] =
static_cast< ValueType >( ( *this )[i] / value );
181 for (
unsigned int i = 0; i < NVectorDimension; i++ )
183 result[i] =
static_cast< ValueType >( ( *this )[i] * value );
195 for (
unsigned int i = 0; i < NVectorDimension; i++ )
197 result[i] =
static_cast< ValueType >( ( *this )[i] / value );
229 template<
typename TCoordRepB >
232 for (
unsigned int i = 0; i < NVectorDimension; i++ )
234 ( *this )[i] =
static_cast< T
>( pa[i] );
239 template<
typename TCoordRepB>
243 for (
unsigned int i = 0; i < NVectorDimension; i++)
245 r[i] =
static_cast<TCoordRepB
> ((*this)[i]);
254 template<
class T,
unsigned int NVectorDimension >
256 Vector< T, NVectorDimension >
262 template<
class T,
unsigned int NVectorDimension >
264 const Vector< T, NVectorDimension > & v);
266 template<
class T,
unsigned int NVectorDimension >
268 Vector< T, NVectorDimension > & v);
270 ITKCommon_EXPORT Vector< double, 3 >
CrossProduct(
const Vector< double, 3 > &,
271 const Vector< double, 3 > &);
273 ITKCommon_EXPORT Vector< float, 3 >
CrossProduct(
const Vector< float, 3 > &,
274 const Vector< float, 3 > &);
276 ITKCommon_EXPORT Vector< int, 3 >
CrossProduct(
const Vector< int, 3 > &,
277 const Vector< int, 3 > &);
281 #define ITK_TEMPLATE_Vector(_, EXPORT, TypeX, TypeY) \
284 _( 2 ( class EXPORT Vector< ITK_TEMPLATE_2 TypeX > ) ) \
285 _( 1 ( EXPORT std::ostream & operator<<(std::ostream &, \
286 const Vector< ITK_TEMPLATE_2 TypeX > &) ) ) \
287 _( 1 ( EXPORT std::istream & operator>>(std::istream &, \
288 Vector< ITK_TEMPLATE_2 TypeX > &) ) ) \
289 namespace Templates \
291 typedef Vector< ITK_TEMPLATE_2 TypeX > Vector##TypeY; \
295 #if ITK_TEMPLATE_EXPLICIT
296 #include "Templates/itkVector+-.h"
310 #include "itkVector.hxx"