APPSPACK::BasePoint Class Reference#include <APPSPACK_BasePoint.H>
Inheritance diagram for APPSPACK::BasePoint:
List of all members.
Detailed Description
Basic point representation.
BasePoint is the base for Point and SearchElement.
For comparing BasePoints (or derived objects), we must be careful about precision so that we get the same results on all hosts, even if their architectures differ. The static epsilon is used to indicate the precision to which function values should be compared.
Definition at line 54 of file APPSPACK_BasePoint.H.
|
Public Member Functions |
| BasePoint () |
| Default constructor.
|
| BasePoint (const BasePoint &source) |
| Copy constructor.
|
virtual | ~BasePoint () |
| Destructor.
|
virtual bool | isSet () const |
| Returns true if x.size() and step are nonzero.
|
BasePoint & | operator= (const BasePoint &source) |
| Copy.
|
void | pack (bool isInitSend) const |
| Pack.
|
void | unpack (int msgTag) |
| Receive the message with the specified tag and then unpack the BasePoint (without epsilon ).
|
void | unpack (bool isInitRecv) |
| Unpack.
|
double & | operator[] (int i) |
| Return reference to x[i].
|
const double & | operator[] (int i) const |
| Return const reference to x[i].
|
bool | operator< (const BasePoint &b) const |
| Compare two BasePoint objects.
|
bool | operator> (const BasePoint &b) const |
| Returns b. BasePoint::operator< (*this).
|
bool | operator== (const vector< double > &y) const |
| Compare a point and a double array numerically.
|
bool | operator== (const BasePoint &b) const |
| Compare x of this and b .
|
void | setX (int len) |
| Set the length of x to len, and initialize x to zeroes.
|
void | setX (const vector< double > &xvec) |
| Set x to xvec .
|
void | setX (int len, const vector< double > &xvec) |
| Set the length of x to len . If xvec.size() == 0, initialize x to zeroes. Otherwise, copy xvec to x .
|
void | setF (bool isFval, double fval=0) |
| If isFval is true, copy fval to f and set isF to true. Otherwise, just set isF to false.
|
bool | getIsF () const |
| Return true if there is a valid function value (i.e., isF is true).
|
double | getF () const |
| Return the function value.
|
void | setStep (double stepval) |
| Set the step length.
|
double | getStep () const |
| Return the step length.
|
vector< double > & | getX () |
| Return a reference to x .
|
const vector< double > & | getX () const |
| Return a const reference to x .
|
int | getN () const |
| Get the size of x .
|
void | newGuid () |
| Generate a new GUID for this point.
|
const GUID & | getGuid () const |
| Return a const reference to guid .
|
virtual ostream & | leftshift (ostream &stream) const |
| Print the basepoint to the given stream.
|
Static Public Member Functions |
void | setEpsilon (double d) |
| Set the epsilon .
|
Static Public Attributes |
double | epsilon = 0.0 |
Static Protected Member Functions |
bool | eq (double alpha, double beta) |
| Determine if == within the specified epsilon.
|
double | fabsmax (double alpha, double beta) |
| Return .
|
Protected Attributes |
vector< double > | x |
| Contains the point.
|
bool | isF |
| True if there a valid function value, f .
|
double | f |
| f(x)
|
double | step |
| Step length.
|
GUID | guid |
| Unique identifier.
|
Constructor & Destructor Documentation
BasePoint::BasePoint |
( |
const BasePoint & |
source |
) |
|
|
Member Function Documentation
bool BasePoint::isSet |
( |
|
) |
const [virtual] |
|
void BasePoint::pack |
( |
bool |
isInitSend |
) |
const |
|
void BasePoint::unpack |
( |
int |
msgTag |
) |
|
|
void BasePoint::unpack |
( |
bool |
isInitRecv |
) |
|
|
double & BasePoint::operator[] |
( |
int |
i |
) |
|
|
const double & BasePoint::operator[] |
( |
int |
i |
) |
const |
|
bool BasePoint::operator< |
( |
const BasePoint & |
b |
) |
const |
|
|
Compare two BasePoint objects.
Let a represent this object. We say if one of the following holds.
- Both
isF and b.isF are true, and BasePoint::eq(f , b.f) is false, and f < b.f. - Both
isF and b.isF are true, and BasePoint::eq(f , b.f) is true, and guid < b.guid (see GUID::operator<). - We have
isF is true and b.isF is false
Definition at line 106 of file APPSPACK_BasePoint.C.
References eq(), f, guid, and isF. |
bool APPSPACK::BasePoint::operator> |
( |
const BasePoint & |
b |
) |
const [inline] |
|
bool BasePoint::operator== |
( |
const vector< double > & |
y |
) |
const |
|
bool BasePoint::operator== |
( |
const BasePoint & |
b |
) |
const |
|
void BasePoint::setX |
( |
int |
len |
) |
|
|
void BasePoint::setX |
( |
const vector< double > & |
xvec |
) |
|
|
void BasePoint::setX |
( |
int |
len, |
|
|
const vector< double > & |
xvec |
|
) |
|
|
|
Set the length of x to len . If xvec.size() == 0, initialize x to zeroes. Otherwise, copy xvec to x .
Definition at line 190 of file APPSPACK_BasePoint.C.
References isSet(), and x. |
void BasePoint::setF |
( |
bool |
isFval, |
|
|
double |
fval = 0 |
|
) |
|
|
bool BasePoint::getIsF |
( |
|
) |
const |
|
double BasePoint::getF |
( |
|
) |
const |
|
void BasePoint::setStep |
( |
double |
stepval |
) |
|
|
double BasePoint::getStep |
( |
|
) |
const |
|
vector< double > & BasePoint::getX |
( |
|
) |
|
|
const vector< double > & BasePoint::getX |
( |
|
) |
const |
|
int BasePoint::getN |
( |
|
) |
const |
|
void BasePoint::newGuid |
( |
|
) |
|
|
const GUID& APPSPACK::BasePoint::getGuid |
( |
|
) |
const [inline] |
|
ostream & BasePoint::leftshift |
( |
ostream & |
stream |
) |
const [virtual] |
|
|
Print the basepoint to the given stream.
Uses scientific notation, where the precision is defined by Utils::precision. Prints the function value if it is known and otherwise prints "<null>". Then prints x, the step, and the guid. For example:
f= 0.00e+00 x=[ 0.00e+00 0.00e+00 ] step=1.00e+00 tag=000_075
Reimplemented in APPSPACK::Point, and APPSPACK::SearchElement.
Definition at line 277 of file APPSPACK_BasePoint.C.
References f, guid, isF, step, and x. |
void BasePoint::setEpsilon |
( |
double |
d |
) |
[static] |
|
bool BasePoint::eq |
( |
double |
alpha, |
|
|
double |
beta |
|
) |
[static, protected] |
|
double BasePoint::fabsmax |
( |
double |
alpha, |
|
|
double |
beta |
|
) |
[static, protected] |
|
Member Data Documentation
|
Contains the point.
Definition at line 200 of file APPSPACK_BasePoint.H.
Referenced by BasePoint(), APPSPACK::SearchElement::fevalStart(), getN(), getX(), APPSPACK::CachePoint::isSet(), isSet(), leftshift(), APPSPACK::CachePoint::operator<(), operator=(), APPSPACK::CachePoint::operator==(), operator==(), operator[](), pack(), setX(), and unpack(). |
|
True if there a valid function value, f .
Definition at line 203 of file APPSPACK_BasePoint.H.
Referenced by BasePoint(), APPSPACK::SearchElement::checkSufficientDecrease(), APPSPACK::SearchElement::fevalReturn(), APPSPACK::SearchElement::fevalStart(), getIsF(), leftshift(), operator<(), operator=(), pack(), setF(), and unpack(). |
|
f(x)
Definition at line 206 of file APPSPACK_BasePoint.H.
Referenced by BasePoint(), APPSPACK::SearchElement::checkSufficientDecrease(), APPSPACK::SearchElement::fevalReturn(), APPSPACK::SearchElement::fevalStart(), getF(), leftshift(), operator<(), operator=(), pack(), setF(), and unpack(). |
|
Step length.
Definition at line 209 of file APPSPACK_BasePoint.H.
Referenced by BasePoint(), APPSPACK::SearchElement::decreaseStep(), APPSPACK::SearchElement::fevalStart(), getStep(), APPSPACK::SearchElement::increaseStep(), APPSPACK::SearchElement::isConverged(), isSet(), leftshift(), APPSPACK::SearchElement::newMin(), operator=(), pack(), setStep(), and unpack(). |
The documentation for this class was generated from the following files:
Generated on Mon Oct 27 15:14:48 2003 for APPSPACK by
1.3.4 written by Dimitri van Heesch,
© 1997-2002
|