#include <simplex.h>
Public Member Functions | |
Simplex (int dimension) | |
~Simplex () | |
Vec_DP & | operator[] (int i) const |
int | high (double *val=0) const |
int | low (double *val=0) const |
void | centroid (Vec_DP &vec) const |
double | size () const |
int | reflect () |
int | reflect_exp () |
int | contract () |
void | reduce () |
Public Attributes | |
CoordCalcFunction * | functionObject |
Private Attributes | |
int | nverts |
Vec_DP ** | verts |
int | dim |
Definition at line 16 of file simplex.h.
Simplex::Simplex | ( | int | dimension | ) |
Simplex::~Simplex | ( | ) |
Definition at line 28 of file simplex.cc.
void Simplex::centroid | ( | Vec_DP & | vec | ) | const |
Definition at line 69 of file simplex.cc.
Referenced by contract(), reflect(), reflect_exp(), and size().
int Simplex::contract | ( | ) |
Definition at line 116 of file simplex.cc.
Referenced by CoordCalcFunction::simplex_min().
int Simplex::high | ( | double * | val = 0 |
) | const |
Definition at line 35 of file simplex.cc.
Referenced by centroid(), contract(), reflect(), reflect_exp(), and CoordCalcFunction::simplex_min().
00036 { 00037 double test; 00038 double max = functionObject->f(*verts[0]); 00039 int idx = 0; 00040 for (int i=1; i<nverts; i++) { 00041 test = functionObject->f(*verts[i]); 00042 if (test > max) { 00043 max = test; 00044 idx = i; 00045 } 00046 } 00047 if (0 != val) 00048 *val = max; 00049 return idx; 00050 }
int Simplex::low | ( | double * | val = 0 |
) | const |
Definition at line 52 of file simplex.cc.
Referenced by reduce(), and CoordCalcFunction::simplex_min().
00053 { 00054 double test; 00055 double min = functionObject->f(*verts[0]);; 00056 int idx = 0; 00057 for (int i=1; i<nverts; i++) { 00058 test = functionObject->f(*verts[i]); 00059 if (test < min) { 00060 min = test; 00061 idx = i; 00062 } 00063 } 00064 if (0 != val) 00065 *val = min; 00066 return idx; 00067 }
Vec_DP& Simplex::operator[] | ( | int | i | ) | const [inline] |
void Simplex::reduce | ( | ) |
Definition at line 126 of file simplex.cc.
Referenced by CoordCalcFunction::simplex_min().
int Simplex::reflect | ( | ) |
Definition at line 96 of file simplex.cc.
Referenced by CoordCalcFunction::simplex_min().
int Simplex::reflect_exp | ( | ) |
Definition at line 106 of file simplex.cc.
Referenced by CoordCalcFunction::simplex_min().
double Simplex::size | ( | ) | const |
Definition at line 83 of file simplex.cc.
Referenced by CoordCalcFunction::simplex_min().
int Simplex::dim [private] |
Definition at line 21 of file simplex.h.
Referenced by centroid(), contract(), reflect(), reflect_exp(), Simplex(), and size().
Definition at line 24 of file simplex.h.
Referenced by high(), low(), and CoordCalcFunction::simplex_min().
int Simplex::nverts [private] |
Definition at line 19 of file simplex.h.
Referenced by centroid(), high(), low(), reduce(), Simplex(), size(), and ~Simplex().
Vec_DP** Simplex::verts [private] |
Definition at line 20 of file simplex.h.
Referenced by centroid(), contract(), high(), low(), operator[](), reduce(), reflect(), reflect_exp(), Simplex(), size(), and ~Simplex().