23 #include "vnl/vnl_vector_ref.h"
61 template<
typename T,
unsigned int NVectorDimension = 3 >
75 itkStaticConstMacro(
Dimension,
unsigned int, NVectorDimension);
117 template<
typename TVectorValueType >
123 template<
typename TVectorValueType >
134 template<
typename Tt >
137 for (
unsigned int i = 0; i < NVectorDimension; i++ )
139 ( *this )[i] =
static_cast< ValueType >( ( *this )[i] * value );
146 template<
typename Tt >
149 for (
unsigned int i = 0; i < NVectorDimension; i++ )
151 ( *this )[i] =
static_cast< ValueType >( ( *this )[i] / value );
183 for (
unsigned int i = 0; i < NVectorDimension; i++ )
185 result[i] =
static_cast< ValueType >( ( *this )[i] * value );
192 template<
typename Tt >
197 for (
unsigned int i = 0; i < NVectorDimension; i++ )
199 result[i] =
static_cast< ValueType >( ( *this )[i] / value );
231 template<
typename TCoordRepB >
234 for (
unsigned int i = 0; i < NVectorDimension; i++ )
236 ( *this )[i] =
static_cast< T
>( pa[i] );
241 template<
typename TCoordRepB>
245 for (
unsigned int i = 0; i < NVectorDimension; i++)
247 r[i] =
static_cast<TCoordRepB
> ((*this)[i]);
256 template<
typename T,
unsigned int NVectorDimension >
258 Vector< T, NVectorDimension >
261 return v.operator*( scalar);
265 template<
typename T,
unsigned int NVectorDimension >
267 const Vector< T, NVectorDimension > & v);
270 template<
typename T,
unsigned int NVectorDimension >
272 Vector< T, NVectorDimension > & v);
277 ITKCommon_EXPORT Vector< float, 3 >
CrossProduct(
const Vector< float, 3 > &,
278 const Vector< float, 3 > &);
280 ITKCommon_EXPORT Vector< int, 3 >
CrossProduct(
const Vector< int, 3 > &,
281 const Vector< int, 3 > &);
284 #ifndef ITK_MANUAL_INSTANTIATION
285 #include "itkVector.hxx"
ValueType operator*(const Self &vec) const
Vector & operator=(const Vector< TVectorValueType, NVectorDimension > &r)
const Self & operator+=(const Self &vec)
Vector(const ValueType r[Dimension])
bool operator==(const FixedArray &r) const
reference operator[](short index)
std::istream & operator>>(std::istream &is, Point< T, NPointDimension > &v)
vnl_vector_ref< T > GetVnlVector(void)
Self operator*(const ValueType &value) const
CovariantVector< T, NVectorDimension > operator*(const T &scalar, const CovariantVector< T, NVectorDimension > &v)
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
FixedArray< T, NVectorDimension > Superclass
Simulate a standard C array with copy semnatics.
static unsigned int GetNumberOfComponents()
A templated class holding a n-Dimensional vector.
bool operator==(const Self &v) const
static const unsigned int Dimension
FixedArray< T, NVectorDimension > BaseArray
const Self & operator/=(const Tt &value)
Self operator/(const Tt &value) const
ITKCommon_EXPORT void CrossProduct(CovariantVector< double, 3 > &, const Vector< double, 3 > &, const Vector< double, 3 > &)
void CastFrom(const Vector< TCoordRepB, NVectorDimension > &pa)
void SetVnlVector(const vnl_vector< T > &)
FixedArray & operator=(const FixedArray< TFixedArrayValueType, VLength > &r)
const Self & operator-=(const Self &vec)
Vector(const Vector< TVectorValueType, NVectorDimension > &r)
RealValueType GetNorm(void) const
RealValueType GetSquaredNorm(void) const
static unsigned int GetVectorDimension()
void SetNthComponent(int c, const ComponentType &v)
NumericTraits< ValueType >::RealType RealValueType
Self operator+(const Self &vec) const
bool operator!=(const Self &v) const
const Self & operator*=(const Tt &value)
itkLegacyMacro(void Set_vnl_vector(const vnl_vector< T > &))