DGtal  1.2.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Friends
DGtal::PointVector< dim, TEuclideanRing, TContainer > Class Template Reference

Aim: Implements basic operations that will be used in Point and Vector classes. More...

#include <DGtal/kernel/PointVector.h>

Inheritance diagram for DGtal::PointVector< dim, TEuclideanRing, TContainer >:
[legend]

Public Types

enum  NormType { L_2 , L_1 , L_infty }
 
typedef PointVector< dim, TEuclideanRing, TContainer > Self
 Self type. More...
 
typedef TEuclideanRing Component
 Type for Vector elements. More...
 
typedef Component Coordinate
 Type for Point elements. More...
 
typedef NumberTraits< Component >::UnsignedVersion UnsignedComponent
 Unsigned version of the components. More...
 
typedef DGtal::Dimension Dimension
 Copy of the dimension type. More...
 
typedef Component Scalar
 Types needed by CLinearAlgebraContainer. More...
 
typedef Dimension Index
 
typedef TContainer Container
 Copy of the container type. More...
 
typedef Container::iterator Iterator
 Mutable iterator type. More...
 
typedef Container::const_iterator ConstIterator
 Constant iterator type. More...
 
typedef Container::reverse_iterator ReverseIterator
 Mutable reverse iterator type. More...
 
typedef Container::const_reverse_iterator ConstReverseIterator
 Constant reverse iterator type. More...
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CEuclideanRing< TEuclideanRing >))
 
 PointVector ()
 Constructor. More...
 
 PointVector (const Component *ptrValues)
 Constructor from array of values. More...
 
 PointVector (const Component &x, const Component &y)
 Constructor from two values (the Dimension of the vector should be at least 2). Other components are set to 0. More...
 
 PointVector (const Component &x, const Component &y, const Component &z)
 Constructor from three values (the Dimension of the vector should be at least 3). Other components are set to 0. More...
 
 PointVector (const Component &x, const Component &y, const Component &z, const Component &t)
 Constructor from four values (the Dimension of the vector should be at least 4). Other components are set to 0. More...
 
 PointVector (std::initializer_list< Component > init)
 Constructor from initializer list. More...
 
template<typename LeftComponent , typename LeftStorage , typename RightComponent , typename RightStorage , typename BinaryFunctor >
 PointVector (const PointVector< dim, LeftComponent, LeftStorage > &apoint1, const PointVector< dim, RightComponent, RightStorage > &apoint2, const BinaryFunctor &f)
 Constructor taking two points and a functor as parameters. More...
 
template<typename OtherComponent , typename OtherStorage , typename UnaryFunctor >
 PointVector (const PointVector< dim, OtherComponent, OtherStorage > &apoint1, const UnaryFunctor &f)
 Constructor taking a point and a unary functor as parameters. More...
 
 ~PointVector ()
 Destructor. More...
 
 PointVector (const Self &other)
 Copy constructor. More...
 
template<typename OtherComponent , typename OtherCont , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
 PointVector (const PointVector< dim, OtherComponent, OtherCont > &other)
 Copy constructor from another component PointVector. More...
 
template<typename OtherComponent , typename OtherCont , typename std::enable_if< ! std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
 PointVector (const PointVector< dim, OtherComponent, OtherCont > &other)
 Copy constructor from another component PointVector. More...
 
Selfoperator= (const Self &pv)
 Assignement Operator. More...
 
template<typename OtherComponent , typename OtherContainer , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
Selfoperator= (const PointVector< dim, OtherComponent, OtherContainer > &v)
 Assignment operator from PointVector with different component type. More...
 
template<typename OtherComponent , typename OtherContainer , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
SelfpartialCopy (const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions)
 Partial copy of a given PointVector. More...
 
template<typename OtherComponent , typename OtherContainer , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
SelfpartialCopyInv (const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions)
 Partial copy of a given PointVector. More...
 
template<typename OtherComponent , typename OtherContainer , typename UnaryFunctor >
SelfpartialCopy (const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions, const UnaryFunctor &f)
 Partial copy of a given PointVector using a functor. More...
 
template<typename OtherComponent , typename OtherContainer , typename UnaryFunctor >
SelfpartialCopyInv (const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions, const UnaryFunctor &f)
 Partial copy of a given PointVector using a functor. More...
 
template<typename OtherComponent , typename OtherContainer >
bool partialEqual (const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions) const
 Partial equality. More...
 
template<typename OtherComponent , typename OtherContainer >
bool partialEqualInv (const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions) const
 Partial inverse equality. More...
 
Iterator begin ()
 
Iterator end ()
 
ConstIterator begin () const
 
ConstIterator end () const
 
ReverseIterator rbegin ()
 
ReverseIterator rend ()
 
ConstReverseIterator rbegin () const
 
ConstReverseIterator rend () const
 
const Componentdata () const noexcept
 
Componentdata () noexcept
 
Dimension rows () const
 
const Componentoperator[] (Dimension i) const
 
const Componentoperator() (Dimension i) const
 
Componentoperator[] (Dimension i)
 
Componentoperator() (Dimension i)
 
template<typename OtherComponent , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVectoroperator+= (OtherComponent coeff)
 Adds the coeff scalar number to *this. More...
 
template<typename OtherComponent , typename OtherStorage , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVectoroperator+= (PointVector< dim, OtherComponent, OtherStorage > const &v)
 Adds the v vector/point to *this, componentwise. More...
 
template<typename OtherComponent , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVectoroperator-= (OtherComponent coeff)
 Subtracts the coeff scalar number to *this. More...
 
template<typename OtherComponent , typename OtherStorage , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVectoroperator-= (PointVector< dim, OtherComponent, OtherStorage > const &v)
 Subtracts the v vector/point to *this, componentwise. More...
 
