Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

ConjugateGradientMinimizer Class Reference
[Energy Minimizer]

A minimizer for geometry optimization based on different conjugate gradient (CG) algorithms. More...

#include <conjugateGradient.h>

Inheritance diagram for ConjugateGradientMinimizer:

EnergyMinimizer List of all members.

Public Types

Enums
enum  UpdateMethod { POLAK_RIBIERE = 1, FLETCHER_REEVES = 2, SHANNO = 3 }
 The different conjugate gradient methods implemented. More...

Public Member Functions

Constructors and Destructors
 ConjugateGradientMinimizer ()
 Default constructor.
 ConjugateGradientMinimizer (ForceField &force_field)
 Constructor expecting a valid force field.
 ConjugateGradientMinimizer (ForceField &force_field, SnapShotManager *ssm)
 Constructor expecting a valid force field and a snapshot manager.
 ConjugateGradientMinimizer (ForceField &force_field, SnapShotManager *ssm, const Options &options)
 Constructor expecting a valid force field, a snapshot manager and options.
 ConjugateGradientMinimizer (ForceField &force_field, const Options &options)
 Constructor expecting a valid force field and options.
 ConjugateGradientMinimizer (const ConjugateGradientMinimizer &rhs)
 Copy constructor.
virtual ~ConjugateGradientMinimizer ()
 Destructor.
Assignments
const ConjugateGradientMinimizeroperator= (const ConjugateGradientMinimizer &rhs)
 Assignment operator.
Setup methods. They do all necessary preparations.
virtual bool specificSetup ()
 Specific setup.
Accessors
void setUpdateMethod (UpdateMethod method)
 Set explicitly the criterion used for updateDirection.
UpdateMethod getUpdateMethod () const
 Returns the current method for updateDirection.
virtual double findStep ()
 Calculate the next step.
virtual void updateDirection ()
 Update the search direction.
virtual bool minimize (Size iterations=0, bool resume=false)
 Minimize the energy of the system.

Protected Attributes

Protected Attributes
LineSearch line_search_
 The line search.
Gradient unscaled_direction_
 Unscaled last search direction.
Size number_of_atoms_
 Number of movable atoms.
Size updt_method_
 Update method used for the CG.
bool first_iter_
 Is this the (initial) first iteration?
double old_gtg_
 $g^T \cdot g$ where $g$ is the gradient of the last iteration
vector< Vector3a_i_
 Variable needed for the Shanno direction calculation.
vector< Vector3b_i_
 Variable needed for the Shanno direction calculation.
vector< Vector3p_t_
 Variable needed for the Shanno direction calculation.
vector< Vector3y_t_
 Variable needed for the Shanno direction calculation.
vector< Vector3p_i_
 Variable needed for the Shanno direction calculation.
vector< Vector3y_i_
 Variable needed for the Shanno direction calculation.
double D_1_
 Variable needed for the Shanno direction calculation.
double D_4_
 Variable needed for the Shanno direction calculation.
Size restart_frequency_
 Frequency for restarts.
Size last_restart_iter_
 We count the iterations since the last restart.

Detailed Description

A minimizer for geometry optimization based on different conjugate gradient (CG) algorithms.

See

[1] Fletcher, R. and Reeves, C.M. "Function Minimization by Conjugate Gradients" Comp. J., 7, 149-154, 1964

[2] David Shanno "Conjugate Gradient Methods With Inexact Searches" Mathematics of Operations Research, Vol. 3, No. 3, August 1978, pp. 244-256

[3] S. Watowich et. al "A Stable Rapidly Converging Conjugate Gradient Method for Energy Minimization" Journal of Computational Chemistry, Vol. 9, No. 6, pp. 650-661 (1988)

[4] M.J.D. Powell "Convergence properties of algorithms for nonlinear optimization" Report No. DAMPT 1985/NA1, University of Cambridge, 1985

[5] D.F. Shanno "Globally convergent conjugate gradient algorithms" Mathematical Programming 33 (1985), pp. 61-67


Member Enumeration Documentation

enum ConjugateGradientMinimizer::UpdateMethod
 

The different conjugate gradient methods implemented.

See also:
updateDirection for details on the implementation and references
Enumeration values:
POLAK_RIBIERE  Polak-Ribiere method.
FLETCHER_REEVES  Fletcher-Reeves method.
SHANNO  Shanno.


Constructor & Destructor Documentation

ConjugateGradientMinimizer::ConjugateGradientMinimizer  ) 
 

Default constructor.

virtual ConjugateGradientMinimizer::~ConjugateGradientMinimizer  )  [virtual]
 

Destructor.


Member Function Documentation

virtual double ConjugateGradientMinimizer::findStep  )  [virtual]
 

Calculate the next step.

First, this method updates the model. Second, it performs a line search along the calculated direction afterwards.

Returns:
double $\geq 0$ if the line search found an acceptable solution, otherwise -1.
See also:
EnergyMinimizer::findStep

Reimplemented from EnergyMinimizer.

UpdateMethod ConjugateGradientMinimizer::getUpdateMethod  )  const
 

Returns the current method for updateDirection.

virtual bool ConjugateGradientMinimizer::minimize Size  iterations = 0,
bool  resume = false
[virtual]
 

Minimize the energy of the system.

This method executes at most iterations minimization steps. If the number of iterations is not given, the number specified in the options is taken.

Parameters:
iterations the maximum number of iterations
resume true to resume a previous run
See also:
EnergyMinimizer::minimize

Reimplemented from EnergyMinimizer.

void ConjugateGradientMinimizer::setUpdateMethod UpdateMethod  method  ) 
 

Set explicitly the criterion used for updateDirection.

If the method is not recognized, this function fails.

virtual void ConjugateGradientMinimizer::updateDirection  )  [virtual]
 

Update the search direction.

This method updates the search direction. It uses the different conjugate gradient caculations dependend on the options.

Reimplemented from EnergyMinimizer.


Member Data Documentation

Size ConjugateGradientMinimizer::last_restart_iter_ [protected]
 

We count the iterations since the last restart.

There are other necessities for a restart so the iteration counter may not coincide (by modulo) with the restart frequency.

Size ConjugateGradientMinimizer::number_of_atoms_ [protected]
 

Number of movable atoms.

Size ConjugateGradientMinimizer::restart_frequency_ [protected]
 

Frequency for restarts.