| 1 | // -*- c++ -*-cxx . . $ `<file>/src/external/colvars/colvarbias_alb.h`/ |
| 2 | |
| 3 | // This file is part of the Collective Variables module (Colvars). |
| 4 | // The original version of Colvars and its updates are located at: |
| 5 | // https://github.com/Colvars/colvars |
| 6 | // Please update all Colvars source files before making any changes. |
| 7 | // If you wish to distribute your changes, please submit them to the |
| 8 | // Colvars repository at GitHub. |
| 9 | |
| 10 | #ifndef COLVARBIAS_ALB_H |
| 11 | #define COLVARBIAS_ALB_Hcxx . . $ `src/external/colvars/colvarbias_alb.h:11:9`! |
| 12 | |
| 13 | #include "colvar.h"cxx . . $ `<file>/src/external/colvars/colvar.h`/ |
| 14 | #include "colvarbias.h"cxx . . $ `<file>/src/external/colvars/colvarbias.h`/ |
| 15 | |
| 16 | |
| 17 | class colvarbias_albcxx . . $ colvarbias_alb# : public colvarbiascxx . . $ colvarbias# { |
| 18 | |
| 19 | public: |
| 20 | |
| 21 | colvarbias_albcxx . . $ colvarbias_alb#colvarbias_alb(85c52e162fed56f9).(char const *key); |
| 22 | virtual ~cxx . . $ colvarbias_alb#`~colvarbias_alb`(ced63f7c635d850d).colvarbias_albcxx . . $ colvarbias_alb#(); |
| 23 | virtual int initcxx . . $ colvarbias_alb#init(7787e0c995c81e02).(std::stringcxx . . $ std/string# const &conf); |
| 24 | virtual int updatecxx . . $ colvarbias_alb#update(b126dc7c1de90089).(); |
| 25 | |
| 26 | virtual std::stringcxx . . $ std/string# const get_state_paramscxx . . $ colvarbias_alb#get_state_params(fcf7e9886c190261).() const; |
| 27 | virtual int set_state_paramscxx . . $ colvarbias_alb#set_state_params(7787e0c995c81e02).(std::stringcxx . . $ std/string# const &conf); |
| 28 | virtual std::ostreamcxx . . $ std/ostream# & write_traj_labelcxx . . $ colvarbias_alb#write_traj_label(f33a862e9c1098ca).(std::ostreamcxx . . $ std/ostream# &os); |
| 29 | virtual std::ostreamcxx . . $ std/ostream# & write_trajcxx . . $ colvarbias_alb#write_traj(f33a862e9c1098ca).(std::ostreamcxx . . $ std/ostream# &os); |
| 30 | |
| 31 | protected: |
| 32 | |
| 33 | /// \brief Restraint centers |
| 34 | std::vectorcxx . . $ std/vector#<colvarvaluecxx . . $ colvarvalue#> colvar_centerscxx . . $ colvarbias_alb#colvar_centers.; |
| 35 | |
| 36 | /// \brief colvar parameters, used for calculating the gradient/variance |
| 37 | std::vectorcxx . . $ std/vector#<cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real#> meanscxx . . $ colvarbias_alb#means.; |
| 38 | std::vectorcxx . . $ std/vector#<cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real#> ssdcxx . . $ colvarbias_alb#ssd.; // SSD = sum of squares of differences from mean |
| 39 | int update_callscxx . . $ colvarbias_alb#update_calls.; |
| 40 | |
| 41 | ///\brief how often to update coupling constant |
| 42 | int update_freqcxx . . $ colvarbias_alb#update_freq.; |
| 43 | |
| 44 | ///\brief Estimated range of coupling constant values in kT |
| 45 | std::vectorcxx . . $ std/vector#<cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real#> max_coupling_rangecxx . . $ colvarbias_alb#max_coupling_range.; |
| 46 | |
| 47 | //\brief Estimated max for how quickly the rate can change in kT / time |
| 48 | std::vectorcxx . . $ std/vector#<cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real#> max_coupling_ratecxx . . $ colvarbias_alb#max_coupling_rate.; |
| 49 | |
| 50 | /// \brief accumated couping force; used in stochastic online gradient descent algorithm |
| 51 | std::vectorcxx . . $ std/vector#<cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real#> coupling_accumcxx . . $ colvarbias_alb#coupling_accum.; |
| 52 | |
| 53 | /// \brief coupling constant |
| 54 | std::vectorcxx . . $ std/vector#<cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real#> set_couplingcxx . . $ colvarbias_alb#set_coupling.; |
| 55 | |
| 56 | /// \brief current coupling constant, which is ramped up during equilibration to coupling |
| 57 | std::vectorcxx . . $ std/vector#<cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real#> current_couplingcxx . . $ colvarbias_alb#current_coupling.; |
| 58 | |
| 59 | /// \brief how quickly to change the coupling constant |
| 60 | std::vectorcxx . . $ std/vector#<cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real#> coupling_ratecxx . . $ colvarbias_alb#coupling_rate.; |
| 61 | |
| 62 | // \brief if we're equilibrating our estimates or collecting data |
| 63 | bool b_equilibrationcxx . . $ colvarbias_alb#b_equilibration.; |
| 64 | |
| 65 | // \brief If the coupling range should be increased |
| 66 | bool b_hard_coupling_rangecxx . . $ colvarbias_alb#b_hard_coupling_range.; |
| 67 | |
| 68 | |
| 69 | /// \brief flag for outputting colvar centers |
| 70 | bool b_output_centerscxx . . $ colvarbias_alb#b_output_centers.; |
| 71 | |
| 72 | /// \brief flag for outputting current gradient |
| 73 | bool b_output_gradcxx . . $ colvarbias_alb#b_output_grad.; |
| 74 | |
| 75 | /// \brief flag for outputting coupling constant |
| 76 | bool b_output_couplingcxx . . $ colvarbias_alb#b_output_coupling.; |
| 77 | |
| 78 | cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real# restraint_potentialcxx . . $ colvarbias_alb#restraint_potential(a020c2bdfb00c0ee).(cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real# k, const colvarcxx . . $ colvar#* x, const colvarvaluecxx . . $ colvarvalue#& xcenter) const; |
| 79 | |
| 80 | /// \brief Force function |
| 81 | colvarvaluecxx . . $ colvarvalue# restraint_forcecxx . . $ colvarbias_alb#restraint_force(8e9879fcaa9579be).(cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real# k, const colvarcxx . . $ colvar#* x, const colvarvaluecxx . . $ colvarvalue#& xcenter) const; |
| 82 | |
| 83 | ///\brief Unit scaling |
| 84 | cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real# restraint_convert_kcxx . . $ colvarbias_alb#restraint_convert_k(726307d3d9a4aee5).(cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real# k, cvmcxx . . $ cvm#::realcxx . . $ colvarmodule#real# dist_measure) const; |
| 85 | |
| 86 | }; |
| 87 | |
| 88 | #endif |