template<typename OtherComponent , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVectoroperator*= (OtherComponent coeff)
 Multiplies *this by the coeff scalar number. More...
 
template<typename OtherComponent , typename OtherStorage , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVectoroperator*= (PointVector< dim, OtherComponent, OtherStorage > const &v)
 Multiplies *this by the v vector/point, componentwise. More...
 
template<typename OtherComponent , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVectoroperator/= (OtherComponent coeff)
 Divides *this by the coeff scalar number. More...
 
template<typename OtherComponent , typename OtherStorage , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVectoroperator/= (PointVector< dim, OtherComponent, OtherStorage > const &v)
 Divides *this by the v vector/point, componentwise. More...
 
Self operator- () const
 Unary minus operator. More...
 
template<typename OtherComponent , typename OtherStorage >
auto dot (const PointVector< dim, OtherComponent, OtherStorage > &v) const -> decltype(DGtal::dotProduct(*this, v))
 Dot product with a PointVector. More...
 
template<typename OtherComponent , typename OtherStorage >
auto crossProduct (const PointVector< dim, OtherComponent, OtherStorage > &v) const -> decltype(DGtal::crossProduct(*this, v))
 Cross product with a PointVector. More...
 
template<typename OtherComponent , typename OtherStorage >
double cosineSimilarity (const PointVector< dim, OtherComponent, OtherStorage > &v) const
 Positive angle between two vectors, deduced from their scalar product. More...
 
template<typename OtherComponent , typename OtherStorage >
auto inf (const PointVector< dim, OtherComponent, OtherStorage > &aPoint) const -> decltype(DGtal::inf(*this, aPoint))
 Implements the infimum (or greatest lower bound). More...
 
template<typename OtherComponent , typename OtherStorage >
auto sup (const PointVector< dim, OtherComponent, OtherStorage > &aPoint) const -> decltype(DGtal::sup(*this, aPoint))
 Implements the supremum (or least upper bound). More...
 
template<typename OtherComponent , typename OtherStorage >
bool isLower (const PointVector< dim, OtherComponent, OtherStorage > &p) const
 Return true if this point is below a given point. More...
 
template<typename OtherComponent , typename OtherStorage >
bool isUpper (const PointVector< dim, OtherComponent, OtherStorage > &p) const
 Return true if this point is upper a given point. More...
 
Component max () const
 
Component min () const
 
Iterator maxElement ()
 
Iterator minElement ()
 
void negate ()
 
double norm (const NormType type=L_2) const
 
double squaredNorm () const
 
UnsignedComponent norm1 () const
 
UnsignedComponent normInfinity () const
 
PointVector< dim, double, std::array< double, dim > > getNormalized () const
 
void reset ()
 Resets all the values to zero. More...
 
void clear ()
 Resets all the values to zero. More...
 
std::string className () const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Static Public Member Functions

static Dimension size ()
 
static Self diagonal (Component val=1)
 
static Self base (Dimension k, Component val=1)
 

Static Public Attributes

static const Dimension dimension = dim
 Copy of the static dimension of the Point/Vector. More...
 
static Self zero
 Static const for zero PointVector. More...
 

Protected Attributes

Container myArray
 Internal data-structure: std::array with constant size. More...
 

Friends

