36 #include <Eigen/Dense>
148 operator[] (const
CepsUInt &dim) const;
197 friend std::ostream &
198 operator<< (std::ostream &os, const
CepsVertex &vertex);
206 operator<< (std::ostream &os, const
CepsVertex &vertex);
size_t CepsSize
Size unsigned.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
float CepsReal
Need single precision floating point.
Eigen::Matrix< CepsScalar, 3, 1 > CepsMathVertex
Vertex, eigen format.
Eigen::Matrix< CepsScalar, 3, Eigen::Dynamic > CepsMathVertices
Array of vertices, eigen format.
CepsArray3< CepsReal > CepsReal3D
Three real scalars, used like this for compatibility in polynomials.
int32_t CepsInt
Need 32 bit integer.
CepsReal dotProduct(const CepsVertex &a, const CepsVertex &b, const CepsSize &dim=3)
Scalar product. dim restricts which components are used (1:(x), 2:(x,y), 3:(x,y,z))
CepsVertex(const CepsReal &x=0.0, const CepsReal &y=0.0, const CepsReal &z=0.0)
Constructor with coordinates.
void setX(const CepsReal &x)
Set vertex x coordinate.
CepsMathVertex getCoordinatesForEigen() const
Get three coordinates.
const CepsReal & x() const
Vertex x coordinate.
void setCoordinates(const CepsReal &x, const CepsReal &y=0., const CepsReal &z=0.)
Set the 3 coordinates at once.
CepsReal & getCoordinate(const CepsSize &dim)
Get coordinate of dimension 0 1 2, read & write.
CepsReal dot(const CepsVertex &other, const CepsSize &dim=3) const
Scalar product. dim restricts which components are used (1:(x), 2:(x,y), 3:(x,y,z))
CepsVertex(const CepsVertex &)=default
Copy constructor.
CepsVertex(CepsVertex &&) noexcept=default
Copy constructor.
void setY(const CepsReal &y)
Set vertex y coordinate.
void scale(const CepsReal &scaleFactor)
Scale all coordinates of this node.
const CepsReal & y() const
Vertex y coordinate.
void setCoordinate(const CepsUInt &dim, const CepsReal &coor)
Set the three coordinates.
CepsReal norm2(const CepsSize &dim=3) const
Euclidian norm of coordinates.
CepsReal normp(const CepsInt &p, const CepsSize &dim=3) const
Norm p (for p =-1, 1, 2, etc) with p=-1 gives the inf norm.
void setZ(const CepsReal &z)
Set vertex z coordinate.
const CepsReal & z() const
Vertex z coordinate.
CepsReal3D & getCoordinates()
Get three coordinates, read & write.
CepsBool equals(const CepsVertex &vert, const CepsReal &errorFactor=1.0)
Check for coordinates equality.