BALL 1.5.0
Loading...
Searching...
No Matches
BALL::StrangLBFGSMinimizer Class Reference

#include <BALL/MOLMEC/MINIMIZATION/strangLBFGS.h>

Inheritance diagram for BALL::StrangLBFGSMinimizer:
BALL::EnergyMinimizer

Classes

struct  Option
struct  Default

Public Member Functions

Constructors and Destructors
 StrangLBFGSMinimizer ()
 StrangLBFGSMinimizer (ForceField &force_field)
 StrangLBFGSMinimizer (ForceField &force_field, SnapShotManager *ssm)
 StrangLBFGSMinimizer (ForceField &force_field, SnapShotManager *ssm, const Options &options)
 StrangLBFGSMinimizer (ForceField &force_field, const Options &options)
 StrangLBFGSMinimizer (const StrangLBFGSMinimizer &rhs)
virtual ~StrangLBFGSMinimizer ()
Assignments
const StrangLBFGSMinimizeroperator= (const StrangLBFGSMinimizer &rhs)
Setup methods. They do all necessary preparations.
virtual bool specificSetup ()
Accessors
void setMaxNumOfStoredVectPairs (Size num)
Size getMaxNumOfStoredVectPairs () const
void setImprovedFlag (bool flag)
bool getImprovedFlag () const
virtual double findStep ()
virtual void updateDirection ()
virtual bool minimize (Size iterations=0, bool resume=false)
Public Member Functions inherited from BALL::EnergyMinimizer
 EnergyMinimizer ()
 EnergyMinimizer (ForceField &force_field)
 EnergyMinimizer (ForceField &force_field, const Options &options)
 EnergyMinimizer (const EnergyMinimizer &energy_minimizer)
virtual ~EnergyMinimizer ()
const EnergyMinimizeroperator= (const EnergyMinimizer &energy_minimizer)
bool operator== (const EnergyMinimizer &energy_minimizer)
bool isValid () const
bool setup (ForceField &force_field)
bool setup (ForceField &force_field, SnapShotManager *ssm)
bool setup (ForceField &force_field, SnapShotManager *ssm, const Options &options)
bool setup (ForceField &force_field, const Options &options)
virtual bool isConverged () const
virtual double updateEnergy ()
virtual void updateForces ()
void storeGradientEnergy ()
virtual void printEnergy () const
virtual void takeSnapShot () const
virtual void finishIteration ()
Size getNumberOfIterations () const
GradientgetDirection ()
GradientgetGradient ()
GradientgetInitialGradient ()
double getEnergy () const
doublegetEnergy ()
double getInitialEnergy () const
doublegetInitialEnergy ()
void setNumberOfIterations (Size number_of_iterations)
Size getMaxNumberOfIterations () const
void setMaxNumberOfIterations (Size number_of_iterations)
void setMaxSameEnergy (Size number)
Size getMaxSameEnergy () const
void setEnergyOutputFrequency (Size energy_output_frequency)
Size getEnergyOutputFrequency () const
void setEnergyDifferenceBound (float energy_difference_bound)
float getEnergyDifferenceBound () const
void setMaxGradient (float max_gradient)
float getMaxGradient () const
void setMaximumDisplacement (float maximum_displacement)
float getMaximumDisplacement () const
void setSnapShotFrequency (Size snapshot_frequency)
Size getSnapShotFrequency () const
ForceFieldgetForceField ()
Size getForceUpdateCounter () const
Size getEnergyUpdateCounter () const
void enableEnergyAbortCondition (bool state)
bool energyAbortConditionEnabled () const
 Query if the MDSimulation aborts if the Energy is greater than abort_energy_.
void setEnergyToAbort (float value)
float getEnergyToAbort () const
bool wasAborted () const

Protected Attributes

Protected Attributes
LineSearch line_search_
bool first_iter_
Size number_of_atoms_
Size max_num_of_vect_pairs_
Size curr_num_of_vect_pairs_
bool improved_
vector< float > rho_
vector< Vector3stored_s_
vector< Vector3stored_y_
vector< float > work_val_
Size index_of_free_vect_
std::vector< Vector3initial_atoms_
Protected Attributes inherited from BALL::EnergyMinimizer
Gradient initial_grad_
Gradient current_grad_
double initial_energy_
double current_energy_
Gradient old_grad_
double old_energy_
Gradient direction_
bool valid_
SnapShotManagersnapshot_
ForceFieldforce_field_
Size number_of_iterations_
Size maximal_number_of_iterations_
Size energy_output_frequency_
Size snapshot_frequency_
double energy_difference_bound_
double max_gradient_
Size max_same_energy_
Size same_energy_counter_
float maximum_displacement_
Size force_update_counter_
Size energy_update_counter_
float cutlo_
double step_
bool abort_by_energy_enabled_
float abort_energy_
bool aborted_

Additional Inherited Members

Public Attributes inherited from BALL::EnergyMinimizer
Options options

Detailed Description

Limited-memory BFGS minimizer based on the Strang recurrence. A minimizer for geometry optimization based on the limited-memory BFGS method proposed in

[1] Nocedal J.: Updating quasi-Newton matrices with limited storage. Math. Comp. 35 (1980) 773-782.

[2] Liu D.C., Nocedal J.: On the limited memory BFGS method for large scale optimization. Math. Programming 45 (1989) 503-528.

If the 'improved' option is set, ideas proposed in

[3] Mehiddin Al-Baali: Improved Hessian approximations for the limited memory BFGS method. Numerical Algorithms 22 (1999) 99-112

are adopted.

Definition at line 38 of file strangLBFGS.h.

Constructor & Destructor Documentation

