BALL::Gradient Class Reference
[General Force Field Classes.]

#include <BALL/MOLMEC/COMMON/gradient.h>

Inherits std::vector<Vector3>.

List of all members.


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
Gradientoperator= (const Gradient &rhs)
Gradientoperator= (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 Vector3operator[] (int i) const
Vector3operator[] (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_

Detailed Description

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.


Member Typedef Documentation

typedef std::vector<Vector3>::const_iterator BALL::Gradient::ConstIterator

Const iterator type

typedef std::vector<Vector3>::const_reverse_iterator BALL::Gradient::ConstReverseIterator

Const iterator type

typedef std::vector<Vector3>::iterator BALL::Gradient::Iterator

Type definitions Iterator type

typedef std::vector<Vector3>::reverse_iterator BALL::Gradient::ReverseIterator

Iterator type


Constructor & Destructor Documentation

BALL::Gradient::Gradient (  ) 

Default constructor.

BALL::Gradient::Gradient ( const AtomVector atoms  ) 

Construct from atom forces

BALL::Gradient::Gradient ( const Gradient gradient,
bool  deep = true 
)

Copy constructor

virtual BALL::Gradient::~Gradient (  )  [virtual]

Destructor.


Member Function Documentation

ConstIterator BALL::Gradient::begin (  )  const [inline]
Iterator BALL::Gradient::begin (  )  [inline]

Return an iterator to the begining of the vector

ConstIterator BALL::Gradient::end (  )  const [inline]
Iterator BALL::Gradient::end (  )  [inline]

Return a past-the-end vector.

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

double BALL::Gradient::operator* ( const Gradient gradient  )  const

Dot product operator

Exceptions:
InvalidRange if the two gradients have different sizes
Gradient& BALL::Gradient::operator= ( const AtomVector rhs  ) 

Assign from an array of atom pointers.

Gradient& BALL::Gradient::operator= ( const Gradient rhs  ) 

Assignment operator

Vector3& BALL::Gradient::operator[] ( int  i  )  [inline]
const Vector3& BALL::Gradient::operator[] ( int  i  )  const [inline]
ConstReverseIterator BALL::Gradient::rbegin (  )  const [inline]
ReverseIterator BALL::Gradient::rbegin (  )  [inline]

Return an iterator to the reverse begining of the vector

ConstReverseIterator BALL::Gradient::rend (  )  const [inline]
ReverseIterator BALL::Gradient::rend (  )  [inline]

Return a reverse past-the-end vector.

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


Member Data Documentation

The inverse of the gradient norm.

The gradient norm.

The root mean square of the gradient.