`point`

d-dimensional physical point or vector

# Description

The `point` defines a vertex or vector in the physical d-dimensional space, d=1,2,3. It is represented as an array of coordinates. The coordinate index starts at zero and finishes at `d-1`, e.g. `x[0]`, `x[1]` and `x[2]`.

The default constructor set all components to zero:

        point x;

and this default could be overridden:

        point x (1, 2, 3.14);

or alternatively:

        point x = {1, 2, 3.14};

The standard linear algebra for vectors is supported by the `point` class.

# Implementation

This documentation has been generated from file fem/geo_element/point.h

The `point` class is simply an alias to the `point_basic` class

typedef point_basic<Float> point;
rheolef::point
point_basic< Float > point
Definition: point.h:164

The `point_basic` class is a template class with the floating type as parameter:

template <class T>
class point_basic {
public:
// typedefs:
typedef size_t size_type;
typedef T element_type;
typedef T scalar_type;
typedef T float_type;
// allocators:
explicit point_basic();
explicit point_basic (const T& x0, const T& x1 = 0, const T& x2 = 0);
template <class T1>
point_basic<T>(const point_basic<T1>& p);
template <class T1>
point_basic<T>& operator= (const point_basic<T1>& p);
point_basic (const std::initializer_list<T>& il);
// accessors:
T& operator[](int i_coord) { return _x[i_coord%3]; }
T& operator()(int i_coord) { return _x[i_coord%3]; }
const T& operator[](int i_coord) const { return _x[i_coord%3]; }
const T& operator()(int i_coord) const { return _x[i_coord%3]; }
// algebra:
bool operator== (const point_basic<T>& v) const;
bool operator!= (const point_basic<T>& v) const;
point_basic<T> operator+ (const point_basic<T>& v) const;
point_basic<T> operator- (const point_basic<T>& v) const;
point_basic<T> operator- () const;
point_basic<T>& operator+= (const point_basic<T>& v);
point_basic<T>& operator-= (const point_basic<T>& v);
point_basic<T>& operator*= (const T& a);
point_basic<T>& operator/= (const T& a);
template <class U>
typename
std::enable_if<
details::is_rheolef_arithmetic<U>::value
,point_basic<T>
>::type
operator* (const U& a) const;
point_basic<T> operator/ (const T& a) const;
point_basic<T> operator/ (point_basic<T> v) const;
// i/o:
std::istream& get (std::istream& s, int d = 3);
std::ostream& put (std::ostream& s, int d = 3) const;
rheolef::point_basic::_x
T _x[3]
Definition: point.h:156
rheolef::point_basic::operator-
point_basic< T > operator-() const
Definition: point.h:503
rheolef::point_basic::get
std::istream & get(std::istream &s, int d=3)
Definition: point.h:377
rheolef::point_basic::operator==
bool operator==(const point_basic< T > &v) const
rheolef::point_basic::size_type
size_t size_type
Definition: point.h:92
rheolef::point_basic::scalar_type
T scalar_type
Definition: point.h:94
rheolef::point_basic::point_basic
point_basic()
Definition: point.h:329
rheolef::point_basic::operator+=
point_basic< T > & operator+=(const point_basic< T > &v)
rheolef::point_basic::operator+
point_basic< T > operator+(const point_basic< T > &v) const
Definition: point.h:495
rheolef::point_basic::operator[]
T & operator[](int i_coord)
Definition: point.h:112
rheolef::point_basic::put
std::ostream & put(std::ostream &s, int d=3) const
Definition: point.h:389
rheolef::point_basic::operator()
T & operator()(int i_coord)
Definition: point.h:113
rheolef::point_basic::operator!=
bool operator!=(const point_basic< T > &v) const
rheolef::point_basic::operator/
point_basic< T > operator/(const T &a) const
Definition: point.h:542
rheolef::point_basic::operator=
point_basic< T > & operator=(const point_basic< T1 > &p)
Definition: point.h:355
rheolef::point_basic::operator*=
point_basic< T > & operator*=(const T &a)
Definition: point.h:477
rheolef::point_basic::operator/=
point_basic< T > & operator/=(const T &a)
Definition: point.h:486
rheolef::point_basic::element_type
T element_type
Definition: point.h:93
rheolef::point_basic::float_type
T float_type
Definition: point.h:95
rheolef::point_basic::operator*
std::enable_if< details::is_rheolef_arithmetic< U >::value,point_basic< T > >::type operator*(const U &a) const
rheolef::point_basic::operator-=
point_basic< T > & operator-=(const point_basic< T > &v)
Definition: point.h:468
rheolef::type
rheolef::std type
rheolef::point_basic< T >
point_basic< T >
Definition: piola_fem.h:135
T
Expr1::float_type T
Definition: field_expr.h:261
mkgeo_ball.d
int d
Definition: mkgeo_ball.sh:154
a
Definition: diffusion_isotropic.h:25
p
Definition: sphere.icc:25
};

These linear and nonlinear functions are completed by some usual functions:

