23 #include "vnl/vnl_vector_ref.h"
61 template<
typename T,
unsigned int NVectorDimension = 3 >
75 itkStaticConstMacro(
Dimension,
unsigned int, NVectorDimension);
113 #if !defined( ITK_LEGACY_FUTURE_REMOVE )
127 template<
typename TVectorValueType >
133 template<
typename TVectorValueType >
144 template<
typename Tt >
147 for (
unsigned int i = 0; i < NVectorDimension; i++ )
149 ( *this )[i] =
static_cast< ValueType >( ( *this )[i] * value );
156 template<
typename Tt >
159 for (
unsigned int i = 0; i < NVectorDimension; i++ )
161 ( *this )[i] =
static_cast< ValueType >( ( *this )[i] / value );
193 for (
unsigned int i = 0; i < NVectorDimension; i++ )
195 result[i] =
static_cast< ValueType >( ( *this )[i] * value );
202 template<
typename Tt >
207 for (
unsigned int i = 0; i < NVectorDimension; i++ )
209 result[i] =
static_cast< ValueType >( ( *this )[i] / value );
242 template<
typename TCoordRepB >
245 for (
unsigned int i = 0; i < NVectorDimension; i++ )
247 ( *this )[i] =
static_cast< T
>( pa[i] );
252 template<
typename TCoordRepB>
256 for (
unsigned int i = 0; i < NVectorDimension; i++)
258 r[i] =
static_cast<TCoordRepB
> ((*this)[i]);
267 template<
typename T,
unsigned int NVectorDimension >
269 Vector< T, NVectorDimension >
272 return v.operator*( scalar);
276 template<
typename T,
unsigned int NVectorDimension >
278 const Vector< T, NVectorDimension > & v);
281 template<
typename T,
unsigned int NVectorDimension >
283 Vector< T, NVectorDimension > & v);
288 ITKCommon_EXPORT Vector< float, 3 >
CrossProduct(
const Vector< float, 3 > &,
289 const Vector< float, 3 > &);
291 ITKCommon_EXPORT Vector< int, 3 >
CrossProduct(
const Vector< int, 3 > &,
292 const Vector< int, 3 > &);
295 #ifndef ITK_MANUAL_INSTANTIATION
296 #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)
vnl_vector_ref< T > GetVnlVector()
std::istream & operator>>(std::istream &is, Point< T, NPointDimension > &v)
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)
RealValueType Normalize()
FixedArray< T, NVectorDimension > Superclass
Simulate a standard C array with copy semnatics.
static unsigned int GetNumberOfComponents()
RealValueType GetSquaredNorm() const
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)
static unsigned int GetVectorDimension()
void SetNthComponent(int c, const ComponentType &v)
NumericTraits< ValueType >::RealType RealValueType
Self operator+(const Self &vec) const
RealValueType GetNorm() const
bool operator!=(const Self &v) const
const Self & operator*=(const Tt &value)
itkLegacyMacro(void Set_vnl_vector(const vnl_vector< T > &))