SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
slip::DPoint< CoordType, DIM > Class Template Reference

Define an abstract DPoint structure. More...

#include <Box.hpp>

Inheritance diagram for slip::DPoint< CoordType, DIM >:
Inheritance graph

Public Types

typedef CoordType value_type
 
typedef value_typedpointer
 
typedef const value_typeconst_dpointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef DPoint< CoordType, DIM > self
 
typedef
std::random_access_iterator_tag 
iterator_category
 

Public Member Functions

std::size_t dim () const
 Returns the dimension of the DPoint. More...
 
std::size_t size () const
 Returns the dimension of the DPoint. More...
 
std::size_t max_size () const
 Returns the maximal size of the DPoint. More...
 
bool empty () const
 Returns true if dimension of the DPoint is 0. More...
 
const block< value_type, DIM > & coord () const
 Return the coordinates of the DPoint. More...
 
void swap (self &other)
 Swaps two DPoint. More...
 
Assignment operators and methods
selfoperator= (const self &other)
 Assign a DPoint. More...
 
Element access operators
reference operator[] (const std::size_t i)
 Returns the i'th coordinate of the DPoint. More...
 
const_reference operator[] (const std::size_t i) const
 Returns the i'th row of the DPoint. More...
 
Comparison operators
bool operator== (const self &other) const
 compare two DPoint. More...
 
bool operator!= (const self &other) const
 compare two DPoint. More...
 
Arithmetic operators
self operator- () const
 negate all the coordinates of a DPoint More...
 
selfoperator+= (const self &other)
 add the coordinates of a DPoint to the DPoint More...
 
self operator+ (const self &other) const
 add the coordinates of a two DPoint More...
 
selfoperator-= (const self &other)
 substract the coordinates of a DPoint to the DPoint More...
 
self operator- (const self &other) const
 substract the coordinates of a two DPoint More...
 

Protected Member Functions

template<class Archive >
void save (Archive &ar, const unsigned int version) const
 
template<class Archive >
void load (Archive &ar, const unsigned int version)
 

Protected Attributes

block< value_type, DIM > coord_
 The coordinates of the dpoint are stored in this block. More...
 

Friends

class boost::serialization::access
 
i/o operators
std::ostream & operator<< (std::ostream &out, const self &p)
 Write the DPoint to the ouput stream. More...
 

Constructors & Destructors

 DPoint (const self &other)
 Constructs a copy of the DPoint rhs. More...
 
 DPoint (const CoordType *array)
 Constructs a DPoint from a CoordType array. More...
 
 DPoint ()
 Default constructor (protected to avoid default construction) More...
 

Detailed Description

template<typename CoordType, std::size_t DIM>
class slip::DPoint< CoordType, DIM >

Define an abstract DPoint structure.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.2
Date
2014/04/02
Since
1.0.0
Parameters
CoordTypeType of the coordinates of the DPoint
DIMdimension of the DPoint

Definition at line 95 of file Box.hpp.

Member Typedef Documentation

template<typename CoordType, std::size_t DIM>
typedef const value_type* slip::DPoint< CoordType, DIM >::const_dpointer

Definition at line 114 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
typedef const value_type& slip::DPoint< CoordType, DIM >::const_reference

Definition at line 116 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
typedef value_type* slip::DPoint< CoordType, DIM >::dpointer

Definition at line 113 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
typedef std::random_access_iterator_tag slip::DPoint< CoordType, DIM >::iterator_category

Definition at line 121 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
typedef value_type& slip::DPoint< CoordType, DIM >::reference

Definition at line 115 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
typedef DPoint<CoordType,DIM> slip::DPoint< CoordType, DIM >::self

Definition at line 118 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
typedef CoordType slip::DPoint< CoordType, DIM >::value_type

Definition at line 112 of file DPoint.hpp.

Constructor & Destructor Documentation

template<typename CoordType , std::size_t DIM>
slip::DPoint< CoordType, DIM >::DPoint ( const self other)
inline

Constructs a copy of the DPoint rhs.

Parameters
other

Definition at line 351 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
slip::DPoint< CoordType, DIM >::DPoint ( const CoordType *  array)
inline

Constructs a DPoint from a CoordType array.

Parameters
array

Definition at line 357 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
slip::DPoint< CoordType, DIM >::DPoint ( )
inlineprotected

Default constructor (protected to avoid default construction)

Definition at line 346 of file DPoint.hpp.

Member Function Documentation

template<typename CoordType , std::size_t DIM>
const block< CoordType, DIM > & slip::DPoint< CoordType, DIM >::coord ( ) const
inline

Return the coordinates of the DPoint.

