#include <total_energy_function.h>
Class diagram for total_energy_function:

Public Members | |||
![]() | ![]() | total_energy_function ( const double t ) | |
![]() | ![]() | The only constructur for a total_energy_function. More... | |
![]() | ![]() | virtual | ~total_energy_function (void) |
![]() | ![]() | virtual double | operator() ( const vector<double> &x ) const |
![]() | ![]() | Calculate the function for a given value. More... | |
![]() | ![]() | virtual void | evaluate ( const vector<double> &x, double &f, vector<double> &gradient ) const |
![]() | ![]() | Calculate the function and its gradient for a given value. More... | |
![]() | ![]() | double | tol (void) const |
![]() | ![]() | Get the calculation tolerance. More... | |
![]() | ![]() | unsigned | n_vars (void) const |
![]() | ![]() | Get the dimensionality of the function. More... | |
![]() | ![]() | vector<double> | current_var (void) const |
![]() | ![]() | Convert the current corodinates of the points() to a vector suitable for energy computation by this function. More... | |
![]() | ![]() | const vector< vector2 * >* | points (void) const |
![]() | ![]() | The set of points for which this function calculates the energy. | |
![]() | ![]() | const set< vector2 * >* | fixed_points (void) const |
![]() | ![]() | Those points() that have fixed positions. More... | |
![]() | ![]() | const vector< constraint * >* | constraints (void) const |
![]() | ![]() | The set of constraints that determine the energy computed by this function. | |
![]() | ![]() | void | set_tol ( const double t ) |
![]() | ![]() | Set the calculation tolerance. More... | |
![]() | ![]() | void | move_points ( const vector<double> & x ) const |
![]() | ![]() | Change the point positions, so they correspond to the coordinates stored in a given vector. More... | |
Friends | |||
![]() | ![]() | void | assoc ( total_energy_function &f, const vector< vector2 *> &po, const set< vector2 *> &fp, const vector< constraint *> &co ) |
![]() | ![]() | Associate a total_energy_function with points and constraints. More... | |
The total energy is a measure of how well the constraints are satisifed.
The point positions are represented by a single vector, which contains the x and y coordinates of the points. The class provides member functions for converting the point positions to (the current_var() member function) and from (the move_points(vector<double>) member function) this vector form.
Definition at line 55 of file total_energy_function.h.
| total_energy_function::total_energy_function (const double t) |
The only constructur for a total_energy_function.
| t |
the calculation tolerance to use
|
assert( 0 < t && t < 1 );
assert( this->tol() == t ); assert( this->points() == 0 ); assert( this->fixed_points() == 0 ); assert( this->constraints() == 0 );
Definition at line 39 of file total_energy_function.cpp.
total_energy_function::~total_energy_function (void) [virtual]
|
Definition at line 63 of file total_energy_function.cpp.
double total_energy_function::operator() (const vector<double>& x) const [virtual]
|
Calculate the function for a given value.
Smaller values of the function indicate that the constraints are better met. The value of the function is equal to the sum of the energy contributes of each of the constraints().
| x | the value for which the function is to be calculated; this indicates the positions of the constrained points, in the form of a single vector holding the point coordinates |
assert( this->points() ); assert( this->fixed_points() ); assert( this->constraints() ); assert( x.size() == this->n_vars() );
Reimplemented from func::multi_dimensional.
Definition at line 142 of file total_energy_function.cpp.
void total_energy_function::evaluate (const vector<double>& x, double & e, vector<double>& gradient) const [virtual]
|
Calculate the function and its gradient for a given value.
Smaller values of the function indicate that the constraints are better met. The value of the function is equal to the sum of the energy contributes of each of the constraints().
| x | the value for which the function is to be calculated; this indicates the positions of the constrained points, in the form of a single vector holding the point coordinates |
| f | the value of the function for argument x |
| gradient |
the rate of change of f w.r.t. x
|
assert( this->points() ); assert( this->fixed_points() ); assert( this->constraints() ); assert( x.size() == this->n_vars() );
Reimplemented from func::multi_dimensional_with_derivatives.
Definition at line 162 of file total_energy_function.cpp.
double total_energy_function::tol (void) const [inline]
|
Get the calculation tolerance.
Definition at line 287 of file total_energy_function.h.
unsigned total_energy_function::n_vars (void) const [inline]
|
Get the dimensionality of the function.
That is, the number of elements in the vector that this is a function of.
assert( this->points() ); assert( this->fixed_points() );
Definition at line 294 of file total_energy_function.h.
| vector<double> total_energy_function::current_var (void) const |
Convert the current corodinates of the points() to a vector suitable for energy computation by this function.
assert( this->points() ); assert( this->fixed_points() );
Definition at line 217 of file total_energy_function.cpp.
const vector<vector2 *>* total_energy_function::points (void) const [inline]
|
The set of points for which this function calculates the energy.
Definition at line 304 of file total_energy_function.h.
const set<vector2 *>* total_energy_function::fixed_points (void) const [inline]
|
Those points() that have fixed positions.
These points do not have corresponding entries in the current_var() vector.
Definition at line 311 of file total_energy_function.h.
const vector<constraint *>* total_energy_function::constraints (void) const [inline]
|
The set of constraints that determine the energy computed by this function.
Definition at line 318 of file total_energy_function.h.
| void total_energy_function::set_tol (const double t) |
Set the calculation tolerance.
assert( 0 < t && t < 1 );
assert( this->tol() == t );
Definition at line 70 of file total_energy_function.cpp.
| void total_energy_function::move_points (const vector<double>& x) const |
Change the point positions, so they correspond to the coordinates stored in a given vector.
assert( x.size() == this->n_vars() );
assert( this->current_var() == x );
Definition at line 248 of file total_energy_function.cpp.
void assoc (total_energy_function & f, const vector<vector2 *>& po, const set<vector2 *>& fp, const vector<constraint *>& co) [friend]
|
Associate a total_energy_function with points and constraints.
assert( f.points() == 0 ); assert( f.fixed_points() == 0 ); assert( f.constraints() == 0 ); assert( fp.size() <= po.size() );
assert( f.points() == &po ); assert( f.fixed_points() == &fp ); assert( f.constraints() == &co );
Definition at line 85 of file total_energy_function.h.
1.0.0 written by Dimitri van Heesch,
© 1997-1999