template<DGtal::Dimension otherDim, typename TOtherEuclideanRing , typename TOtherContainer >
class PointVector
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool operator== (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
 Equality operator between two Points/Vectors. More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool operator!= (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
 Difference operator on Points/Vectors. More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool operator< (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
 Comparison operator on Points/Vectors (LesserThan). More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool operator<= (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
 Comparison operator on Points/Vectors (LesserOrEqualThan). More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool operator>= (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
 Comparison operator on Points/Vectors (GreaterOrEqualThan). More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto operator+ (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Addition operator between two Points/Vectors. More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto operator- (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Subtraction operator between two Points/Vectors. More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto operator* (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Multiplication operator between two Points/Vectors. More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto operator/ (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Division operator between two Points/Vectors. More...
 
template<DGtal::Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightScalar >
auto operator+ (DGtal::PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, RightScalar const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Addition operator between a Point/Vector and a scalar. More...
 
template<Dimension ptDim, typename LeftScalar , typename RightEuclideanRing , typename RightContainer >
auto operator+ (LeftScalar const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Addition operator between a scalar and a Point/Vector. More...
 
template<DGtal::Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightScalar >
auto operator- (DGtal::PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, RightScalar const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Subtraction operator between a Point/Vector and a scalar. More...
 
template<Dimension ptDim, typename LeftScalar , typename RightEuclideanRing , typename RightContainer >
auto operator- (LeftScalar const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Substraction operator between a scalar and a Point/Vector. More...
 
template<DGtal::Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightScalar >
auto operator* (DGtal::PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, RightScalar const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Multiplication operator between a Point/Vector and a scalar. More...
 
template<Dimension ptDim, typename LeftScalar , typename RightEuclideanRing , typename RightContainer >
auto operator* (LeftScalar const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Multiplication operator between a scalar and a Point/Vector. More...
 
template<DGtal::Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightScalar >
auto operator/ (DGtal::PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, RightScalar const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Division operator between a Point/Vector and a scalar. More...
 
template<Dimension ptDim, typename LeftScalar , typename RightEuclideanRing , typename RightContainer >
auto operator/ (LeftScalar const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Division operator between a scalar and a Point/Vector. More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
DGtal::ArithmeticConversionType< LeftEuclideanRing, RightEuclideanRing > dotProduct (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
 Dot product between two points/vectors. More...
 
template<typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto crossProduct (PointVector< 3, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< 3, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Cross product of two 3D Points/Vectors. More...
 
template<typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
PointVector< 3, DGtal::ArithmeticConversionType< LeftEuclideanRing, RightEuclideanRing > > crossProduct (PointVector< 2, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< 2, RightEuclideanRing, RightContainer > const &rhs)
 Cross product of two 2D Points/Vectors. More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
double cosineSimilarity (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
 Positive angle between two vectors, deduced from their scalar product. More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto inf (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Implements the infimum (or greatest lower bound). More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto sup (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
 Implements the supremum (or least upper bound). More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool isLower (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
 Return true if the first point is below the second point. More...
 
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool isUpper (PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
 Return true if the first point is upper the second point. More...
 

Detailed Description

template<DGtal::Dimension dim, typename TEuclideanRing, typename TContainer>
class DGtal::PointVector< dim, TEuclideanRing, TContainer >

Aim: Implements basic operations that will be used in Point and Vector classes.

Description of class 'PointVector'

A PointVector may represent either a symbolic point or a symbolic vector depending on the context. The coordinates of the point or the components of the vector should be part of a ring. For performance reasons, these two types are just aliases. The user should take care how to use it depending on the context. For instance, adding two points has no meaning, but will be authorized by the compiler.

Template Parameters
dimstatic constant of type DGtal::Dimension that specifies the static dimension of the space and thus the number of elements of the Point or Vector.
TEuclideanRingspeficies the number type assoicated to an Euclidean domain (or Euclidean ring) algebraic structure (commutative unitary ring with no zero divisors and with a division operator but not necessarily an inverse for the multiplication operator). This type is used to represent PointVector elements (Coordinate for Point and Component for Vector) and define operations on Point or Vectors.
TContainerspecifies the container to be used to store the point coordinates. At this point, such container must be a random access bidirectionnal a-la STL containers (e.g. vector, boost/array). If TContainer implements comparison operators == != < <= > <=, then PointVector will also implements it and with the exact same behaviour.

All operations involving PointVector, and some of its methods, follow the classical arithmetic conversion rules. More precisely, if an operation involves two component types T and U, then the result will have the type of T() + U() as component type, that is the last of T and U in the following conversion chain:

int8_t -> uint8_t -> int16_t -> uint16_t -> int32_t -> uint32_t -> int64_t -> uint64_t -> float -> double -> long double.
boost::int64_t int64_t
signed 94-bit integer.
Definition: BasicTypes.h:74
boost::uint32_t uint32_t
unsigned 32-bit integer.
Definition: BasicTypes.h:63
boost::uint16_t uint16_t
unsigned 16-bit integer.
Definition: BasicTypes.h:61
boost::uint8_t uint8_t
unsigned 8-bit integer.
Definition: BasicTypes.h:59
boost::uint64_t uint64_t
unsigned 64-bit integer.
Definition: BasicTypes.h:65
boost::int32_t int32_t
signed 32-bit integer.
Definition: BasicTypes.h:72
boost::int8_t int8_t
signed 8-bit integer.
Definition: BasicTypes.h:68
boost::int16_t int16_t
signed 16-bit integer.
Definition: BasicTypes.h:70

A consequence is that if the result is stored in a PointVector whose component type has lower rank than the result type in the conversion chain above, then it will result in a compilation error. This behavior is designed to avoid unwanted conversions that may lead to loss of precision.

This constraint can be dodged by using one of the conversion constructor (explicitly or along with a conversion functor) or equivalent methods.

See also
ArithmeticConversionTraits
https://en.cppreference.com/w/cpp/language/operator_arithmetic#Conversions

For example, dividing a PointVector with integer components by an integer uses the Euclidean division and returns a PointVector with higher integer component type. On the other hand, dividing a PointVector with integer components by a double will use classical division on real numbers and returns a PointVector with double component type.

PointVector also realizes the concept CLattice with an infimum (meet, greatest lower bound) and a supremum (join, least upper bound) operation.

Usage example:

...
typedef PointVector<5, int> VectorD5;
VectorD5 p, q, r;
p[1] = 2; // p = {0, 2, 0, 0, 0}
q[3] = -5 // q = {0, 0, 0, -5, 0}
r = p + q ; // r = {0, 2, 0, -5, 0}
...

PointVector is a model of CBidirectionalRange.

See also
testPointVector.cpp
Examples
images/extract2DImagesFrom3D.cpp, images/extract2DImagesFrom3DandVisu.cpp, and io/viewers/viewer3D-8bis-2Dimages.cpp.

Definition at line 592 of file PointVector.h.

Member Typedef Documentation

◆ Component

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef TEuclideanRing DGtal::PointVector< dim, TEuclideanRing, TContainer >::Component

Type for Vector elements.

Definition at line 614 of file PointVector.h.

◆ ConstIterator

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef Container::const_iterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::ConstIterator

Constant iterator type.

Definition at line 641 of file PointVector.h.

◆ ConstReverseIterator

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef Container::const_reverse_iterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::ConstReverseIterator

Constant reverse iterator type.

Definition at line 643 of file PointVector.h.

◆ Container

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef TContainer DGtal::PointVector< dim, TEuclideanRing, TContainer >::Container

Copy of the container type.

Definition at line 633 of file PointVector.h.

◆ Coordinate

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef Component DGtal::PointVector< dim, TEuclideanRing, TContainer >::Coordinate

Type for Point elements.

Definition at line 617 of file PointVector.h.

◆ Dimension

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef DGtal::Dimension DGtal::PointVector< dim, TEuclideanRing, TContainer >::Dimension

Copy of the dimension type.

Definition at line 623 of file PointVector.h.

◆ Index

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef Dimension DGtal::PointVector< dim, TEuclideanRing, TContainer >::Index

Definition at line 630 of file PointVector.h.

◆ Iterator

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef Container::iterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::Iterator

Mutable iterator type.

Copy of the Container iterator types

Definition at line 640 of file PointVector.h.

◆ ReverseIterator

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef Container::reverse_iterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::ReverseIterator

Mutable reverse iterator type.

Definition at line 642 of file PointVector.h.

◆ Scalar

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef Component DGtal::PointVector< dim, TEuclideanRing, TContainer >::Scalar

Types needed by CLinearAlgebraContainer.

Definition at line 629 of file PointVector.h.

◆ Self

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef PointVector<dim, TEuclideanRing, TContainer> DGtal::PointVector< dim, TEuclideanRing, TContainer >::Self

Self type.

We cannot check the TContainer since boost::array is not a model of boost::RandomAccessContainer

Definition at line 611 of file PointVector.h.

◆ UnsignedComponent

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
typedef NumberTraits<Component>::UnsignedVersion DGtal::PointVector< dim, TEuclideanRing, TContainer >::UnsignedComponent

Unsigned version of the components.

Definition at line 620 of file PointVector.h.

Member Enumeration Documentation

◆ NormType

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
enum DGtal::PointVector::NormType

Specify the set of norm types

Enumerator
L_2 
L_1 
L_infty 

Definition at line 1493 of file PointVector.h.

Constructor & Destructor Documentation

◆ PointVector() [1/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( )

Constructor.

◆ PointVector() [2/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( const Component ptrValues)
explicit

Constructor from array of values.

Parameters
ptrValuesthe array of values.
Note
this constructor is explicit to avoid unwanted conversion from pointers.

◆ PointVector() [3/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( const Component x,
const Component y 
)

Constructor from two values (the Dimension of the vector should be at least 2). Other components are set to 0.

Parameters
xthe first value.
ythe second value.

◆ PointVector() [4/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( const Component x,
const Component y,
const Component z 
)

Constructor from three values (the Dimension of the vector should be at least 3). Other components are set to 0.

Parameters
xthe first value.
ythe second value.
zthe third value.

◆ PointVector() [5/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( const Component x,
const Component y,
const Component z,
const Component t 
)

Constructor from four values (the Dimension of the vector should be at least 4). Other components are set to 0.

Parameters
xthe first value.
ythe second value.
zthe third value.
tthe fourth value.

◆ PointVector() [6/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( std::initializer_list< Component init)

Constructor from initializer list.

Parameters
initthe initializer list.

◆ PointVector() [7/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename LeftComponent , typename LeftStorage , typename RightComponent , typename RightStorage , typename BinaryFunctor >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( const PointVector< dim, LeftComponent, LeftStorage > &  apoint1,
const PointVector< dim, RightComponent, RightStorage > &  apoint2,
const BinaryFunctor &  f 
)

Constructor taking two points and a functor as parameters.

The new point is initialized by the result of functor f applied for each pair of coordinates of apoint1 and apoint2

◆ PointVector() [8/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage , typename UnaryFunctor >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( const PointVector< dim, OtherComponent, OtherStorage > &  apoint1,
const UnaryFunctor &  f 
)

Constructor taking a point and a unary functor as parameters.

The new point is initialized by the result of functor f for each coordinate of apoint1

◆ ~PointVector()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::~PointVector ( )

Destructor.

◆ PointVector() [9/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( const Self other)

Copy constructor.

Parameters
otherthe object to clone.

◆ PointVector() [10/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherCont , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( const PointVector< dim, OtherComponent, OtherCont > &  other)

Copy constructor from another component PointVector.

Parameters
otherthe object to clone.
Warning
This constructor is implicitly available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector).

◆ PointVector() [11/11]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherCont , typename std::enable_if< ! std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
DGtal::PointVector< dim, TEuclideanRing, TContainer >::PointVector ( const PointVector< dim, OtherComponent, OtherCont > &  other)
explicit

Copy constructor from another component PointVector.

Parameters
otherthe object to clone.
Warning
This constructor must be explicitly specified if the conversion from OtherComponent to Component breaks the classical arithmetic rules in arithmetic context (see the doc of PointVector).

Member Function Documentation

◆ base()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
static Self DGtal::PointVector< dim, TEuclideanRing, TContainer >::base ( Dimension  k,
Component  val = 1 
)
static
Parameters
kany number between 0 and Dimension-1.
valany value.
Returns
the [k]-th base vector (0,0, ..., 0, val, 0, ..., 0).

◆ begin() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Iterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::begin ( )

PointVector begin() iterator.

Returns
an Iterator on the first element of a Point/Vector.

Referenced by DGtal::Shortcuts< TKSpace >::saveVectorFieldOBJ(), DGtal::HyperRectDomain< TSpace >::size(), and TEST_CASE().

◆ begin() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
ConstIterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::begin ( ) const

PointVector begin() const iterator.

Returns
an ConstIterator on the first element of a Point/Vector.

◆ BOOST_CONCEPT_ASSERT()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
DGtal::PointVector< dim, TEuclideanRing, TContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CEuclideanRing< TEuclideanRing >)  )

◆ className()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
std::string DGtal::PointVector< dim, TEuclideanRing, TContainer >::className ( ) const
Returns
the style name used for drawing this object.

Referenced by exampleUpdate(), main(), and testDisplayDT3d().

◆ clear()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
void DGtal::PointVector< dim, TEuclideanRing, TContainer >::clear ( )
inline

Resets all the values to zero.

Note
Needed by CLinearAlgebraContainer.

Definition at line 1551 of file PointVector.h.

1551 { reset(); }
void reset()
Resets all the values to zero.

References DGtal::PointVector< dim, TEuclideanRing, TContainer >::reset().

◆ cosineSimilarity()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage >
double DGtal::PointVector< dim, TEuclideanRing, TContainer >::cosineSimilarity ( const PointVector< dim, OtherComponent, OtherStorage > &  v) const
inline

Positive angle between two vectors, deduced from their scalar product.

Parameters
vany vector
Returns
the angle between *this and v in [0,pi].

Referenced by TEST_CASE().

◆ crossProduct()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage >
auto DGtal::PointVector< dim, TEuclideanRing, TContainer >::crossProduct ( const PointVector< dim, OtherComponent, OtherStorage > &  v) const -> decltype(DGtal::crossProduct(*this, v))
inline

Cross product with a PointVector.

Parameters
va vector that is cross-producted to *this.
Returns
the cross product (3D vector for 3D input, scalar for 2D input) in the best Euclidean ring accordingly to the C++ conversion rules in arithmetic operations context.
Warning
Only available in 3D and 2D (return the 3th component of the corresponding cross produt in 3D).
See also
DGtal::crossProduct

Referenced by DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::addEdgeConstraint(), DGtal::detail::BoundedRationalPolytopeSpecializer< 3, TInteger >::addEdgeConstraint(), DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::crossProduct(), DGtal::detail::BoundedRationalPolytopeSpecializer< 3, TInteger >::crossProduct(), DGtal::Shortcuts< TKSpace >::getPrimalVertices(), DGtal::Shortcuts< TKSpace >::saveVectorFieldOBJ(), and TEST_CASE().

◆ data() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
const Component* DGtal::PointVector< dim, TEuclideanRing, TContainer >::data ( ) const
inlinenoexcept

PointVector data() (const and non-const) access to raw data of a std container

Returns
container.data()

◆ data() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Component* DGtal::PointVector< dim, TEuclideanRing, TContainer >::data ( )
inlinenoexcept

PointVector data() (const and non-const) access to raw data of a std container

Returns
container.data()

◆ diagonal()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
static Self DGtal::PointVector< dim, TEuclideanRing, TContainer >::diagonal ( Component  val = 1)
static

◆ dot()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage >
auto DGtal::PointVector< dim, TEuclideanRing, TContainer >::dot ( const PointVector< dim, OtherComponent, OtherStorage > &  v) const -> decltype(DGtal::dotProduct(*this, v))
inline

Dot product with a PointVector.

Parameters
va vector that is dot-producted to *this.
Returns
the dot product in the best Euclidean ring accordingly to the C++ conversion rules in arithmetic operations context.
See also
DGtal::dotProduct

Referenced by DGtal::ConvexHullCommonKernel< dim, TCoordinateInteger, TInternalInteger >::compute(), DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::computeHalfSpace(), DGtal::ConvexHullCommonKernel< dim, TCoordinateInteger, TInternalInteger >::dot(), laplacian(), LSF(), main(), naiveConvexHull(), and TEST_CASE().

◆ end() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Iterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::end ( )

PointVector end() iterator.

Returns
an Iterator on the last element of a Point/Vector.

Referenced by DGtal::Shortcuts< TKSpace >::saveVectorFieldOBJ(), DGtal::HyperRectDomain< TSpace >::size(), and TEST_CASE().

◆ end() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
ConstIterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::end ( ) const

PointVector end() const iterator.

Returns
a ConstIterator on the last element of a Point/Vector.

◆ getNormalized()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
PointVector<dim, double, std::array<double,dim> > DGtal::PointVector< dim, TEuclideanRing, TContainer >::getNormalized ( ) const

Compute the normalization of a given vector (*this) and return a unitary vector on double.

Returns
a unitary vector with double as coordiante type.
Advanced:
the point container is forced to std::array<double,dim>
Examples
tutorial-examples/AreaSurfaceEstimation-final.cpp.

Referenced by main(), testBallQuad(), and testQuadNorm().

◆ inf()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage >
auto DGtal::PointVector< dim, TEuclideanRing, TContainer >::inf ( const PointVector< dim, OtherComponent, OtherStorage > &  aPoint) const -> decltype(DGtal::inf(*this, aPoint))
inline

Implements the infimum (or greatest lower bound).

It means the point whose coordinates are exactly the minimum of the two points coordinate by coordinate.

Parameters
aPointany point.
Returns
a new point (with best Euclidean ring type accordingly to the C++ conversion rules) being the inf between *this and apoint.
See also
isLower

Referenced by TEST_CASE().

◆ isLower()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage >
bool DGtal::PointVector< dim, TEuclideanRing, TContainer >::isLower ( const PointVector< dim, OtherComponent, OtherStorage > &  p) const

Return true if this point is below a given point.

Parameters
pany point.
Returns
true if this is below p (ie. this == inf(this,p))
Note
faster than computing the infimum and compare it afterwards.

Referenced by DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::ArrayImageAdapter(), DGtal::HyperRectDomain< TSpace >::ConstSubRange::begin(), and TEST_CASE().

◆ isUpper()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage >
bool DGtal::PointVector< dim, TEuclideanRing, TContainer >::isUpper ( const PointVector< dim, OtherComponent, OtherStorage > &  p) const

Return true if this point is upper a given point.

Parameters
pany point.
Returns
true if this is upper p (ie. this == sup(this,p))
Note
faster than computing the supremum and compare it afterwards.

Referenced by DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::ArrayImageAdapter(), and TEST_CASE().

◆ isValid()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
bool DGtal::PointVector< dim, TEuclideanRing, TContainer >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ max()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Component DGtal::PointVector< dim, TEuclideanRing, TContainer >::max ( ) const

Return the maximum component value of a point/vector.

Returns
the maximum value.

Referenced by TEST_CASE().

◆ maxElement()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Iterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::maxElement ( )

Return the iterator on the component with maximim value of a point/vector.

Returns
an iterator.

Referenced by TEST_CASE().

◆ min()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Component DGtal::PointVector< dim, TEuclideanRing, TContainer >::min ( ) const

Return the minimum component value of a point/vector.

Returns
the minimum value.

Referenced by TEST_CASE().

◆ minElement()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Iterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::minElement ( )

Return the iterator on the component with minimum value of a point/vector.

Returns
an iterator.

Referenced by TEST_CASE().

◆ negate()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
void DGtal::PointVector< dim, TEuclideanRing, TContainer >::negate ( )

Negates this vector.

◆ norm()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
double DGtal::PointVector< dim, TEuclideanRing, TContainer >::norm ( const NormType  type = L_2) const

Computes the norm of a point/vector.

Warning
This method performs a conversion from the type T to double for each components to compute the norms. For exact norms (restricted to L_1 and L_infinity norms), please refer to PointVector::norm1 and PointVector::normInfinity.
Parameters
typespecifies the type of norm to consider (see NormType).
Returns
the norm of the point/vector as a double.

Referenced by laplacian(), main(), DGtal::TangentFromDSS3DFunctor< DSS, LambdaFunction >::operator()(), DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::Point2DEmbedderIn3D(), and signed_dist_to_unit_circle().

◆ norm1()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
UnsignedComponent DGtal::PointVector< dim, TEuclideanRing, TContainer >::norm1 ( ) const

Computes the 1-norm of a vector.

Returns
the absolute sum of the components of this vector.

◆ normInfinity()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
UnsignedComponent DGtal::PointVector< dim, TEuclideanRing, TContainer >::normInfinity ( ) const

Computes the infinity-norm of a vector.

Returns
the maximum absolute value of the components of this vector.

◆ operator()() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Component& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator() ( Dimension  i)
inline

Definition at line 1015 of file PointVector.h.

1015 { return (*this)[i]; }

◆ operator()() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
const Component& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator() ( Dimension  i) const
inline

Definition at line 1004 of file PointVector.h.

1004 { return (*this)[i]; }

◆ operator*=() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVector& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator*= ( OtherComponent  coeff)
inline

Multiplies *this by the coeff scalar number.

Returns
a reference on 'this'.
Warning
This operator is available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider converting the right-hand-side before.

◆ operator*=() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVector& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator*= ( PointVector< dim, OtherComponent, OtherStorage > const &  v)
inline

Multiplies *this by the v vector/point, componentwise.

Returns
a reference on 'this'.
Warning
This operator is available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider converting the right-hand-side before.

◆ operator+=() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVector& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator+= ( OtherComponent  coeff)
inline

Adds the coeff scalar number to *this.

Returns
a reference on 'this'.
Warning
This operator is available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider converting the right-hand-side before.

◆ operator+=() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVector& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator+= ( PointVector< dim, OtherComponent, OtherStorage > const &  v)
inline

Adds the v vector/point to *this, componentwise.

Returns
a reference on 'this'.
Warning
This operator is available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider converting the right-hand-side before.

◆ operator-()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Self DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator- ( ) const
inline

Unary minus operator.

-Vector => Vector

Returns
a new Vector that is the opposite of 'this', i.e. -'this'.

◆ operator-=() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVector& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator-= ( OtherComponent  coeff)
inline

Subtracts the coeff scalar number to *this.

Returns
a reference on 'this'.
Warning
This operator is available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider converting the right-hand-side before.

◆ operator-=() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVector& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator-= ( PointVector< dim, OtherComponent, OtherStorage > const &  v)
inline

Subtracts the v vector/point to *this, componentwise.

Returns
a reference on 'this'.
Warning
This operator is available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider converting the right-hand-side before.

◆ operator/=() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVector& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator/= ( OtherComponent  coeff)
inline

Divides *this by the coeff scalar number.

Returns
a reference on 'this'.
Warning
This operator is available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider converting the right-hand-side before.

◆ operator/=() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
PointVector& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator/= ( PointVector< dim, OtherComponent, OtherStorage > const &  v)
inline

Divides *this by the v vector/point, componentwise.

Returns
a reference on 'this'.
Warning
This operator is available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider converting the right-hand-side before.

◆ operator=() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherContainer , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
Self& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator= ( const PointVector< dim, OtherComponent, OtherContainer > &  v)

Assignment operator from PointVector with different component type.

Parameters
vis the Point that gets copied to *this.
Returns
a reference on 'this'.
Warning
Available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider converting the source point before assignment.

◆ operator=() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Self& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator= ( const Self pv)

Assignement Operator.

Parameters
pvthe object to copy.
Returns
a reference on 'this'.

◆ operator[]() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Component& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator[] ( Dimension  i)

Returns a non-const reference to the i-th element of the vector.

Precondition
The i index must lie between 0 and size() .
Parameters
iis the index of the retrieved coefficient.

◆ operator[]() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
const Component& DGtal::PointVector< dim, TEuclideanRing, TContainer >::operator[] ( Dimension  i) const

Returns the i-th coefficient of the vector.

Precondition
The i index must lie between 0 and size() .
Parameters
iis the index of the retrieved coefficient.

◆ partialCopy() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherContainer , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
Self& DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialCopy ( const PointVector< dim, OtherComponent, OtherContainer > &  pv,
const std::vector< Dimension > &  dimensions 
)

Partial copy of a given PointVector.

Only coordinates in dimensions are copied.

Template Parameters
OtherComponentComponent type of the point to copy from.
OtherContainerStorage type of the point to copy from.
Parameters
pvthe object to copy.
dimensionsthe dimensions of v to copy (Size between 0 and N, all differents).
Returns
a reference on 'this'.
Warning
Available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider using the version that accepts a functor.

Referenced by TEST_CASE(), and testIterator().

◆ partialCopy() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherContainer , typename UnaryFunctor >
Self& DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialCopy ( const PointVector< dim, OtherComponent, OtherContainer > &  pv,
const std::vector< Dimension > &  dimensions,
const UnaryFunctor &  f 
)

Partial copy of a given PointVector using a functor.

Only coordinates in dimensions are copied.

Template Parameters
OtherComponentComponent type of the point to copy from.
OtherContainerStorage type of the point to copy from.
UnaryFunctorType of the functor applied to copied values.
Parameters
pvthe object to copy.
dimensionsthe dimensions of v to copy (Size between 0 and N, all differents).
fthe functor applied to copied values.
Returns
a reference on 'this'.

◆ partialCopyInv() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherContainer , typename std::enable_if< std::is_same< Component, ArithmeticConversionType< Component, OtherComponent > >::value, int >::type = 0>
Self& DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialCopyInv ( const PointVector< dim, OtherComponent, OtherContainer > &  pv,
const std::vector< Dimension > &  dimensions 
)

Partial copy of a given PointVector.

Only coordinates not in dimensions are copied.

Template Parameters
OtherComponentComponent type of the point to copy from.
OtherContainerStorage type of the point to copy from.
Parameters
pvthe object to copy.
dimensionsthe dimensions of v to copy (Size between 0 and N, all differents).
Returns
a reference on 'this'.
Warning
Available only if the conversion from OtherComponent to Component follows the classical arithmetic rules in arithmetic context (see the doc of PointVector). Otherwise, consider using the version that accepts a functor.

Referenced by DGtal::HyperRectDomain< TSpace >::ConstSubRange::ConstSubRange(), and TEST_CASE().

◆ partialCopyInv() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherContainer , typename UnaryFunctor >
Self& DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialCopyInv ( const PointVector< dim, OtherComponent, OtherContainer > &  pv,
const std::vector< Dimension > &  dimensions,
const UnaryFunctor &  f 
)

Partial copy of a given PointVector using a functor.

Only coordinates not in dimensions are copied.

Template Parameters
OtherComponentComponent type of the point to copy from.
OtherContainerStorage type of the point to copy from.
UnaryFunctorType of the functor applied to copied values.
Parameters
pvthe object to copy.
dimensionsthe dimensions of v to copy (Size between 0 and N, all differents).
fthe functor applied to copied values.
Returns
a reference on 'this'.

◆ partialEqual()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherContainer >
bool DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialEqual ( const PointVector< dim, OtherComponent, OtherContainer > &  pv,
const std::vector< Dimension > &  dimensions 
) const

Partial equality.

Only coordinates in dimensions are compared.

Template Parameters
OtherComponentComponent type of the point to compare with.
OtherContainerStorage type of the point to compare with.
Parameters
pvPoint/Vector to compare to this.
dimensionsDimensions along which to compare the points.
Returns
true iff points are equal for given dimensions .

◆ partialEqualInv()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherContainer >
bool DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialEqualInv ( const PointVector< dim, OtherComponent, OtherContainer > &  pv,
const std::vector< Dimension > &  dimensions 
) const

Partial inverse equality.

Only coordinates not in dimensions are compared.

Template Parameters
OtherComponentComponent type of the point to compare with.
OtherContainerStorage type of the point to compare with.
Parameters
pvPoint/Vector to compare to this.
dimensionsDimensions along which to compare the points.
Returns
true iff points are equal for dimensions not in dimensions.

◆ rbegin() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
ReverseIterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::rbegin ( )

PointVector rbegin() reverse iterator.

Returns
a ReverseIterator on the first element of a Point/Vector.

◆ rbegin() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
ConstReverseIterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::rbegin ( ) const

PointVector rbegin() const reverse iterator.

Returns
an ConstReverseIterator on the first element of a Point/Vector.

◆ rend() [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
ReverseIterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::rend ( )

PointVector rend() reverse iterator.

Returns
a ReverseIterator on the last element of a Point/Vector.

◆ rend() [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
ConstReverseIterator DGtal::PointVector< dim, TEuclideanRing, TContainer >::rend ( ) const

PointVector rend() const reverse iterator.

Returns
a ConstReverseIterator on the last element of a Point/Vector.

◆ reset()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
void DGtal::PointVector< dim, TEuclideanRing, TContainer >::reset ( )

Resets all the values to zero.

Referenced by DGtal::PointVector< dim, TEuclideanRing, TContainer >::clear().

◆ rows()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Dimension DGtal::PointVector< dim, TEuclideanRing, TContainer >::rows ( ) const
inline

Definition at line 994 of file PointVector.h.

994 { return dim; }
unsigned int dim(const Vector &z)

References dim().

◆ selfDisplay()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
void DGtal::PointVector< dim, TEuclideanRing, TContainer >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ size()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
static Dimension DGtal::PointVector< dim, TEuclideanRing, TContainer >::size ( )
static

◆ squaredNorm()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
double DGtal::PointVector< dim, TEuclideanRing, TContainer >::squaredNorm ( ) const

Computes the square L2 norm of a point/vector.

Warning
This method performs a conversion from the type T to double for each components to compute the norms.
Returns
the squared norm of the point/vector as a double.

◆ sup()

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename OtherComponent , typename OtherStorage >
auto DGtal::PointVector< dim, TEuclideanRing, TContainer >::sup ( const PointVector< dim, OtherComponent, OtherStorage > &  aPoint) const -> decltype(DGtal::sup(*this, aPoint))
inline

Implements the supremum (or least upper bound).

It means the point whose coordinates are exactly the maximum of the two points coordinate by coordinate.

Parameters
aPointany point.
Returns
a new point (with best Euclidean ring type accordingly to the C++ conversion rules) being the sup between *this and apoint.
See also
isUpper

Referenced by TEST_CASE().

Friends And Related Function Documentation

◆ cosineSimilarity

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
double cosineSimilarity ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
)
friend

Positive angle between two vectors, deduced from their scalar product.

Returns
the angle between lhs and rhs in [0,pi].

◆ crossProduct [1/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
PointVector<3, DGtal::ArithmeticConversionType<LeftEuclideanRing, RightEuclideanRing> > crossProduct ( PointVector< 2, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< 2, RightEuclideanRing, RightContainer > const &  rhs 
)
friend

Cross product of two 2D Points/Vectors.

Returns
the 3th component of the cross product of the two points/vectors embedded in 3D.

◆ crossProduct [2/2]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto crossProduct ( PointVector< 3, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< 3, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Cross product of two 3D Points/Vectors.

Returns
a 3D point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ dotProduct

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
DGtal::ArithmeticConversionType<LeftEuclideanRing, RightEuclideanRing> dotProduct ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
)
friend

Dot product between two points/vectors.

Returns
the dot product in the best Euclidean ring accordingly to the C++ conversion rules in arithmetic operations context.

◆ inf

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto inf ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Implements the infimum (or greatest lower bound).

It means the point whose coordinates are exactly the minimum of the two points coordinate by coordinate.

Returns
a new point (with best Euclidean ring type accordingly to the C++ conversion rules) being the inf between lhs and rhs;
See also
isLower

◆ isLower

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool isLower ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
)
friend

Return true if the first point is below the second point.

Returns
true if lhs is below rhs (ie. lhs == inf(lhs,rhs))
Note
faster than computing the infimum and compare it afterwards.

◆ isUpper

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool isUpper ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
)
friend

Return true if the first point is upper the second point.

Returns
true if lhs is upper rhs (ie. lhs == sup(lhs,rhs))
Note
faster than computing the supremum and compare it afterwards.

◆ operator!=

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool operator!= ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
)
friend

Difference operator on Points/Vectors.

Returns
true iff the two points differ, false otherwise.

◆ operator* [1/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<DGtal::Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightScalar >
auto operator* ( DGtal::PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
RightScalar const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Multiplication operator between a Point/Vector and a scalar.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator* [2/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftScalar , typename RightEuclideanRing , typename RightContainer >
auto operator* ( LeftScalar const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Multiplication operator between a scalar and a Point/Vector.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator* [3/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto operator* ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Multiplication operator between two Points/Vectors.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator+ [1/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<DGtal::Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightScalar >
auto operator+ ( DGtal::PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
RightScalar const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Addition operator between a Point/Vector and a scalar.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator+ [2/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftScalar , typename RightEuclideanRing , typename RightContainer >
auto operator+ ( LeftScalar const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Addition operator between a scalar and a Point/Vector.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator+ [3/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto operator+ ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Addition operator between two Points/Vectors.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator- [1/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<DGtal::Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightScalar >
auto operator- ( DGtal::PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
RightScalar const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Subtraction operator between a Point/Vector and a scalar.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator- [2/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftScalar , typename RightEuclideanRing , typename RightContainer >
auto operator- ( LeftScalar const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Substraction operator between a scalar and a Point/Vector.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator- [3/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto operator- ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Subtraction operator between two Points/Vectors.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator/ [1/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<DGtal::Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightScalar >
auto operator/ ( DGtal::PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
RightScalar const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Division operator between a Point/Vector and a scalar.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator/ [2/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftScalar , typename RightEuclideanRing , typename RightContainer >
auto operator/ ( LeftScalar const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Division operator between a scalar and a Point/Vector.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator/ [3/3]

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto operator/ ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Division operator between two Points/Vectors.

Returns
a point/vector with best component type accordingly to the C++ conversion rules in arithmetic operations context.

◆ operator<

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool operator< ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
)
friend

Comparison operator on Points/Vectors (LesserThan).

Returns
true iff lhs < rhs, false otherwise.
Note
It uses the lexicographical order.

◆ operator<=

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool operator<= ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
)
friend

Comparison operator on Points/Vectors (LesserOrEqualThan).

Returns
true iff lhs <= rhs, false otherwise.
Note
It uses the lexicographical order.

◆ operator==

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool operator== ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
)
friend

Equality operator between two Points/Vectors.

Returns
true iff the two points are equal.

◆ operator>=

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
bool operator>= ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
)
friend

Comparison operator on Points/Vectors (GreaterOrEqualThan).

Returns
true iff lhs >= rhs, false otherwise.
Note
It uses the lexicographical order.

◆ PointVector

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<DGtal::Dimension otherDim, typename TOtherEuclideanRing , typename TOtherContainer >
friend class PointVector
friend

Definition at line 600 of file PointVector.h.

◆ sup

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
template<Dimension ptDim, typename LeftEuclideanRing , typename LeftContainer , typename RightEuclideanRing , typename RightContainer >
auto sup ( PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &  lhs,
PointVector< ptDim, RightEuclideanRing, RightContainer > const &  rhs 
) -> decltype(DGtal::constructFromArithmeticConversion(lhs, rhs))
friend

Implements the supremum (or least upper bound).

It means the point whose coordinates are exactly the maximum of the two points coordinate by coordinate.

Returns
a new point (with best Euclidean ring type accordingly to the C++ conversion rules) being the sup between *this and apoint.
See also
isUpper

Field Documentation

◆ dimension

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
const Dimension DGtal::PointVector< dim, TEuclideanRing, TContainer >::dimension = dim
static

Copy of the static dimension of the Point/Vector.

Definition at line 626 of file PointVector.h.

Referenced by DGtal::ImplicitRoundedHyperCube< TSpace >::operator()().

◆ myArray

template<DGtal::Dimension dim, typename TEuclideanRing , typename TContainer >
Container DGtal::PointVector< dim, TEuclideanRing, TContainer >::myArray
protected

Internal data-structure: std::array with constant size.

Definition at line 1601 of file PointVector.h.

◆ zero

template<Dimension dim, typename Component , typename TC >
PointVector< dim, Component, TC > DGtal::PointVector< dim, Component, TC >::zero
static

The documentation for this class was generated from the following file: