LCOV - code coverage report
Current view: top level - dimred - DimensionalityReductionBase.h (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 0 4 0.0 %
Date: 2024-10-11 08:09:47 Functions: 0 2 0.0 %

          Line data    Source code
       1             : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       2             :    Copyright (c) 2015-2023 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_dimred_DimensionalityReductionBase_h
      23             : #define __PLUMED_dimred_DimensionalityReductionBase_h
      24             : 
      25             : #include "analysis/AnalysisBase.h"
      26             : 
      27             : namespace PLMD {
      28             : namespace dimred {
      29             : 
      30             : class DimensionalityReductionBase : public analysis::AnalysisBase {
      31             :   friend class ProjectNonLandmarkPoints;
      32             :   friend class SketchMapBase;
      33             : private:
      34             : /// This are the target distances for a single point.
      35             : /// This is used when we do out of sample or pointwise global optimization
      36             :   std::vector<double> dtargets;
      37             : /// The projections that were generated by the dimensionality reduction algorithm
      38             :   Matrix<double> projections;
      39             : protected:
      40             : /// Dimensionality of low dimensional space
      41             :   unsigned nlow;
      42             : /// A pointer to any dimensionality reduction base that we have got projections from
      43             :   DimensionalityReductionBase* dimredbase;
      44             : public:
      45             :   static void registerKeywords( Keywords& keys );
      46             :   explicit DimensionalityReductionBase( const ActionOptions& );
      47             : /// Get the ith data point (this returns the projection)
      48             :   virtual void getProjection( const unsigned& idata, std::vector<double>& point, double& weight );
      49             : /// Actually perform the analysis
      50             :   virtual void performAnalysis();
      51             : /// Overwrite getArguments so we get arguments from underlying class
      52             :   std::vector<Value*> getArgumentList();
      53             : /// Calculate the projections of points
      54             :   virtual void calculateProjections( const Matrix<double>&, Matrix<double>& )=0;
      55             : /// Set one of the elements in the target vector.  This target vector is used
      56             : /// when we use calculateStress when finding the projections of individual points.
      57             : /// For example this function is used in PLMD::dimred::ProjectOutOfSample
      58             :   virtual void setTargetDistance( const unsigned&, const double& );
      59             : /// Calculate the pointwise stress on one point when it is located at pp.
      60             : /// This function makes use of the distance data in dtargets
      61             : /// It is used in PLMD::dimred::ProjectOutOfSample and in pointwise optimisation
      62             :   virtual double calculateStress( const std::vector<double>& pp, std::vector<double>& der );
      63             : /// Overwrite virtual function in ActionWithVessel
      64           0 :   void performTask( const unsigned&, const unsigned&, MultiValue& ) const { plumed_error(); }
      65             : };
      66             : 
      67             : inline
      68           0 : void DimensionalityReductionBase::setTargetDistance( const unsigned& idata, const double& dist ) {
      69           0 :   dtargets[idata]=dist;
      70           0 : }
      71             : 
      72             : }
      73             : }
      74             : #endif

Generated by: LCOV version 1.15