oln::abstract::dpoint< Exact > Struct Template Reference

#include <dpoint.hh>

Inheritance diagram for oln::abstract::dpoint< Exact >:

Inheritance graph
[legend]
Collaboration diagram for oln::abstract::dpoint< Exact >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Exact exact_type
typedef dpoint< Exact > self_type
typedef dpoint_traits< exact_type
>::point_type 
point_type
enum  { dim = dpoint_traits<exact_type>::dim }

Public Member Functions

 dpoint (const abstract::point< point_type > &p)
 Construct a dpoint with the same coordinates a the point p.

coord nth (const unsigned d) const
 Return the dth coordinate of the current dpoint.

coordnth (const unsigned d)
 Return a reference to the dth coordinate of the current dpoint.

exact_type operator- () const
 Return a dpoint whose coordinates are the opposite of the current dpoint coordinates.

exact_type & operator+= (const self_type &dp)
 Add a dpoint dp to the current dpoint.

exact_type & operator-= (const self_type &dp)
 Subtract a dpoint dp from the current dpoint.

exact_type operator+ (const self_type &dp) const
 Add a dpoint dp to the current dpoint.

exact_type operator- (const self_type &dp) const
 Subtract a dpoint dp from the current dpoint.

bool operator== (const self_type &dp) const
 Test if two dpoints have the same coordinates.

bool operator!= (const self_type &dp) const
 Test if two dpoints do not have the same coordinates.

bool is_centered (void) const
 Test if all the dpoint coordinates are set to zero.

ntg::float_d norm2 (void) const
 Return the norm of the current dpoint.

ntg::float_d sqr_norm2 (void) const
 Return the square of the norm of the current dpoint.


Static Public Member Functions

std::string name ()

Detailed Description

template<class Exact>
struct oln::abstract::dpoint< Exact >

The abstract dpoint class from whom derives all the others dpoint classes.

Definition at line 71 of file dpoint.hh.


Member Function Documentation

template<class Exact>
bool oln::abstract::dpoint< Exact >::is_centered void   )  const [inline]
 

Test if all the dpoint coordinates are set to zero.

Returns:
True if all the coordinates of the current dpoint are set to zero.

Definition at line 199 of file dpoint.hh.

00200       {
00201         for (unsigned i = 0; i < dim; ++i)
00202           if (nth(i) != 0)
00203             return false;
00204         return true;
00205       }

template<class Exact>
bool oln::abstract::dpoint< Exact >::operator!= const self_type &  dp  )  const [inline]
 

Test if two dpoints do not have the same coordinates.

  • dp A dpoint.
Returns:
False if dp and the current point have the same coordinate, true otherwise.

Definition at line 184 of file dpoint.hh.

00185       {
00186         for (unsigned i = 0; i < dim; ++i)
00187           if (dp.nth(i) != nth(i))
00188             return true;
00189         return false;
00190       }

template<class Exact>
exact_type oln::abstract::dpoint< Exact >::operator+ const self_type &  dp  )  const [inline]
 

Add a dpoint dp to the current dpoint.

Returns:
The value of the current point plus dp.

Definition at line 142 of file dpoint.hh.

00143       {
00144         return this->exact().plus_dp(dp.exact());
00145       }

template<class Exact>
exact_type& oln::abstract::dpoint< Exact >::operator+= const self_type &  dp  )  [inline]
 

Add a dpoint dp to the current dpoint.

Returns:
A reference to the current dpoint plus dp.

Definition at line 120 of file dpoint.hh.

00121       {
00122         return this->exact().plus_assign_dp(dp.exact());
00123       }

template<class Exact>
exact_type oln::abstract::dpoint< Exact >::operator- const self_type &  dp  )  const [inline]
 

Subtract a dpoint dp from the current dpoint.

Returns:
The value of the current point minus dp.

Definition at line 153 of file dpoint.hh.

00154       {
00155         return this->exact().minus_dp(dp.exact());
00156       }

template<class Exact>
exact_type& oln::abstract::dpoint< Exact >::operator-= const self_type &  dp  )  [inline]
 

Subtract a dpoint dp from the current dpoint.

Returns:
A reference to the current point minus dp.

Definition at line 131 of file dpoint.hh.

00132       {
00133         return this->exact().minus_assign_dp(dp.exact());
00134       }

template<class Exact>
bool oln::abstract::dpoint< Exact >::operator== const self_type &  dp  )  const [inline]
 

Test if two dpoints have the same coordinates.

  • dp A dpoint.
Returns:
True if dp and the current point have the same coordinate, false otherwise.

Definition at line 167 of file dpoint.hh.

00168       {
00169         for (unsigned i = 0; i < dim; ++i)
00170           if (dp.nth(i) != nth(i))
00171             return false;
00172         return true;
00173       }


The documentation for this struct was generated from the following file:
Generated on Thu Apr 15 20:14:45 2004 for Olena by doxygen 1.3.6-20040222