template<class T>
std::istream& operator >> (std::istream& s, point_basic<T>& p);
template<class T>
std::ostream& operator << (std::ostream& s, const point_basic<T>& p);
template <class T, class U>
typename
std::enable_if<
details::is_rheolef_arithmetic<U>::value
,point_basic<T>
>::type
operator* (const U& a, const point_basic<T>& u);
template<class T>
point_basic<T>
vect (const point_basic<T>& v, const point_basic<T>& w);
// metrics:
template<class T>
T dot (const point_basic<T>& x, const point_basic<T>& y);
template<class T>
T norm2 (const point_basic<T>& x);
template<class T>
T norm (const point_basic<T>& x);
template<class T>
T dist2 (const point_basic<T>& x, const point_basic<T>& y);
template<class T>
T dist (const point_basic<T>& x, const point_basic<T>& y);
template<class T>
T dist_infty (const point_basic<T>& x, const point_basic<T>& y);
template <class T>
T vect2d (const point_basic<T>& v, const point_basic<T>& w);
template <class T>
T mixt (const point_basic<T>& u, const point_basic<T>& v, const point_basic<T>& w);
// robust(exact) floating point predicates: return the sign of the value as (0, > 0, < 0)
// formally: orient2d(a,b,x) = vect2d(a-x,b-x)
template <class T>
int sign_orient2d (
const point_basic<T>& a,
const point_basic<T>& b,
const point_basic<T>& c);
template <class T>
int sign_orient3d (
const point_basic<T>& a,
const point_basic<T>& b,
const point_basic<T>& c,
const point_basic<T>& d);
// compute also the value:
template <class T>
T orient2d(
const point_basic<T>& a,
const point_basic<T>& b,
const point_basic<T>& c);
// formally: orient3d(a,b,c,x) = mixt3d(a-x,b-x,c-x)
template <class T>
T orient3d(
const point_basic<T>& a,
const point_basic<T>& b,
const point_basic<T>& c,
const point_basic<T>& d);
template <class T>
std::string ptos (const point_basic<T>& x, int d = 3);
// ccomparators: lexicographic order
template<class T, size_t d>
bool lexicographically_less (const point_basic<T>& a, const point_basic<T>& b);
mkgeo_ball.b
int b
Definition: mkgeo_ball.sh:152
mkgeo_ball.c
int c
Definition: mkgeo_ball.sh:153
rheolef::dist
T dist(const point_basic< T > &x, const point_basic< T > &y)
Definition: point.h:299
rheolef::operator>>
std::istream & operator>>(std::istream &is, const catchmark &m)
Definition: catchmark.h:88
rheolef::norm
T norm(const vec< T, M > &x)
norm(x): see the expression page for the full documentation
Definition: vec.h:387
rheolef::vect2d
T vect2d(const point_basic< T > &v, const point_basic< T > &w)
Definition: point.h:558
rheolef::dot
rheolef::std enable_if ::type dot const Expr1 expr1, const Expr2 expr2 dot(const Expr1 &expr1, const Expr2 &expr2)
dot(x,y): see the expression page for the full documentation
Definition: vec_expr_v2.h:415
rheolef::dist_infty
T dist_infty(const point_basic< T > &x, const point_basic< T > &y)
Definition: point.h:305
rheolef::mixt
T mixt(const point_basic< T > &u, const point_basic< T > &v, const point_basic< T > &w)
Definition: point.h:565
rheolef::dist2
T dist2(const point_basic< T > &x, const point_basic< T > &y)
Definition: point.h:293
rheolef::orient2d
T orient2d(const point_basic< T > &a, const point_basic< T > &b, const point_basic< T > &c)
Definition: point_predicate.cc:107
rheolef::lexicographically_less
bool lexicographically_less(const point_basic< T > &a, const point_basic< T > &b)
Definition: point.h:315
rheolef::orient3d
T orient3d(const point_basic< T > &a, const point_basic< T > &b, const point_basic< T > &c, const point_basic< T > &d)
Definition: point_predicate.cc:124
rheolef::sign_orient3d
int sign_orient3d(const point_basic< T > &a, const point_basic< T > &b, const point_basic< T > &c, const point_basic< T > &d)
Definition: point_predicate.cc:89
rheolef::vect
point_basic< T > vect(const point_basic< T > &v, const point_basic< T > &w)
Definition: point.h:265
rheolef::ptos
std::string ptos(const point_basic< T > &x, int d=3)
Definition: point.h:414
rheolef::operator*
csr< T, sequential > operator*(const T &lambda, const csr< T, sequential > &a)
Definition: csr.h:437
rheolef::norm2
T norm2(const vec< T, M > &x)
norm2(x): see the expression page for the full documentation
Definition: vec.h:379
rheolef::sign_orient2d
int sign_orient2d(const point_basic< T > &a, const point_basic< T > &b, const point_basic< T > &c)
Definition: point_predicate.cc:72
rheolef::operator<<
std::ostream & operator<<(std::ostream &os, const catchmark &m)
Definition: catchmark.h:99
u
Definition: leveque.h:25