23 #include "vnl/vnl_vector_ref.h"
61 template<
typename T,
unsigned int NVectorDimension = 3 >
75 static constexpr
unsigned int Dimension = NVectorDimension;
90 void SetVnlVector(
const vnl_vector< T > &);
93 vnl_vector_ref< T > GetVnlVector();
96 vnl_vector< T > GetVnlVector()
const;
107 #if !defined( ITK_LEGACY_FUTURE_REMOVE )
112 Vector(
const ValueType & r);
117 explicit Vector(
const ValueType & r);
121 template<
typename TVectorValueType >
127 template<
typename TVectorValueType >
130 BaseArray::operator=(r);
135 Vector & operator=(
const ValueType r[NVectorDimension]);
138 template<
typename Tt >
141 for (
unsigned int i = 0; i < NVectorDimension; i++ )
143 ( *this )[i] =
static_cast< ValueType >( ( *this )[i] * value );
150 template<
typename Tt >
153 for (
unsigned int i = 0; i < NVectorDimension; i++ )
155 ( *this )[i] =
static_cast< ValueType >( ( *this )[i] / value );
162 const Self & operator+=(
const Self & vec);
165 const Self & operator-=(
const Self & vec);
187 for (
unsigned int i = 0; i < NVectorDimension; i++ )
189 result[i] =
static_cast< ValueType >( ( *this )[i] * value );
196 template<
typename Tt >
201 for (
unsigned int i = 0; i < NVectorDimension; i++ )
203 result[i] =
static_cast< ValueType >( ( *this )[i] / value );
219 RealValueType GetNorm()
const;
222 RealValueType GetSquaredNorm()
const;
229 RealValueType Normalize();
232 { this->operator[](c) = v; }
236 template<
typename TCoordRepB >
239 for (
unsigned int i = 0; i < NVectorDimension; i++ )
241 ( *this )[i] =
static_cast< T
>( pa[i] );
246 template<
typename TCoordRepB>
250 for (
unsigned int i = 0; i < NVectorDimension; i++)
252 r[i] =
static_cast<TCoordRepB
> ((*this)[i]);
261 template<
typename T,
unsigned int NVectorDimension >
263 Vector< T, NVectorDimension >
266 return v.operator*( scalar);
270 template<
typename T,
unsigned int NVectorDimension >
272 const Vector< T, NVectorDimension > & v);
275 template<
typename T,
unsigned int NVectorDimension >
277 Vector< T, NVectorDimension > & v);
282 ITKCommon_EXPORT Vector< float, 3 >
CrossProduct(
const Vector< float, 3 > &,
283 const Vector< float, 3 > &);
285 ITKCommon_EXPORT Vector< int, 3 >
CrossProduct(
const Vector< int, 3 > &,
286 const Vector< int, 3 > &);
289 template<
typename T,
unsigned int NVectorDimension >
297 #ifndef ITK_MANUAL_INSTANTIATION
298 #include "itkVector.hxx"
void swap(FixedArray &other)
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
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])
Define numeric traits for std::vector.
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)
constexpr unsigned int Dimension
Simulate a standard C array with copy semnatics.
static unsigned int GetNumberOfComponents()
void swap(Array< T > &a, Array< T > &b)
A templated class holding a n-Dimensional vector.
bool operator==(const Self &v) const
ConstNeighborhoodIterator< TImage > operator+(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
typename NumericTraits< ValueType >::RealType RealValueType
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)
Vector(const Vector< TVectorValueType, NVectorDimension > &r)
static unsigned int GetVectorDimension()
void SetNthComponent(int c, const ComponentType &v)
bool operator!=(const Self &v) const
const Self & operator*=(const Tt &value)