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

          Line data    Source code
       1             : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       2             : Copyright (c) 2019 Jakub Rydzewski (jr@fizyka.umk.pl). All rights reserved.
       3             : 
       4             : See http://www.maze-code.github.io for more information.
       5             : 
       6             : This file is part of maze.
       7             : 
       8             : maze is free software: you can redistribute it and/or modify it under the
       9             : terms of the GNU Lesser General Public License as published by the Free
      10             : Software Foundation, either version 3 of the License, or (at your option)
      11             : any later version.
      12             : 
      13             : maze is distributed in the hope that it will be useful, but WITHOUT ANY
      14             : WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      15             : FOR A PARTICULAR PURPOSE.
      16             : 
      17             : See the 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 maze. If not, see <https://www.gnu.org/licenses/>.
      21             : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
      22             : #ifndef __PLUMED_maze_Member_h
      23             : #define __PLUMED_maze_Member_h
      24             : 
      25             : /**
      26             :  * @file Member.h
      27             :  *
      28             :  * @author J. Rydzewski (jr@fizyka.umk.pl)
      29             :  */
      30             : 
      31             : #include "Core.h"
      32             : 
      33             : namespace PLMD {
      34             : namespace maze {
      35             : 
      36             : /**
      37             :  * @class Member Member.h "maze/Member.h"
      38             :  *
      39             :  * @brief Defines the encoding for a ligand conformation.
      40             :  *
      41             :  * The Member class is required by some optimizers. Ligand conformations are
      42             :  * encoded by a Cartesian translation relative to a ligand conformation from
      43             :  * the MD simulation. Each translation has a loss (score) which tells how
      44             :  * preferred is the encoding w.r.t. a chosen loss function.
      45             :  */
      46             : struct Member {
      47             : public:
      48         344 :   Member()
      49         344 :     : score(-1),
      50         344 :       translation({0, 0, 0}) { /* Nothing to do. */ }
      51             : 
      52             :   //! Value of the loss function.
      53             :   double score;
      54             : 
      55             :   //! Encoding of a ligand conformation, i.e., its translation.
      56             :   Vector translation;
      57             : };
      58             : 
      59         410 : inline bool compare(Member& m, Member& n) {
      60         410 :   return m.score > n.score;
      61             : }
      62             : 
      63             : } // namespace maze
      64             : } // namespace PLMD
      65             : 
      66             : #endif // __PLUMED_maze_Member_h

Generated by: LCOV version 1.15