#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 definitions Iterator 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 BALL::Gradient::~Gradient | ( | ) | [virtual] |
Destructor.
ConstIterator BALL::Gradient::begin | ( | ) | const [inline] |
Definition at line 162 of file gradient.h.
Iterator BALL::Gradient::begin | ( | ) | [inline] |
Return an iterator to the begining of the vector
Definition at line 161 of file gradient.h.
ConstIterator BALL::Gradient::end | ( | ) | const [inline] |
Definition at line 168 of file gradient.h.
Iterator BALL::Gradient::end | ( | ) | [inline] |
Return a past-the-end vector.
Definition at line 167 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.
Vector3& BALL::Gradient::operator[] | ( | int | i | ) | [inline] |
Definition at line 142 of file gradient.h.
const Vector3& BALL::Gradient::operator[] | ( | int | i | ) | const [inline] |
Definition at line 141 of file gradient.h.
ConstReverseIterator BALL::Gradient::rbegin | ( | ) | const [inline] |
Definition at line 174 of file gradient.h.
ReverseIterator BALL::Gradient::rbegin | ( | ) | [inline] |
Return an iterator to the reverse begining of the vector
Definition at line 173 of file gradient.h.
ConstReverseIterator BALL::Gradient::rend | ( | ) | const [inline] |
Definition at line 180 of file gradient.h.
ReverseIterator BALL::Gradient::rend | ( | ) | [inline] |
Return a reverse past-the-end vector.
Definition at line 179 of file gradient.h.
void BALL::Gradient::set | ( | const AtomVector & | atoms | ) |
Assign from an array of atom pointers.
void BALL::Gradient::set | ( | const Gradient & | gradient | ) |
Assign from another gradient
The inverse of the gradient norm.
Definition at line 193 of file gradient.h.
The gradient norm.
Definition at line 189 of file gradient.h.
The root mean square of the gradient.
Definition at line 197 of file gradient.h.
bool BALL::Gradient::valid_ [protected] |
Definition at line 205 of file gradient.h.