23 #include "vnl/vnl_vector_ref.h"
61 template<
typename T,
unsigned int NVectorDimension = 3 >
75 itkStaticConstMacro(
Dimension,
unsigned int, NVectorDimension);
90 void SetVnlVector(
const vnl_vector< T > &);
93 vnl_vector_ref< T > GetVnlVector();
96 vnl_vector< T > GetVnlVector()
const;
100 itkLegacyMacro(
void Set_vnl_vector(
const vnl_vector< T > &));
104 itkLegacyMacro(vnl_vector_ref< T > Get_vnl_vector(
void));
108 itkLegacyMacro(vnl_vector< T > Get_vnl_vector(
void)
const);
113 #if !defined( ITK_LEGACY_FUTURE_REMOVE )
118 Vector(
const ValueType & r);
123 explicit Vector(
const ValueType & r);
127 template<
typename TVectorValueType >
133 template<
typename TVectorValueType >
136 BaseArray::operator=(r);
141 Vector & operator=(
const ValueType r[NVectorDimension]);
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 );
168 const Self & operator+=(
const Self & vec);
171 const Self & operator-=(
const Self & vec);
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 );
225 RealValueType GetNorm()
const;
228 RealValueType GetSquaredNorm()
const;
235 RealValueType Normalize();
238 { this->operator[](c) = v; }
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"
Vector & operator=(const Vector< TVectorValueType, NVectorDimension > &r)
ConstNeighborhoodIterator< TImage > operator-(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
Vector(const ValueType r[Dimension])
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)
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
FixedArray< T, NVectorDimension > BaseArray
ConstNeighborhoodIterator< TImage > operator+(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
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)
const unsigned int Dimension
Vector(const Vector< TVectorValueType, NVectorDimension > &r)
static unsigned int GetVectorDimension()
void SetNthComponent(int c, const ComponentType &v)
NumericTraits< ValueType >::RealType RealValueType
bool operator!=(const Self &v) const
const Self & operator*=(const Tt &value)
bool ITKIOXML_EXPORT operator==(itk::FancyString &s, const std::string &)