#include <dpoint.hh>
Inheritance diagram for oln::abstract::dpoint< Exact >:
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. | |
coord & | nth (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 () |
Definition at line 71 of file dpoint.hh.
|
Test if all the dpoint coordinates 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 } |
|
Test if two dpoints do not have the same coordinates.
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 } |
|
Add a dpoint dp to the current dpoint.
Definition at line 142 of file dpoint.hh.
00143 {
00144 return this->exact().plus_dp(dp.exact());
00145 }
|
|
Add a dpoint dp to the current dpoint.
Definition at line 120 of file dpoint.hh.
00121 {
00122 return this->exact().plus_assign_dp(dp.exact());
00123 }
|
|
Subtract a dpoint dp from the current dpoint.
Definition at line 153 of file dpoint.hh.
00154 {
00155 return this->exact().minus_dp(dp.exact());
00156 }
|
|
Subtract a dpoint dp from the current dpoint.
Definition at line 131 of file dpoint.hh.
00132 {
00133 return this->exact().minus_assign_dp(dp.exact());
00134 }
|
|
Test if two dpoints have the same coordinates.
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 } |