LCOV - code coverage report
Current view: top level - adjmat - AdjacencyMatrixVessel.h (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 1 1 100.0 %
Date: 2018-12-19 07:49:13 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       2             :    Copyright (c) 2013-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_adjmat_AdjacencyMatrixVessel_h
      23             : #define __PLUMED_adjmat_AdjacencyMatrixVessel_h
      24             : 
      25             : #include "vesselbase/StoreDataVessel.h"
      26             : #include "multicolvar/MultiColvarBase.h"
      27             : 
      28             : namespace PLMD {
      29             : namespace adjmat {
      30             : 
      31             : class AdjacencyMatrixBase;
      32             : 
      33             : // One school of thought would have it that it makes more sense to
      34             : // have the functionality contained within this class in AdjacencyMatrixBase
      35             : // I have not done this as I can inherit many useful things from StoreDataVessel
      36             : // If I put this functionality within AdjacencyMatrixBase I would have to reimplement
      37             : // these features.
      38             : 
      39          30 : class AdjacencyMatrixVessel : public vesselbase::StoreDataVessel {
      40             :   friend class AdjacencyMatrixBase;
      41             :   friend class ActionWithInputMatrix;
      42             : private:
      43             : /// Pointer to underlying action
      44             :   AdjacencyMatrixBase* function;
      45             : /// Is the matrix symmetric and are we calculating hbonds
      46             :   bool symmetric, hbonds;
      47             : public:
      48             :   static void registerKeywords( Keywords& keys );
      49             : /// Constructor
      50             :   explicit AdjacencyMatrixVessel( const vesselbase::VesselOptions& );
      51             : /// Get the underlying adjacency matrix action object
      52             :   AdjacencyMatrixBase* getMatrixAction();
      53             : /// Is an element of the matrix currently active
      54             :   bool matrixElementIsActive( const unsigned& ielem, const unsigned& jelem ) const ;
      55             : /// Get the index that a particular element is stored in from the matrix indices
      56             :   unsigned getStoreIndexFromMatrixIndices( const unsigned& ielem, const unsigned& jelem ) const ;
      57             : /// Get the adjacency matrix
      58             :   void retrieveMatrix( DynamicList<unsigned>& myactive_elements, Matrix<double>& mymatrix );
      59             : /// Get the neighbour list based on the adjacency matrix
      60             :   void retrieveAdjacencyLists( std::vector<unsigned>& nneigh, Matrix<unsigned>& adj_list );
      61             : /// Retrieve the list of edges in the adjacency matrix/graph
      62             :   void retrieveEdgeList( unsigned& nedge, std::vector<std::pair<unsigned,unsigned> >& edge_list );
      63             : /// Retrieve the derivatives of the matrix element - this is overwritten as if we have
      64             : /// derivatives wrt a weight...
      65             :   void retrieveDerivatives( const unsigned& myelem, const bool& normed, MultiValue& myvals );
      66             : ///
      67             :   void getMatrixIndices( const unsigned& code, unsigned& i, unsigned& j ) const ;
      68             : /// Recalculate a stored quantity
      69             :   void recalculateStoredQuantity( const unsigned& myelm, MultiValue& myvals );
      70             : /// Can we think of the matrix as an undirected graph
      71             :   bool undirectedGraph() const ;
      72             : /// Is the matrix symmetric
      73             :   bool isSymmetric() const ;
      74             : /// Get the number of rows
      75             :   unsigned getNumberOfRows() const ;
      76             : /// Get the number of columns
      77             :   unsigned getNumberOfColumns() const ;
      78             : /// Are these two nodes connected
      79             :   bool nodesAreConnected( const unsigned& iatom, const unsigned& jatom ) const ;
      80             : /// Get the cutoff that we are using for connections
      81             :   double getCutoffForConnection() const ;
      82             : ///
      83             :   Vector getNodePosition( const unsigned& taskIndex ) const ;
      84             : };
      85             : 
      86             : }
      87             : }
      88             : #endif
      89             : 

Generated by: LCOV version 1.13