34 #if defined(PointVector_RECURSES) 35 #error Recursive header files inclusion detected in PointVector.h 36 #else // defined(PointVector_RECURSES) 38 #define PointVector_RECURSES 40 #if !defined PointVector_h 53 #include "DGtal/base/Common.h" 54 #include "DGtal/base/CBidirectionalRange.h" 55 #include "DGtal/kernel/NumberTraits.h" 56 #include "DGtal/kernel/CEuclideanRing.h" 63 template<Dimension dim,
typename Container>
67 template<Dimension dim,
typename Container>
139 typename TEuclideanRing,
140 typename TContainer=std::array<TEuclideanRing,dim> >
196 explicit PointVector(
const Component* ptrValues );
205 PointVector(
const Component & x,
const Component & y );
215 PointVector(
const Component & x,
const Component & y,
const Component & z );
226 PointVector(
const Component & x,
const Component & y,
227 const Component & z,
const Component & t );
239 template<
typename BinaryFunctor>
240 PointVector(
const Self& apoint1,
const Self& apoint2,
241 const BinaryFunctor& f );
247 template<
typename UnaryFunctor>
249 const UnaryFunctor& f );
269 template <
typename OtherComponent,
typename OtherCont>
290 std::initializer_list<Dimension> dimensions);
302 std::initializer_list<Dimension> dimensions);
314 const std::vector<Dimension> &dimensions);
326 const std::vector<Dimension> &dimensions);
337 const std::vector<Dimension> &dimensions )
const;
348 const std::vector<Dimension> &dimensions )
const;
371 ConstIterator
begin()
const;
378 ConstIterator
end()
const;
392 ReverseIterator
rend();
399 ConstReverseIterator
rbegin()
const;
406 ConstReverseIterator
rend()
const;
414 static Dimension
size();
424 const Component&
operator[]( Dimension i )
const;
425 inline const Component&
operator()( Dimension i )
const {
return (*
this)[i]; }
471 bool operator< (
const Self & pv )
const;
493 bool operator> (
const Self & pv )
const;
530 Component
dot(
const Self &v)
const;
603 Self
operator/ (
const Self & v )
const ;
611 Self
operator/ (
const Component coeff )
const;
629 template<
typename AnotherComponent>
652 Self
inf(
const Self& apoint )
const;
663 Self
sup(
const Self& apoint )
const;
670 bool isLower(
const Self& p )
const;
677 bool isUpper(
const Self& p )
const;
684 Component
max()
const;
691 Component
min()
const;
738 UnsignedComponent
norm1()
const;
765 static Self
diagonal( Component val = 1 );
772 static Self
base( Dimension k, Component val = 1 );
809 template<Dimension dim,
typename Component,
typename TC>
811 operator<<( std::ostream & out, const PointVector<dim, Component, TC> & object );
822 template<Dimension dim,
typename Component,
typename Container>
829 template< Dimension dim,
typename Component,
typename TC>
837 #include "DGtal/kernel/PointVector.ih" 842 #endif // !defined PointVector_h 844 #undef PointVector_RECURSES 845 #endif // else defined(PointVector_RECURSES)
Self operator+(const Self &v) const
Self & operator+=(const Self &v)
Self & operator=(const Self &pv)
bool operator!=(const Self &pv) const
PointVector operator*(Component coeff) const
UnsignedComponent normInfinity() const
Container::reverse_iterator ReverseIterator
Self sup(const Self &apoint) const
static const Dimension dimension
Copy of the static dimension of the Point/Vector.
Component Coordinate
Type for Point elements.
static Self diagonal(Component val=1)
Component dot(const Self &v) const
std::bitset< dim > setDimensionsNotIn(const Container &dimensions)
DGtal::uint32_t Dimension
Self & partialCopy(const Self &pv, std::initializer_list< Dimension > dimensions)
PointVector< dim, double, std::array< double, dim > > getNormalized() const
bool isUpper(const Self &p) const
DGtal::Dimension Dimension
Copy of the dimension type.
Component Scalar
Types needed by CLinearAlgebraContainer.
UnsignedComponent norm1() const
Aim: Implements basic operations that will be used in Point and Vector classes.
TContainer Container
Copy of the container type.
K init(Point(0, 0, 0), Point(512, 512, 512), true)
bool operator<=(const Self &pv) const
bool partialEqual(const Self &pv, const std::vector< Dimension > &dimensions) const
bool operator==(const Self &pv) const
Aim: Defines the mathematical concept equivalent to a unitary commutative ring with a division operat...
Self inf(const Self &apoint) const
Self crossProduct(const Self &v) const
bool operator>(const Self &pv) const
const Component & operator()(Dimension i) const
double norm(const NormType type=L_2) const
double cosineSimilarity(const Self &v) const
PointVector< dim, TEuclideanRing, TContainer > Self
Self type.
BOOST_CONCEPT_ASSERT((concepts::CEuclideanRing< TEuclideanRing >))
NumberTraits< Component >::UnsignedVersion UnsignedComponent
Unsigned version of the components.
Container::const_iterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
Self & operator/=(const Self &v)
Container::const_reverse_iterator ConstReverseIterator
bool operator>=(const Self &pv) const
unsigned int dim(const Vector &z)
static Self base(Dimension k, Component val=1)
std::bitset< dim > setDimensionsIn(const Container &dimensions)
Self operator/(const Self &v) const
PointVector & operator*=(Component coeff)
const Component & operator[](Dimension i) const
Self & operator-=(const Self &v)
static Self zero
Static const for zero PointVector.
Container::iterator Iterator
bool partialEqualInv(const Self &pv, const std::vector< Dimension > &dimensions) const
bool isLower(const Self &p) const
Component & operator()(Dimension i)
std::string className() const
bool operator<(const Self &pv) const
Self & partialCopyInv(const Self &pv, std::initializer_list< Dimension > dimensions)
void selfDisplay(std::ostream &out) const
Container myArray
Internal data-structure: std::array with constant size.
TEuclideanRing Component
Type for Vector elements.