ALL 0.9.3
A Loadbalacing Library
Loading...
Searching...
No Matches
ALL::Point< T > Class Template Reference

#include <ALL_Point.hpp>

Public Member Functions

 Point ()
 default constructor
 
 Point (const int d)
 
 Point (const int d, const T *data)
 
 Point (const int d, const T *data, const T w)
 
 Point (const int d, const T *data, const T w, const long i)
 
 Point (const std::vector< T > &data)
 
 Point (const std::vector< T > &data, const T w)
 
 Point (const std::vector< T > &data, const T w, const long i)
 
 ~Point ()
 destructor
 
Point< T > cross (const Point< T > &rhs) const
 
d (Point< T > p)
 
d_1 (Point< T > p)
 
Point< T > dist (Point< T > &p)
 
dist_plane (const Point< T > &A, const Point< T > &B, const Point< T > &C)
 
long get_id () const
 
int getDimension () const
 
getWeight () const
 
bool inTetrahedron (const Point< T > &A, const Point< T > &B, const Point< T > &C, const Point< T > &D)
 
norm (T nd=2)
 
operator* (const Point< T > &rhs) const
 
Point< T > operator* (const T &rhs) const
 
Point< T > operator+ (const Point< T > &rhs) const
 
Point< T > operator- (const Point< T > &rhs) const
 
Point< T > operator/ (const T &rhs) const
 
T & operator[] (const std::size_t idx)
 
const T & operator[] (const std::size_t idx) const
 
bool same_side_plane (const Point< T > &A, const Point< T > &B, const Point< T > &C, const Point< T > &P)
 
void set_id (const long i)
 
void set_weight (const T w)
 
void setDimension (const int d)
 

Detailed Description

template<class T>
class ALL::Point< T >
Template Parameters
Tfloating point type used, has to be identical to the type used for the vertices and borders

Definition at line 49 of file ALL_Point.hpp.

Constructor & Destructor Documentation

◆ Point() [1/8]

template<class T>
ALL::Point< T >::Point ( )
inline

default constructor

Definition at line 52 of file ALL_Point.hpp.

+ Here is the caller graph for this function:

◆ Point() [2/8]

template<class T>
ALL::Point< T >::Point ( const int d)
inline

constructor

Parameters
ddimension of the point object

Definition at line 55 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ Point() [3/8]

template<class T>
ALL::Point< T >::Point ( const int d,
const T * data )
inline

constructor with initialization

Parameters
ddimension of the point object
datapositions

Definition at line 62 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ Point() [4/8]

template<class T>
ALL::Point< T >::Point ( const std::vector< T > & data)
inline

constructor with initialization

Parameters
datapositions, dimension is the size of the vector

Definition at line 72 of file ALL_Point.hpp.

◆ Point() [5/8]

template<class T>
ALL::Point< T >::Point ( const int d,
const T * data,
const T w )
inline

constructor with initialization

Parameters
ddimension of the point
datapositions
wweight of the point

Definition at line 83 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ Point() [6/8]

template<class T>
ALL::Point< T >::Point ( const int d,
const T * data,
const T w,
const long i )
inline

constructor with initialization

Parameters
ddimension of the point
datapositions
wweight of the point
iindex of the point

Definition at line 92 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ Point() [7/8]

template<class T>
ALL::Point< T >::Point ( const std::vector< T > & data,
const T w )
inline

constructor with initialization

Parameters
datapositions, dimension is the size of the vector
wweight of the point

Definition at line 101 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ Point() [8/8]

template<class T>
ALL::Point< T >::Point ( const std::vector< T > & data,
const T w,
const long i )
inline

constructor with initialization

Parameters
datapositions, dimension is the size of the vector
wweight of the point
iindex of the point

Definition at line 110 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ ~Point()

template<class T>
ALL::Point< T >::~Point ( )
inline

destructor

Definition at line 116 of file ALL_Point.hpp.

Member Function Documentation

◆ cross()

template<class T>
Point< T > ALL::Point< T >::cross ( const Point< T > & rhs) const
inline

operator to compute the cross product between two point objects

Parameters
rhspoint object to compute the cross product with
Returns
cross product between the two point objects
Attention
only works for 3D points / vectors

Definition at line 305 of file ALL_Point.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ d()

template<class T>
T ALL::Point< T >::d ( Point< T > p)
inline

method to compute the Euclidean distance (two-norm) between the local and the provided point object

Parameters
pthe point object for which the distence to the local point object is computed
Returns
the distance between the two points

Definition at line 174 of file ALL_Point.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ d_1()

template<class T>
T ALL::Point< T >::d_1 ( Point< T > p)
inline

method to compute the Manhatten / city-block distance (one-norm) between the local and the provided point object

Parameters
pthe point object for which the distance to the local point object is computed
Returns
the distance between the two points

Definition at line 186 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ dist()

template<class T>
Point< T > ALL::Point< T >::dist ( Point< T > & p)
inline

method to compute the distance vector between the local point object and the provided point object

Parameters
pthe point object for which the distance vector to the local point object is computed
Returns
the distance vector between the two points

Definition at line 198 of file ALL_Point.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dist_plane()