◆ StrangLBFGSMinimizer() [1/6]

BALL::StrangLBFGSMinimizer::StrangLBFGSMinimizer ( )

Default constructor.

◆ StrangLBFGSMinimizer() [2/6]

BALL::StrangLBFGSMinimizer::StrangLBFGSMinimizer ( ForceField & force_field)

Constructor expecting a valid force field

◆ StrangLBFGSMinimizer() [3/6]

BALL::StrangLBFGSMinimizer::StrangLBFGSMinimizer ( ForceField & force_field,
SnapShotManager * ssm )

Constructor expecting a valid force field and a snapshot manager

◆ StrangLBFGSMinimizer() [4/6]

BALL::StrangLBFGSMinimizer::StrangLBFGSMinimizer ( ForceField & force_field,
SnapShotManager * ssm,
const Options & options )

Constructor expecting a valid force field, a snapshot manager and options

◆ StrangLBFGSMinimizer() [5/6]

BALL::StrangLBFGSMinimizer::StrangLBFGSMinimizer ( ForceField & force_field,
const Options & options )

Constructor expecting a valid force field and options

◆ StrangLBFGSMinimizer() [6/6]

BALL::StrangLBFGSMinimizer::StrangLBFGSMinimizer ( const StrangLBFGSMinimizer & rhs)

Copy constructor

◆ ~StrangLBFGSMinimizer()

virtual BALL::StrangLBFGSMinimizer::~StrangLBFGSMinimizer ( )
virtual

Destructor.

Member Function Documentation

◆ findStep()

virtual double BALL::StrangLBFGSMinimizer::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 BALL::EnergyMinimizer.

◆ getImprovedFlag()

bool BALL::StrangLBFGSMinimizer::getImprovedFlag ( ) const

Return the improved flag

◆ getMaxNumOfStoredVectPairs()

Size BALL::StrangLBFGSMinimizer::getMaxNumOfStoredVectPairs ( ) const

Return the maximum number of stored vector pairs

◆ minimize()

virtual bool BALL::StrangLBFGSMinimizer::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
iterationsthe maximum number of iterations
resumetrue to resume a previous run
See also
EnergyMinimizer::minimize

Reimplemented from BALL::EnergyMinimizer.

◆ operator=()

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

Assignment operator

◆ setImprovedFlag()

void BALL::StrangLBFGSMinimizer::setImprovedFlag ( bool flag)

Set the improved flag

◆ setMaxNumOfStoredVectPairs()

void BALL::StrangLBFGSMinimizer::setMaxNumOfStoredVectPairs ( Size num)

Set the maximum number of stored vector pairs

◆ specificSetup()

virtual bool BALL::StrangLBFGSMinimizer::specificSetup ( )
virtual

Specific setup

Reimplemented from BALL::EnergyMinimizer.

◆ updateDirection()

virtual void BALL::StrangLBFGSMinimizer::updateDirection ( )
virtual

Update the stored vector pairs, either by adding a new pair or if there is no space left by replacing the oldest pair. Compute the search direction afterwards by using the Strang recurrence formula (optional: with an improvement idea of Al-Baali).

Reimplemented from BALL::EnergyMinimizer.

Member Data Documentation

◆ curr_num_of_vect_pairs_

Size BALL::StrangLBFGSMinimizer::curr_num_of_vect_pairs_
protected

Current number of stored vector pairs.

Definition at line 200 of file strangLBFGS.h.

◆ first_iter_

bool BALL::StrangLBFGSMinimizer::first_iter_
protected

Is this an initial first iteration?

Definition at line 188 of file strangLBFGS.h.

◆ improved_

bool BALL::StrangLBFGSMinimizer::improved_
protected

Should the improved version be used?

Definition at line 204 of file strangLBFGS.h.

◆ index_of_free_vect_

Size BALL::StrangLBFGSMinimizer::index_of_free_vect_
protected

Index of the vector pair which will be used for saving the data of the current step (usually by replacing old data).

Definition at line 227 of file strangLBFGS.h.

◆ initial_atoms_

std::vector<Vector3> BALL::StrangLBFGSMinimizer::initial_atoms_
protected

Positions of movable atoms when starting an iteration. This is used to reduce slightly rounding errors

Definition at line 232 of file strangLBFGS.h.

◆ line_search_

LineSearch BALL::StrangLBFGSMinimizer::line_search_
protected

The line search

Definition at line 184 of file strangLBFGS.h.

◆ max_num_of_vect_pairs_

Size BALL::StrangLBFGSMinimizer::max_num_of_vect_pairs_
protected

Maximum number of stored vector pairs.

Definition at line 196 of file strangLBFGS.h.

◆ number_of_atoms_

Size BALL::StrangLBFGSMinimizer::number_of_atoms_
protected

Number of movable atoms.

Definition at line 192 of file strangLBFGS.h.

◆ rho_

vector<float> BALL::StrangLBFGSMinimizer::rho_
protected

Old and new scaling values. Also used in the Strang recurrence formula.

Definition at line 208 of file strangLBFGS.h.

◆ stored_s_

vector<Vector3> BALL::StrangLBFGSMinimizer::stored_s_
protected

Stored former steps. Vectors stored in column order.

Definition at line 212 of file strangLBFGS.h.

◆ stored_y_

vector<Vector3> BALL::StrangLBFGSMinimizer::stored_y_
protected

Stored former changes in gradients. Vectors stored in column order.

Definition at line 217 of file strangLBFGS.h.

◆ work_val_

vector<float> BALL::StrangLBFGSMinimizer::work_val_
protected

Temporarily used memory for saving scalars associated with the stored vector pairs.

Definition at line 222 of file strangLBFGS.h.