#include <Ptv.h>
Public Member Functions | |
Ptv (unsigned int size_) | |
Ptv (unsigned int size_, double *v_) | |
Ptv (double x, double y) | |
Ptv (double x, double y, double z) | |
Ptv (const Ptv &p) | |
Ptv () | |
void | redim (unsigned int size_, double *v_) |
void | redim (unsigned int size_) |
void | fill (double *v_) |
virtual | ~Ptv () |
const unsigned int | size () const |
const double & | operator[] (unsigned int i) const |
double & | operator[] (unsigned int i) |
Ptv & | operator= (const Ptv &p) |
bool | less (const Ptv &p) const |
Public Attributes | |
unsigned int | dim |
double * | v |
Static Public Attributes | |
static double | tol = 1.0e-9 |
Definition at line 10 of file Ptv.h.
Ptv::Ptv | ( | unsigned int | size_ | ) |
Ptv::Ptv | ( | unsigned int | size_, | |
double * | v_ | |||
) |
Ptv::Ptv | ( | double | x, | |
double | y | |||
) |
Ptv::Ptv | ( | double | x, | |
double | y, | |||
double | z | |||
) |
Ptv::Ptv | ( | const Ptv & | p | ) |
Ptv::Ptv | ( | ) |
Ptv::~Ptv | ( | ) | [virtual] |
void Ptv::fill | ( | double * | v_ | ) |
bool Ptv::less | ( | const Ptv & | p | ) | const |
Definition at line 162 of file Ptv.cpp.
References dim, size(), tol, and v.
Referenced by SyFi::line_contains(), and Ptv_is_less::operator()().
00163 { 00164 00165 if ( dim < p.size() ) return true ; 00166 if ( dim > p.size() ) return false; 00167 00168 /* 00169 for (int i=dim-1; i>= 0; i--) { 00170 if ( fabs(v[i] - p[i]) > tol ) { 00171 if (v[i] < p[i]) 00172 return true; 00173 else 00174 return false; 00175 } 00176 } 00177 */ 00178 00179 for (int i=dim-1; i>= 0; i--) 00180 { 00181 if ( v[i] + tol >= p[i] - tol && v[i] - tol <= p[i] + tol ) 00182 { 00183 } 00184 else if (v[i] + tol < p[i] - tol ) 00185 { 00186 return true; 00187 } 00188 else if ( v[i] - tol > p[i] + tol ) 00189 { 00190 return false; 00191 } 00192 } 00193 00194 return false; 00195 }
Definition at line 143 of file Ptv.cpp.
References dim, size(), and v.
00144 { 00145 if ( this != &p) 00146 { 00147 if ( dim != p.size()) 00148 { 00149 delete [] v; 00150 dim = p.size(); 00151 v = new double[dim]; 00152 } 00153 for (unsigned int i=0; i< dim; i++) 00154 { 00155 v[i] = p[i]; 00156 } 00157 } 00158 return *this; 00159 }
double & Ptv::operator[] | ( | unsigned int | i | ) |
const double & Ptv::operator[] | ( | unsigned int | i | ) | const |
void Ptv::redim | ( | unsigned int | size_ | ) |
void Ptv::redim | ( | unsigned int | size_, | |
double * | v_ | |||
) |
Definition at line 89 of file Ptv.cpp.
Referenced by SyFi::add(), SyFi::cross(), and SyFi::sub().
00090 { 00091 if (dim != size_ ) 00092 { 00093 delete [] v; 00094 dim = size_; 00095 v = new double[dim]; 00096 } 00097 00098 for (unsigned int i=0; i< dim; i++) 00099 { 00100 v[i] = v_[i]; 00101 } 00102 }
const unsigned int Ptv::size | ( | ) | const |
Definition at line 129 of file Ptv.cpp.
References dim.
Referenced by SyFi::add(), SyFi::contains2D(), SyFi::cross(), SyFi::is_equal(), less(), SyFi::mul(), SyFi::norm(), SyFi::normalize(), operator<<(), operator=(), Ptv(), and SyFi::sub().
00129 { return dim;}
unsigned int Ptv::dim |
double Ptv::tol = 1.0e-9 [static] |
Definition at line 16 of file Ptv.h.
Referenced by SyFi::is_equal(), SyFi::is_inside_triangle(), less(), SyFi::line_contains(), and SyFi::set_tolerance().
double* Ptv::v |
Definition at line 15 of file Ptv.h.
Referenced by fill(), less(), operator=(), operator[](), Ptv(), redim(), and ~Ptv().