BALL
1.4.79
|
#include <BALL/MOLMEC/COMMON/gradient.h>
Public Types | |
typedef std::vector< Vector3 > ::iterator | Iterator |
typedef std::vector< Vector3 > ::const_iterator | ConstIterator |
typedef std::vector< Vector3 > ::reverse_iterator | ReverseIterator |
typedef std::vector< Vector3 > ::const_reverse_iterator | ConstReverseIterator |
Public Member Functions | |
Constructors and Destructors | |
Gradient () | |
Gradient (const AtomVector &atoms) | |
Gradient (const Gradient &gradient, bool deep=true) | |
virtual | ~Gradient () |
Assignments | |
Gradient & | operator= (const Gradient &rhs) |
Gradient & | operator= (const AtomVector &rhs) |
void | set (const Gradient &gradient) |
void | set (const AtomVector &atoms) |
void | negate () |
void | normalize () |
double | operator* (const Gradient &gradient) const |
Accessors | |
const Vector3 & | operator[] (int i) const |
Vector3 & | operator[] (int i) |
void | invalidate () |
bool | isValid () const |
Iteration | |
Iterator | begin () |
ConstIterator | begin () const |
Iterator | end () |
ConstIterator | end () const |
ReverseIterator | rbegin () |
ConstReverseIterator | rbegin () const |
ReverseIterator | rend () |
ConstReverseIterator | rend () const |
Public Attributes | |
Public Attributes | |
double | norm |
double | inv_norm |
double | rms |
Protected Attributes | |
bool | valid_ |
Gradient class. This class is used in the Minimizers to represent gradients and directions. These gradients are extracted from a vector of atom pointers, if the forces of the atoms are correctly set (e.g. using ForceField::updateForces()). The gradient contains the negative forces from each atom. Forces are converted from Newton (N) to units of f$kJ/(mol )f$. A gradient may be invalidated by calling invalidate . This method only flags the gradient as invalid, the data is untouched. This may be used to initiate automatic recalculations of the gradient. This class is used by all minimizer classes.
Definition at line 43 of file gradient.h.
typedef std::vector<Vector3>::const_iterator BALL::Gradient::ConstIterator |
Const iterator type
Definition at line 60 of file gradient.h.
typedef std::vector<Vector3>::const_reverse_iterator BALL::Gradient::ConstReverseIterator |
Const iterator type
Definition at line 68 of file gradient.h.
typedef std::vector<Vector3>::iterator BALL::Gradient::Iterator |
Type definitionsIterator type
Definition at line 56 of file gradient.h.
typedef std::vector<Vector3>::reverse_iterator BALL::Gradient::ReverseIterator |
Iterator type
Definition at line 64 of file gradient.h.
BALL::Gradient::Gradient | ( | ) |
Default constructor.
BALL::Gradient::Gradient | ( | const AtomVector & | atoms | ) |
Construct from atom forces
|
virtual |
Destructor.
|
inline |
Return an iterator to the begining of the vector
Definition at line 161 of file gradient.h.
|
inline |
Definition at line 162 of file gradient.h.
|
inline |
Return a past-the-end vector.
Definition at line 167 of file gradient.h.
|
inline |
Definition at line 168 of file gradient.h.
void BALL::Gradient::invalidate | ( | ) |
Invalidate the gradient.
bool BALL::Gradient::isValid | ( | ) | const |
Return the validity flag.
void BALL::Gradient::negate | ( | ) |
Negate the gradient. Iterate over all force vectors of the gradient and invert the signs.
void BALL::Gradient::normalize | ( | ) |
Normalize the gradient. Rescale to unity length
Dot product operator
InvalidRange | if the two gradients have different sizes |
Gradient& BALL::Gradient::operator= | ( | const AtomVector & | rhs | ) |
Assign from an array of atom pointers.
|
inline |
Definition at line 141 of file gradient.h.
|
inline |
Definition at line 142 of file gradient.h.
|
inline |
Return an iterator to the reverse begining of the vector
Definition at line 173 of file gradient.h.
|
inline |
Definition at line 174 of file gradient.h.
|
inline |
Return a reverse past-the-end vector.
Definition at line 179 of file gradient.h.
|
inline |
Definition at line 180 of file gradient.h.
void BALL::Gradient::set | ( | const Gradient & | gradient | ) |
Assign from another gradient
void BALL::Gradient::set | ( | const AtomVector & | atoms | ) |
Assign from an array of atom pointers.
double BALL::Gradient::inv_norm |
The inverse of the gradient norm.
Definition at line 193 of file gradient.h.
double BALL::Gradient::norm |
The gradient norm.
Definition at line 189 of file gradient.h.
double BALL::Gradient::rms |
The root mean square of the gradient.
Definition at line 197 of file gradient.h.
|
protected |
Definition at line 205 of file gradient.h.