template<class T>
T ALL::Point< T >::dist_plane ( const Point< T > & A,
const Point< T > & B,
const Point< T > & C )
inline

method to compute the distance of the local point object from a plane spanned by provided points

Parameters
Aanchor point for the plane
Banchor point for the plane
Canchor point for the plane
Returns
distance between local point object and plane

Definition at line 215 of file ALL_Point.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_id()

template<class T>
long ALL::Point< T >::get_id ( ) const
inline

method to get the index of the point object

Returns
the index of the point object

Definition at line 152 of file ALL_Point.hpp.

+ Here is the caller graph for this function:

◆ getDimension()

template<class T>
int ALL::Point< T >::getDimension ( ) const
inline

method to get the dimension of the point object

Returns
the dimension of the point object

Definition at line 156 of file ALL_Point.hpp.

+ Here is the caller graph for this function:

◆ getWeight()

template<class T>
T ALL::Point< T >::getWeight ( ) const
inline

method to get the weight of the point object

Returns
the weight of the point object

Definition at line 148 of file ALL_Point.hpp.

+ Here is the caller graph for this function:

◆ inTetrahedron()

template<class T>
bool ALL::Point< T >::inTetrahedron ( const Point< T > & A,
const Point< T > & B,
const Point< T > & C,
const Point< T > & D )
inline

method to check if the local point object is inside a tetrahedron described by the vertices A,B,C and D

Parameters
Avertex A
Bvertex B
Cvertex C
Dvertex D
Returns
the point is within the tetrahedron
Attention
a point that is on the surface of the tetrahedron is not inside it

for all surfaces of the tetrahedron check if the local point has the same orientation as the remaining vertex of the tetrahedron, to be inside the tetrahedron that must be fulfilled

Definition at line 354 of file ALL_Point.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ norm()

template<class T>
T ALL::Point< T >::norm ( T nd = 2)
inline

method to compute the norm of the vector described by the point object

Parameters
ndtype of the norm (default: 2, i.e. the Euclidean norm)
Returns
norm of the vector

Definition at line 162 of file ALL_Point.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator*() [1/2]

template<class T>
T ALL::Point< T >::operator* ( const Point< T > & rhs) const
inline

operator to compute the dot product between two point objects

Parameters
rhspoint object to compute the dot product with
Returns
dot product between the two point objects

Definition at line 268 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ operator*() [2/2]

template<class T>
Point< T > ALL::Point< T >::operator* ( const T & rhs) const
inline

operator to scale the local point object by a provided factor

Parameters
rhsscaling factor
Returns
scaled point object

Definition at line 282 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ operator+()

template<class T>
Point< T > ALL::Point< T >::operator+ ( const Point< T > & rhs) const
inline

operator for the addition of two point objects

Parameters
rhspoint to add the local point object to
Returns
sum of local point object and provided point object

Definition at line 239 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ operator-()

template<class T>
Point< T > ALL::Point< T >::operator- ( const Point< T > & rhs) const
inline

operator for the addition of two point objects

Parameters
rhspoint to subtract from the local point object
Returns
difference vector between local point object and provided point object

Definition at line 254 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ operator/()

template<class T>
Point< T > ALL::Point< T >::operator/ ( const T & rhs) const
inline

operator to scale the local point object by a provided factor

Parameters
rhsscaling factor
Returns
scaled point object

Definition at line 293 of file ALL_Point.hpp.

+ Here is the call graph for this function:

◆ operator[]() [1/2]

template<class T>
T & ALL::Point< T >::operator[] ( const std::size_t idx)
inline

access operator to access an element of the point object

Parameters
idxthe index of the element to be accessed
Returns
reference to the indexed element

Definition at line 137 of file ALL_Point.hpp.

◆ operator[]() [2/2]

template<class T>
const T & ALL::Point< T >::operator[] ( const std::size_t idx) const
inline

access operator to access an element of the constant point object

Parameters
idxthe index of the element to be accessed
Returns
const reference to the indexed element

Definition at line 142 of file ALL_Point.hpp.

◆ same_side_plane()

template<class T>
bool ALL::Point< T >::same_side_plane ( const Point< T > & A,
const Point< T > & B,
const Point< T > & C,
const Point< T > & P )
inline

method to determine if the local point object has the same orientation to a plane spanned by point objects A,B,C as the provided point P

Parameters
Aanchor point A
Banchor point B
Canchor point C
Preference point P
Returns
the local point object has the same orientation to the plane as
Attention
if the reference point is located within the plane, it will not have the same orientation as the local point! the reference point

Definition at line 326 of file ALL_Point.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_id()

template<class T>
void ALL::Point< T >::set_id ( const long i)
inline

method to change the index of the particle

Parameters
inew index

Definition at line 132 of file ALL_Point.hpp.

◆ set_weight()

template<class T>
void ALL::Point< T >::set_weight ( const T w)
inline

method to change the weight of the point object

Parameters
wnew weight

Definition at line 128 of file ALL_Point.hpp.

◆ setDimension()

template<class T>
void ALL::Point< T >::setDimension ( const int d)
inline

method to change the dimension of the point object

Parameters
dnew dimension

Definition at line 121 of file ALL_Point.hpp.

+ Here is the call graph for this function:

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