Loading...
Searching...
No Matches
gradient.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: gradient.h,v 1.20.20.1 2007/05/18 12:02:44 oliver Exp $
//
// Author:
// Oliver Kohlbacher
//
// A conjugate gradient minimizer for geometry optimisation
#ifndef BALL_MOLMEC_COMMON_GRADIENT_H
#define BALL_MOLMEC_COMMON_GRADIENT_H
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifndef BALL_MATHS_VECTOR3_H
# include <BALL/MATHS/vector3.h>
#endif
#include <vector>
namespace BALL
{
class AtomVector;
class BALL_EXPORT Gradient
: private std::vector<Vector3>
{
public:
BALL_CREATE_DEEP(Gradient)
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;
Gradient();
Gradient(const AtomVector& atoms);
Gradient(const Gradient& gradient, bool deep = true);
virtual ~Gradient();
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;
/* Return the number of components of the gradient.
*/
using std::vector<Vector3>::size;
/* Return the component for an atom.
*/
//?????: GCC3 using std::vector<Vector3>::operator [];
const Vector3& operator [] (int i) const { return std::vector<Vector3>::operator [] (i); }
Vector3& operator [] (int i) { return std::vector<Vector3>::operator [] (i); }
void invalidate();
bool isValid() const;
//?????: GCC3 using std::vector<Vector3>::begin;
Iterator begin() { return vector<Vector3>::begin(); }
ConstIterator begin() const { return vector<Vector3>::begin(); }
//?????: GCC3 using std::vector<Vector3>::end;
Iterator end() { return vector<Vector3>::end(); }
ConstIterator end() const { return vector<Vector3>::end(); }
//?????: GCC3 using std::vector<Vector3>::begin;
ReverseIterator rbegin() { return vector<Vector3>::rbegin(); }
ConstReverseIterator rbegin() const { return vector<Vector3>::rbegin(); }
//?????: GCC3 using std::vector<Vector3>::end;
ReverseIterator rend() { return vector<Vector3>::rend(); }
ConstReverseIterator rend() const { return vector<Vector3>::rend(); }
double norm;
double inv_norm;
double rms;
protected:
/*_ The validity flag.
*/
bool valid_;
};
} // end of namespace BALL
#endif // BALL_MOLMEC_COMMON_GRADIENT_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::AtomVector
Definition atomVector.h:31
BALL::Gradient::isValid
bool isValid() const
BALL::Gradient::ReverseIterator
std::vector< Vector3 >::reverse_iterator ReverseIterator
Definition gradient.h:64
BALL::Gradient::Gradient
Gradient()
BALL::Gradient::rend
ConstReverseIterator rend() const
Definition gradient.h:180
BALL::Gradient::end
ConstIterator end() const
Definition gradient.h:168
BALL::Gradient::negate
void negate()
BALL::Gradient::inv_norm
double inv_norm
Definition gradient.h:193
BALL::Gradient::set
void set(const Gradient &gradient)
BALL::Gradient::ConstIterator
std::vector< Vector3 >::const_iterator ConstIterator
Definition gradient.h:60
BALL::Gradient::norm
double norm
Definition gradient.h:189
BALL::Gradient::end
Iterator end()
Definition gradient.h:167
BALL::Gradient::rend
ReverseIterator rend()
Definition gradient.h:179
BALL::Gradient::invalidate
void invalidate()
BALL::Gradient::begin
ConstIterator begin() const
Definition gradient.h:162
BALL::Gradient::begin
Iterator begin()
Definition gradient.h:161
BALL::Gradient::valid_
bool valid_
Definition gradient.h:205
BALL::Gradient::normalize
void normalize()
BALL::Gradient::rbegin
ConstReverseIterator rbegin() const
Definition gradient.h:174
BALL::Gradient::rbegin
ReverseIterator rbegin()
Definition gradient.h:173
BALL::Gradient::ConstReverseIterator
std::vector< Vector3 >::const_reverse_iterator ConstReverseIterator
Definition gradient.h:68
BALL::Gradient::Iterator
std::vector< Vector3 >::iterator Iterator
Definition gradient.h:56
BALL::Gradient::rms
double rms
Definition gradient.h:197
common.h
BALL_CREATE_DEEP
#define BALL_CREATE_DEEP(name)
Definition create.h:26
BALL::atoms
BALL_EXPORT AtomList atoms(const AtomContainer &fragment, const String &expression=String())
BALL
Definition constants.h:13
BALL::Vector3
TVector3< float > Vector3
Definition vector3.h:1084
std
STL namespace.
vector3.h