LCOV - code coverage report
Current view: top level - colvar - PathMSDBase.h (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 2 4 50.0 %
Date: 2018-12-19 07:49:13 Functions: 4 8 50.0 %

          Line data    Source code
       1             : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       2             :    Copyright (c) 2012-2018 The plumed team
       3             :    (see the PEOPLE file at the root of the distribution for a list of names)
       4             : 
       5             :    See http://www.plumed.org for more information.
       6             : 
       7             :    This file is part of plumed, version 2.
       8             : 
       9             :    plumed 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             :    plumed 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 plumed.  If not, see <http://www.gnu.org/licenses/>.
      21             : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
      22             : #ifndef __PLUMED_colvar_PathMSDBase_h
      23             : #define __PLUMED_colvar_PathMSDBase_h
      24             : 
      25             : #include "Colvar.h"
      26             : #include "ActionRegister.h"
      27             : 
      28             : #include "tools/PDB.h"
      29             : #include "tools/RMSD.h"
      30             : #include "tools/Tools.h"
      31             : 
      32             : namespace PLMD {
      33             : namespace colvar {
      34             : 
      35          22 : class PathMSDBase : public Colvar {
      36             : /// this class is a general container for path stuff
      37      582212 :   class ImagePath {
      38             :   public:
      39             :     // cardinal indexing: needed to map over msd
      40             :     unsigned index;
      41             :     // spiwok indexing
      42             :     std::vector<double> property;
      43             :     // distance
      44             :     double distance;
      45             :     // similarity (exp - lambda distance) or other
      46             :     double similarity;
      47             :     // derivatives of the distance
      48             :     std::vector<Vector> distder;
      49             :     // here one can add a pointer to a value (hypothetically providing a distance from a point)
      50             :   };
      51             :   struct imgOrderByDist {
      52           0 :     bool operator ()(ImagePath const& a, ImagePath const& b) {
      53           0 :       return (a).distance < (b).distance;
      54             :     }
      55             :   };
      56             :   struct imgOrderBySimilarity {
      57             :     bool operator ()(ImagePath const& a, ImagePath const& b) {
      58             :       return (a).similarity > (b).similarity;
      59             :     }
      60             :   };
      61             : 
      62             :   double lambda;
      63             :   int neigh_size;
      64             :   int neigh_stride;
      65             :   std::vector<RMSD> msdv;
      66             :   std::string reference;
      67             :   std::vector<Vector> derivs_s;
      68             :   std::vector<Vector> derivs_z;
      69             :   std::vector <ImagePath> imgVec; // this can be used for doing neighlist
      70             : protected:
      71             :   std::vector<PDB> pdbv;
      72             :   std::vector<std::string> labels;
      73             :   std::vector< std::vector<double> > indexvec; // use double to allow isomaps
      74             :   unsigned nframes;
      75             : public:
      76             :   explicit PathMSDBase(const ActionOptions&);
      77             : // active methods:
      78             :   virtual void calculate();
      79             : //  virtual void prepare();
      80             :   static void registerKeywords(Keywords& keys);
      81             : };
      82             : 
      83             : }
      84             : }
      85             : 
      86             : #endif
      87             : 

Generated by: LCOV version 1.13