Class xlifepp::Point#

class Point : public std::vector<real_t>#

Inheritence diagram for xlifepp::Point:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="std::vector< T >" tooltip="std::vector< T >"] "2" [label="std::vector< real_t >" tooltip="std::vector< real_t >"] "1" [label="xlifepp::Point" tooltip="xlifepp::Point" fillcolor="#BFBFBF"] "2" -> "3" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::Point:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="std::vector< T >" tooltip="std::vector< T >"] "2" [label="std::vector< real_t >" tooltip="std::vector< real_t >"] "1" [label="xlifepp::Point" tooltip="xlifepp::Point" fillcolor="#BFBFBF"] "2" -> "3" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

holds point coordinates in any dimension

Class Point to hide vector<real_t> class to users (see e.g. Function) and holds point coordinates in any dimension. It is implemented as a child class to stl vector<real_t> and thus inherits of all member functions and algorithms of stl class ‘vector’.

Public Types

typedef real_t SepValueType#

useful typedef

Public Functions

inline Point()#

void constructor

Point(const dimen_t d, real_t *pt)#

constructor by dimension and real_t array

Point(const Point &pt)#

copy constructor

explicit Point(const real_t x1)#

1D constructor by coordinate

Point(const real_t x1, const real_t x2)#

2D constructor by coordinates

Point(const real_t x1, const real_t x2, const real_t x3)#

3D constructor by coordinates

Point(const std::vector<real_t> &pt)#

constructor from stl vector (not declared explicit to allow autocast)

Point(const std::vector<real_t> &pt, dimen_t d)#

constructor from stl vector with dimension management

Point(const std::vector<real_t>::const_iterator, dimen_t)#

constructor from stl vector iterator

inline real_t &coords(const dimen_t d)#

return the d-th coordinates ( 0 < d <= dim ) (read/write)

inline real_t coords(const dimen_t d) const#

return the d-th coordinates ( 0 < d <= dim ) (read)

inline dimen_t dim() const#

dimension of point

void dimError(const string_t &s, const dimen_t) const#

error message, the string is to tell in which function the error is detected

real_t distance(const Point&) const#

returns distance to another point

real_t &operator()(const dimen_t d)#

return the d-th coordinates ( 0 < d <= dim ) (read/write)

real_t operator()(const dimen_t d) const#

return the d-th coordinates ( 0 < d <= dim ) (read)

Point &operator*=(const real_t)#

scale the current point

Point &operator+=(const Point&)#

add a point to the current point

Point &operator+=(const real_t)#

add a constant point to the current point

Point &operator-=(const Point&)#

subtract a point to the current point

Point &operator-=(const real_t)#

subtract a constant point to the current point

Point &operator/=(const real_t)#

scale the current point

void print(std::ostream&) const#

print on output stream as (x, y, z)

void printRaw(std::ostream&) const#

print on output stream as x y z

void printTeX(std::ostream&) const#

prints, on stream os, the coordinates of the point for TeX exploitation;

Prints, on stream os, the coordinates of the point in fixed format, separated by commas, for TeX exploitation.

Point roundToZero(real_t aszero = 100. * theEpsilon) const#

round coordinates to zero

real_t squareDistance(const Point&) const#

returns square of distance to another point

string_t toString() const#

return coordinates as string (x1,x2,…)

inline std::vector<real_t> toVect()#

convert to a std::vector

inline real_t &x()#

return the first coordinate (read/write)

inline real_t x() const#

return the first coordinate (read)

inline real_t &y()#

return the second coordinate (read/write)

inline real_t y() const#

return the second coordinate (read)

inline real_t &z()#

return the third coordinate (read/write)

inline real_t z() const#

return the third coordinate (read)

Public Static Attributes

static real_t tolerance#

value of the tolerance used in equality test (theTolerance by default)

Friends

friend std::ostream &operator<<(std::ostream&, const Point&)#

ostream insert