OpenFPM_data  0.1.0
Project that contain the implementation and interfaces for basic structure like vectors, grids, graph ... .
 All Data Structures Namespaces Functions Variables Typedefs Friends
Point< dim, T > Class Template Reference

This class implement the point shape in an N-dimensional space. More...

Detailed Description

template<unsigned int dim, typename T>
class Point< dim, T >

This class implement the point shape in an N-dimensional space.

Parameters
Ttype of the space
dimdimensionality

Definition at line 20 of file Point.hpp.

#include <Point.hpp>

Public Types

typedef T coord_type
 
typedef boost::fusion::vector
< T[dim]> 
type
 boost fusion that store the point
 

Public Member Functions

get (int i) const
 Get coordinate. More...
 
T & get (int i)
 Get coordinate. More...
 
T & operator[] (size_t i)
 Get the component i. More...
 
Point< dim, T > & operator= (const Point< dim, T > &p)
 operator= between points More...
 
Point< dim, T > operator* (T c)
 Multiply each components by a constant. More...
 
template<typename aT >
Point< dim, T > operator* (const Point< dim, aT > &p)
 Multiply each components. More...
 
Point< dim, T > & operator-= (const Point< dim, T > &p)
 Subtract each components. More...
 
Point< dim, T > & operator+= (const Point< dim, T > &p)
 Sum each components. More...
 
norm ()
 
template<typename aT >
Point< dim, T > operator+ (const Point< dim, aT > &p)
 Sum each components. More...
 
template<typename aT >
Point< dim, T > operator/ (const aT(&ar)[dim])
 divide each component More...
 
template<typename aT >
Point< dim, T > operator/ (const aT c)
 divide each component More...
 
Point< dim, T > operator- (const Point< dim, T > &p)
 Operator subtraction. More...
 
void zero ()
 Set to zero the point coordinate. More...
 
void one ()
 Set to one the point coordinate. More...
 
std::string toPointString () const
 Convert the point into a string. More...
 
std::string toString () const
 Return the string with the point coordinate. More...
 
 Point (const Point< dim, T > &&p)
 Point constructor from point. More...
 
 Point (const Point< dim, T > &p)
 Point constructor from point. More...
 
 Point (const T(&p)[dim])
 Constructor from an array. More...
 
template<typename S >
 Point (const Point< dim, S > &p)
 Point constructor. More...
 
template<unsigned int d, typename M >
 Point (const encapc< d, Point< dim, T >, M > &p)
 Point constructor. More...
 
 Point (std::initializer_list< T > p1)
 Constructor from a list. More...
 
 Point ()
 Default contructor.
 
T & value (size_t i)
 Return the reference to the value at coordinate i. More...
 
value (size_t i) const
 Return the value at coordinate i. More...
 
T(& asArray ())[dim]
 Return the coordinated of the point as reference array. More...
 
template<typename A >
Point< dim, A > convertPoint () const
 

Static Public Member Functions

static Point< dim, T > zero_p ()
 Create a point set to zero. More...
 
static bool noPointers ()
 This structure has no internal pointers.
 

Data Fields

type data
 structure that store the data of the point
 

Static Public Attributes

static const unsigned int x = 0
 Property id of the point.
 
static const unsigned int max_prop = 1
 
static const unsigned int dims = dim
 

Constructor & Destructor Documentation

template<unsigned int dim, typename T>
Point< dim, T >::Point ( const Point< dim, T > &&  p)
inline

Point constructor from point.

Parameters
pthe point

Definition at line 317 of file Point.hpp.

template<unsigned int dim, typename T>
Point< dim, T >::Point ( const Point< dim, T > &  p)
inline

Point constructor from point.

Parameters
pthe point

Definition at line 328 of file Point.hpp.

template<unsigned int dim, typename T>
Point< dim, T >::Point ( const T(&)  p[dim])
inline

Constructor from an array.

Parameters
parray with the coordinate of the point

Definition at line 339 of file Point.hpp.

template<unsigned int dim, typename T>
template<typename S >
Point< dim, T >::Point ( const Point< dim, S > &  p)
inline

Point constructor.

Parameters
pPoint

Definition at line 350 of file Point.hpp.

template<unsigned int dim, typename T>
template<unsigned int d, typename M >
Point< dim, T >::Point ( const encapc< d, Point< dim, T >, M > &  p)
inline

Point constructor.

Parameters
pencapc Point

Definition at line 361 of file Point.hpp.

template<unsigned int dim, typename T>
Point< dim, T >::Point ( std::initializer_list< T >  p1)
inline

Constructor from a list.

[Example] Point<3,float> p({0.0,0.0,1.0})

Definition at line 372 of file Point.hpp.

Member Function Documentation

