9 #ifndef BALL_MOLMEC_MINIMIZATION_ENERGYMINIMIZER_H
10 #define BALL_MOLMEC_MINIMIZATION_ENERGYMINIMIZER_H
12 #ifndef BALL_DATATYPE_OPTIONS_H
16 #ifndef BALL_MOLMEC_COMMON_GRADIENT_H
23 class SnapShotManager;
136 EnergyMinimizer(const EnergyMinimizer& energy_minimizer);
140 virtual ~EnergyMinimizer();
149 const EnergyMinimizer& operator=(const EnergyMinimizer& energy_minimizer);
155 bool operator == (const EnergyMinimizer& energy_minimizer) ;
163 bool isValid() const;
189 virtual
bool specificSetup();
208 virtual
bool isConverged() const;
218 virtual
double findStep();
224 virtual
void updateDirection();
230 virtual
double updateEnergy();
236 virtual
void updateForces();
243 void storeGradientEnergy();
252 virtual
void printEnergy() const;
262 virtual
void takeSnapShot() const;
282 virtual
void finishIteration();
286 Size getNumberOfIterations() const;
302 double getEnergy() const;
310 double getInitialEnergy() const;
314 double& getInitialEnergy();
318 void setNumberOfIterations(
Size number_of_iterations);
322 Size getMaxNumberOfIterations() const;
326 void setMaxNumberOfIterations(
Size number_of_iterations);
331 void setMaxSameEnergy(
Size number);
336 Size getMaxSameEnergy() const;
340 void setEnergyOutputFrequency(
Size energy_output_frequency);
344 Size getEnergyOutputFrequency() const;
348 void setEnergyDifferenceBound(
float energy_difference_bound);
352 float getEnergyDifferenceBound() const;
357 void setMaxGradient(
float max_gradient);
362 float getMaxGradient() const;
367 void setMaximumDisplacement(
float maximum_displacement);
371 float getMaximumDisplacement() const;
375 void setSnapShotFrequency(
Size snapshot_frequency);
379 Size getSnapShotFrequency() const;
387 Size getForceUpdateCounter() const ;
391 Size getEnergyUpdateCounter() const ;
404 virtual
bool minimize(
Size steps = 0,
bool resume = false);
408 void enableEnergyAbortCondition(
bool state);
411 bool energyAbortConditionEnabled() const;
417 void setEnergyToAbort(
float value);
420 float getEnergyToAbort() const;
425 bool wasAborted() const ;
453 double initial_energy_;
457 double current_energy_;
491 Size maximal_number_of_iterations_;
504 double energy_difference_bound_;
508 double max_gradient_;
522 float maximum_displacement_;
545 bool abort_by_energy_enabled_;
558 #endif // BALL_MOLMEC_MINIMIZATION_ENERGYMINIMIZER_H