Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Search for

# ptv Class Reference

`#include <ptv.h>`

List of all members.

## Public Member Functions
| ptv (int size_)
| ptv (int size_, double *v_)
| ptv (const ptv &p)
| ptv ()
virtual | ~ptv ()
const int | size () const
const double & | operator[] (int i) const
double & | operator[] (int i)
ptv & | operator= (const ptv &p)
bool | is_less (const ptv &p) const
| ptv ()
| ptv (int size_, double *v_)
| ptv (const ptv &p)
| ~ptv ()
const int | size () const
const double & | operator[] (int i) const
double & | operator[] (int i)
ptv & | operator= (const ptv &p)
bool | is_less (const ptv &p) const
## Private Attributes
int | dim
double * | v
double * | v
## Static Private Attributes
static double | tol = 10e-6

## Detailed Description

Definition at line 7 of file syfi/ptv.h.

## Constructor & Destructor Documentation

ptv::ptv | ( | int | size_ | ) |

| Definition at line 12 of file syfi/ptv.cpp. References dim, and v.
    00012                   {
    00013   dim = size_;
    00014   v = new double[dim];
    00015   for (int i=0; i< dim; i++) {
    00016     v[i] = 0.0;
    00017   }
    00018 }

ptv::ptv | ( | int | size_,
|  | double * | v_
| ) |

| Definition at line 21 of file syfi/ptv.cpp. References dim, and v.
    00021                               {
    00022   dim = size_;
    00023   v = new double[dim];
    00024   for (int i=0; i< dim; i++) {
    00025     v[i] = v_[i];
    00026   }
    00027 }

ptv::ptv | ( | const ptv & | p | ) |

| Definition at line 29 of file syfi/ptv.cpp. References dim, size(), and v.
    00029                     {
    00030   dim = p.size();
    00031   v = new double[dim];
    00032   for (int i=0; i< dim; i++) {
    00033     v[i] = p[i];
    00034   }
    00035
    00036 }

ptv::ptv | ( |  | ) |

| Definition at line 7 of file syfi/ptv.cpp. References dim, and v.
    00007          {
    00008   dim = 0;
    00009   v = 0;
    00010 }

ptv::~ptv | ( |  | ) | `[virtual]`

| Definition at line 38 of file syfi/ptv.cpp. References dim, and v.
    00038           {
    00039   if (dim > 0) delete [] v;
    00040 }

ptv::ptv | ( |  | ) |

ptv::ptv | ( | int | size_,
|  | double * | v_
| ) |

ptv::ptv | ( | const ptv & | p | ) |

ptv::~ptv | ( |  | ) |

## Member Function Documentation

bool ptv::is_less | ( | const ptv & | p | ) | const

bool ptv::is_less | ( | const ptv & | p | ) | const

| Definition at line 67 of file syfi/ptv.cpp. References dim, size(), tol, and v. Referenced by ptv_is_less::operator()().
    00067                                     {
    00068   double tmp = 0;
    00069
    00070   if ( dim <  p.size() ) return true ;
    00071   if ( dim >  p.size() ) return false;
    00072
    00073   for (int i=dim-1; i>= 0; i--) {
    00074     if ( v[i] + tol >= p[i] && v[i] - tol <= p[i] ) {
    00075     } else if ( v[i] - tol < p[i] ) {
    00076         return true;
    00077     } else if ( v[i] + tol > p[i] ) {
    00078         return false ;
    00079     }
    00080   }
    00081   return false;
    00082
    00083
    00084   /*
    00085   for (int i=0; i< dim; i++) {
    00086     if ( v[i] + tol >= p[i] && v[i] - tol <= p[i] ) {
    00087     } else if ( v[i] - tol < p[i] ) {
    00088         return true;
    00089     } else if ( v[i] + tol > p[i] ) {
    00090         return false ;
    00091     }
    00092   }
    00093   return false;
    00094   */
    00095 }

ptv& ptv::operator= | ( | const ptv & | p | ) |

ptv & ptv::operator= | ( | const ptv & | p | ) |

| Definition at line 52 of file syfi/ptv.cpp. References dim, size(), and v.
    00052                                   {
    00053   if ( this != &p) {
    00054     if ( dim > 0 ) delete [] v;
    00055     dim = p.size();
    00056     v = new double[dim];
    00057     for (int i=0; i< dim; i++) {
    00058       v[i] = p[i];
    00059     }
    00060   }
    00061   return *this;
    00062 }

double& ptv::operator[] | ( | int | i | ) |

const double& ptv::operator[] | ( | int | i | ) | const

double & ptv::operator[] | ( | int | i | ) |

| Definition at line 48 of file syfi/ptv.cpp. References v.
    00048                                {
    00049   return v[i];
    00050 }

const double & ptv::operator[] | ( | int | i | ) | const

| Definition at line 44 of file syfi/ptv.cpp. References v.
    00044                                            {
    00045   return v[i];
    00046 }

const int ptv::size | ( |  | ) | const

const int ptv::size | ( |  | ) | const

| Definition at line 42 of file syfi/ptv.cpp. References dim. Referenced by is_less(), operator<<(), operator=(), and ptv().
    00042 { return dim;}

## Member Data Documentation

int ptv::dim`[private]`

| Definition at line 9 of file syfi/ptv.h. Referenced by is_less(), operator=(), ptv(), size(), and ~ptv().

static double ptv::tol = 10e-6`[static, private]`

| Definition at line 11 of file syfi/ptv.h. Referenced by is_less().

double* ptv::v`[private]`

| Definition at line 10 of file tests/ptv.h.

double* ptv::v`[private]`

| Definition at line 10 of file syfi/ptv.h. Referenced by is_less(), operator=(), operator[](), ptv(), and ~ptv().

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

- syfi/ptv.h
- tests/ptv.h
- syfi/ptv.cpp
- tests/ptv.cpp