shiftedLVMM.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: shiftedLVMM.h,v 1.1.4.6 2007/08/07 09:12:35 aleru Exp $ 
00005 //
00006 
00007 #ifndef BALL_MOLMEC_MINIMIZATION_SHIFTEDLVMM_H 
00008 #define BALL_MOLMEC_MINIMIZATION_SHIFTEDLVMM_H 
00009 
00010 #ifndef BALL_MOLMEC_MINIMIZATION_ENERGYMINIMIZER_H
00011 # include <BALL/MOLMEC/MINIMIZATION/energyMinimizer.h>
00012 #endif
00013 
00014 #ifndef BALL_MOLMEC_MINIMIZATION_LINESEARCH_H
00015 # include <BALL/MOLMEC/MINIMIZATION/lineSearch.h>
00016 #endif
00017 
00018 namespace BALL 
00019 {
00036   class BALL_EXPORT ShiftedLVMMMinimizer 
00037     : public EnergyMinimizer
00038   {
00039     public:
00040       
00041       BALL_CREATE(ShiftedLVMMMinimizer)
00042       
00043       
00046       
00047       
00052       struct Option
00053       {
00056         static const char* UPDATE_METHOD;
00057       
00060         static const char* CORRECTION_PARAMETER;
00061         
00065         static const char* NUM_OF_COLUMNS;
00066       };
00067       
00068       struct BALL_EXPORT Default
00069       {
00073         static const Size UPDATE_METHOD;
00074       
00078         static const Size CORRECTION_PARAMETER;
00079         
00083         static const Size NUM_OF_COLUMNS;
00084       };
00085     
00087 
00090       
00093       enum UpdateMethod
00094       {
00097         RANK_1 = 1,
00098         
00101         RANK_2 = 2
00102       };
00103     
00106       enum CorrectionParameter
00107       {
00110         UNIT_VALUE = 1,
00111       
00114         BALANCING_VALUE = 2,
00115         
00118         SQUARE_ROOT = 3,
00119         
00122         GEOMETRIC_MEAN = 4,
00123         
00126         RATIO_OF_SHIFT_PARAMS = 5
00127       };
00128       
00130 
00133     
00136       ShiftedLVMMMinimizer();
00137       
00140       ShiftedLVMMMinimizer(ForceField& force_field);
00141       
00144       ShiftedLVMMMinimizer(ForceField& force_field, SnapShotManager *ssm);
00145       
00148       ShiftedLVMMMinimizer(ForceField& force_field, SnapShotManager* ssm, const Options& options);
00149       
00152       ShiftedLVMMMinimizer(ForceField& force_field, const Options& options);
00153       
00156       ShiftedLVMMMinimizer(const ShiftedLVMMMinimizer& rhs);
00157       
00160       virtual ~ShiftedLVMMMinimizer();
00161       
00163 
00166       
00169       const ShiftedLVMMMinimizer& operator = (const ShiftedLVMMMinimizer& rhs);
00170       
00172 
00175       
00178       virtual bool specificSetup();
00179       
00181 
00184       
00187       void setUpdateMethod(UpdateMethod updt);
00188       
00191       UpdateMethod getUpdateMethod() const;
00192       
00195       void setCorrectionParameter(CorrectionParameter corr);
00196       
00199       CorrectionParameter getCorrectionParameter() const;
00200       
00204       void setMaxNumOfColumns(Size num);
00205       
00209       Size getMaxNumOfColumns() const;
00210       
00217       virtual double findStep();
00218       
00222       virtual void updateDirection();
00223       
00232       virtual bool minimize(Size iterations = 0, bool resume = false); 
00233       
00234     protected:
00235       
00237 
00240       
00243       LineSearch line_search_;
00244       
00247       bool first_iter_;
00248     
00251       Size number_of_atoms_;
00252       
00256       Size max_number_of_cols_;
00257       
00261       Size curr_number_of_cols_;
00262       
00265       Size updt_method_;
00266       
00269       Size corr_par_;
00270       
00273       double prev_shift_val_;
00274       
00277       vector<Vector3> shift_s_;
00278       
00281       vector<Vector3> grad_diff_;
00282       
00285       vector<float> updt_u_;
00286       
00289       vector<float> updt_v_;
00290       
00293       vector<Vector3> shifted_direction_;
00294       
00298       vector<Vector3> hess_factor_;
00299       
00303       vector<Vector3> initial_atoms_;
00304       
00306       
00307   };
00308 } // end of namespace BALL
00309 
00310 #endif // BALL_MOLMEC_MINIMIZATION_SHIFTEDLVMM_H