Definition at line 408 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
std::size_t slip::DPoint< CoordType, DIM >::dim ( ) const
inline

Returns the dimension of the DPoint.

Returns
the dimension (number of coordinates) of the DPoint

Definition at line 392 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
bool slip::DPoint< CoordType, DIM >::empty ( ) const
inline

Returns true if dimension of the DPoint is 0.

Returns
true if the dimension of the DPoint is 0, false else

Definition at line 404 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
template<class Archive >
void slip::DPoint< CoordType, DIM >::load ( Archive &  ar,
const unsigned int  version 
)
inlineprotected

Definition at line 331 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
std::size_t slip::DPoint< CoordType, DIM >::max_size ( ) const
inline

Returns the maximal size of the DPoint.

Returns
the dimension (number of coordinates) of the DPoint

Definition at line 400 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
bool slip::DPoint< CoordType, DIM >::operator!= ( const self other) const
inline

compare two DPoint.

Parameters
otherDPoint to compare
Returns
true if the two dpoint don't have the same coordinates

Definition at line 438 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
DPoint< CoordType, DIM > slip::DPoint< CoordType, DIM >::operator+ ( const self other) const
inline

add the coordinates of a two DPoint

Parameters
otherDPoint to add with
Returns
a DPoint

Definition at line 466 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
DPoint< CoordType, DIM > & slip::DPoint< CoordType, DIM >::operator+= ( const self other)
inline

add the coordinates of a DPoint to the DPoint

Parameters
otherDPoint to add with
Returns
a DPoint

Definition at line 455 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
DPoint< CoordType, DIM > slip::DPoint< CoordType, DIM >::operator- ( ) const
inline

negate all the coordinates of a DPoint

Returns
a DPoint with negate coordinates

Definition at line 445 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
DPoint< CoordType, DIM > slip::DPoint< CoordType, DIM >::operator- ( const self other) const
inline

substract the coordinates of a two DPoint

Parameters
otherDPoint to add with
Returns
a DPoint

Definition at line 486 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
DPoint< CoordType, DIM > & slip::DPoint< CoordType, DIM >::operator-= ( const self other)
inline

substract the coordinates of a DPoint to the DPoint

Parameters
otherDPoint to add with
Returns
a DPoint

Definition at line 475 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
DPoint< CoordType, DIM > & slip::DPoint< CoordType, DIM >::operator= ( const self other)
inline

Assign a DPoint.

Assign elements of DPoint in other

Parameters
otherDPoint to get the values from.
Returns

Definition at line 364 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
bool slip::DPoint< CoordType, DIM >::operator== ( const self other) const
inline

compare two DPoint.

Parameters
otherDPoint to compare
Returns
true if the two dpoint have the same coordinates

Definition at line 431 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
CoordType & slip::DPoint< CoordType, DIM >::operator[] ( const std::size_t  i)
inline

Returns the i'th coordinate of the DPoint.

Parameters
iindex of the coordinate to return
Returns
value of the i'th row of the DPoint.
Precondition
0 <= i < dim

Definition at line 376 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
const CoordType & slip::DPoint< CoordType, DIM >::operator[] ( const std::size_t  i) const
inline

Returns the i'th row of the DPoint.

Parameters
iindex of the coordinate to return
Returns
value of the i'th row of the DPoint
Precondition
0 <= i < dim

Definition at line 384 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
template<class Archive >
void slip::DPoint< CoordType, DIM >::save ( Archive &  ar,
const unsigned int  version 
) const
inlineprotected

Definition at line 326 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
std::size_t slip::DPoint< CoordType, DIM >::size ( ) const
inline

Returns the dimension of the DPoint.

Returns
the dimension (number of coordinates) of the DPoint

Definition at line 396 of file DPoint.hpp.

template<typename CoordType , std::size_t DIM>
void slip::DPoint< CoordType, DIM >::swap ( self other)
inline

Swaps two DPoint.

Parameters
otherDPoint to swap with

Definition at line 415 of file DPoint.hpp.

Friends And Related Function Documentation

template<typename CoordType, std::size_t DIM>
friend class boost::serialization::access
friend

Definition at line 324 of file DPoint.hpp.

template<typename CoordType, std::size_t DIM>
std::ostream& operator<< ( std::ostream &  out,
const self p 
)
friend

Write the DPoint to the ouput stream.

Parameters
outoutput stream
pDPoint to write to the output stream

Definition at line 422 of file DPoint.hpp.

Member Data Documentation

template<typename CoordType, std::size_t DIM>
block<value_type,DIM> slip::DPoint< CoordType, DIM >::coord_
protected

The coordinates of the dpoint are stored in this block.

Definition at line 321 of file DPoint.hpp.


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