LCOV - code coverage report
Current view: top level - ves - GridProjWeights.h (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 6 6 100.0 %
Date: 2024-10-11 08:09:47 Functions: 4 4 100.0 %

          Line data    Source code
       1             : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       2             :    Copyright (c) 2016-2021 The VES code team
       3             :    (see the PEOPLE-VES file at the root of this folder for a list of names)
       4             : 
       5             :    See http://www.ves-code.org for more information.
       6             : 
       7             :    This file is part of VES code module.
       8             : 
       9             :    The VES code module is free software: you can redistribute it and/or modify
      10             :    it under the terms of the GNU Lesser General Public License as published by
      11             :    the Free Software Foundation, either version 3 of the License, or
      12             :    (at your option) any later version.
      13             : 
      14             :    The VES code module is distributed in the hope that it will be useful,
      15             :    but WITHOUT ANY WARRANTY; without even the implied warranty of
      16             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      17             :    GNU Lesser General Public License for more details.
      18             : 
      19             :    You should have received a copy of the GNU Lesser General Public License
      20             :    along with the VES code module.  If not, see <http://www.gnu.org/licenses/>.
      21             : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
      22             : #ifndef __PLUMED_ves_GridProjWeights_h
      23             : #define __PLUMED_ves_GridProjWeights_h
      24             : 
      25             : #include "tools/Grid.h"
      26             : 
      27             : 
      28             : namespace PLMD {
      29             : namespace ves {
      30             : 
      31             : 
      32             : class MarginalWeight:public WeightBase {
      33             : public:
      34          28 :   explicit MarginalWeight() {}
      35      284402 :   double projectInnerLoop(double &input, double &v) {return  input+v;}
      36        2822 :   double projectOuterLoop(double &v) {return v;}
      37             : };
      38             : 
      39             : class FesWeight:public WeightBase {
      40             : public:
      41             :   double beta,invbeta;
      42          50 :   explicit FesWeight(double v) {beta=v; invbeta=1./beta;}
      43      703214 :   double projectInnerLoop(double &input, double &v) {return  input+exp(-beta*v);}
      44        5834 :   double projectOuterLoop(double &v) {return -invbeta*std::log(v);}
      45             : };
      46             : 
      47             : }
      48             : }
      49             : 
      50             : #endif

Generated by: LCOV version 1.15