template<unsigned int dim, typename T>
T(& Point< dim, T >::asArray ( ) )[dim]
inline

Return the coordinated of the point as reference array.

Returns
the reference array

Definition at line 408 of file Point.hpp.

template<unsigned int dim, typename T>
template<typename A >
Point<dim,A> Point< dim, T >::convertPoint ( ) const
inline

Convert the point from Point<dim,T> to Point<dim,A>

Returns
the converted point

Definition at line 418 of file Point.hpp.

template<unsigned int dim, typename T>
T Point< dim, T >::get ( int  i) const
inline

Get coordinate.

Parameters
idimension
Returns
the i-coordinate of the point

Definition at line 42 of file Point.hpp.

template<unsigned int dim, typename T>
T& Point< dim, T >::get ( int  i)
inline

Get coordinate.

Parameters
idimension
Returns
the i-coordinate of the point

Definition at line 54 of file Point.hpp.

template<unsigned int dim, typename T>
T Point< dim, T >::norm ( )
inline

norm of the vector

Returns
the norm of the vector

Definition at line 154 of file Point.hpp.

template<unsigned int dim, typename T>
void Point< dim, T >::one ( )
inline

Set to one the point coordinate.

Definition at line 252 of file Point.hpp.

template<unsigned int dim, typename T>
Point<dim,T> Point< dim, T >::operator* ( c)
inline

Multiply each components by a constant.

Parameters
cconstanr

Definition at line 90 of file Point.hpp.

template<unsigned int dim, typename T>
template<typename aT >
Point<dim,T> Point< dim, T >::operator* ( const Point< dim, aT > &  p)
inline

Multiply each components.

Parameters
pPoint

Definition at line 107 of file Point.hpp.

template<unsigned int dim, typename T>
template<typename aT >
Point<dim,T> Point< dim, T >::operator+ ( const Point< dim, aT > &  p)
inline

Sum each components.

Parameters
pPoint

Definition at line 171 of file Point.hpp.

template<unsigned int dim, typename T>
Point<dim,T>& Point< dim, T >::operator+= ( const Point< dim, T > &  p)
inline

Sum each components.

Parameters
pPoint

Definition at line 139 of file Point.hpp.

template<unsigned int dim, typename T>
Point<dim,T> Point< dim, T >::operator- ( const Point< dim, T > &  p)
inline

Operator subtraction.

it produce a point that is the subtraction of two points

Parameters
pPoint

Definition at line 224 of file Point.hpp.

template<unsigned int dim, typename T>
Point<dim,T>& Point< dim, T >::operator-= ( const Point< dim, T > &  p)
inline

Subtract each components.

Parameters
pPoint

Definition at line 124 of file Point.hpp.

template<unsigned int dim, typename T>
template<typename aT >
Point<dim,T> Point< dim, T >::operator/ ( const aT(&)  ar[dim])
inline

divide each component

Parameters
arComponent wise division

Definition at line 188 of file Point.hpp.

template<unsigned int dim, typename T>
template<typename aT >
Point<dim,T> Point< dim, T >::operator/ ( const aT  c)
inline

divide each component

Parameters
cComponent wise division

Definition at line 205 of file Point.hpp.

template<unsigned int dim, typename T>
Point<dim,T>& Point< dim, T >::operator= ( const Point< dim, T > &  p)
inline

operator= between points

Parameters
pPoint

Definition at line 75 of file Point.hpp.

template<unsigned int dim, typename T>
T& Point< dim, T >::operator[] ( size_t  i)
inline

Get the component i.

Returns
the i-component

Definition at line 65 of file Point.hpp.

template<unsigned int dim, typename T>
std::string Point< dim, T >::toPointString ( ) const
inline

Convert the point into a string.

Returns
the string

Definition at line 282 of file Point.hpp.

template<unsigned int dim, typename T>
std::string Point< dim, T >::toString ( ) const
inline

Return the string with the point coordinate.

Returns
the string

Definition at line 299 of file Point.hpp.

template<unsigned int dim, typename T>
T& Point< dim, T >::value ( size_t  i)
inline

Return the reference to the value at coordinate i.

Returns
the reference

Definition at line 388 of file Point.hpp.

template<unsigned int dim, typename T>
T Point< dim, T >::value ( size_t  i) const
inline

Return the value at coordinate i.

Returns
the value

Definition at line 398 of file Point.hpp.

template<unsigned int dim, typename T>
void Point< dim, T >::zero ( )
inline

Set to zero the point coordinate.

Definition at line 240 of file Point.hpp.

template<unsigned int dim, typename T>
static Point<dim,T> Point< dim, T >::zero_p ( )
inlinestatic

Create a point set to zero.

Returns
a point with all coorfinate set to 0

Definition at line 265 of file Point.hpp.


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