Skip to content
Snippets Groups Projects
Commit f19f5be1 authored by Gareth Tribello's avatar Gareth Tribello
Browse files

Fixed warning about DotProductDistance in compilation

parent 30734458
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ class DotProductDistance : public ArgumentOnlyDistance { ...@@ -29,7 +29,7 @@ class DotProductDistance : public ArgumentOnlyDistance {
public: public:
explicit DotProductDistance( const ReferenceConfigurationOptions& ro ); explicit DotProductDistance( const ReferenceConfigurationOptions& ro );
void read( const PDB& ); void read( const PDB& );
double calc( const std::vector<Value*>& vals, const std::vector<double>& arg, const bool& squared ); double calculateArgumentDistance( const std::vector<Value*> & vals, const std::vector<double>& arg, ReferenceValuePack& myder, const bool& squared ) const ;
}; };
PLUMED_REGISTER_METRIC(DotProductDistance,"DOTPRODUCT") PLUMED_REGISTER_METRIC(DotProductDistance,"DOTPRODUCT")
...@@ -44,9 +44,11 @@ void DotProductDistance::read( const PDB& pdb ){ ...@@ -44,9 +44,11 @@ void DotProductDistance::read( const PDB& pdb ){
readArgumentsFromPDB( pdb ); readArgumentsFromPDB( pdb );
} }
double DotProductDistance::calc( const std::vector<Value*>& vals, const std::vector<double>& arg, const bool& squared ){ double DotProductDistance::calculateArgumentDistance( const std::vector<Value*> & vals, const std::vector<double>& arg,
ReferenceValuePack& myder, const bool& squared ) const {
double dot=0.0; double dot=0.0;
for (unsigned long i=0; i<vals.size(); ++i) dot+=getReferenceArgument(i)*arg[i]; for (unsigned long i=0; i<vals.size(); ++i) dot+=getReferenceArgument(i)*arg[i];
for (unsigned long i=0; i<vals.size(); ++i) myder.setArgumentDerivatives( i, -getReferenceArgument(i)/dot );
return -log(dot); return -log(dot);
} }
......
...@@ -64,9 +64,6 @@ protected: ...@@ -64,9 +64,6 @@ protected:
void readArgumentsFromPDB( const PDB& pdb ); void readArgumentsFromPDB( const PDB& pdb );
/// Set the values of the colvars based on their current instantanous values (used in Analysis) /// Set the values of the colvars based on their current instantanous values (used in Analysis)
void setReferenceArguments(); void setReferenceArguments();
/// Calculate the euclidean/malanobius distance the atoms have moved from the reference
/// configuration in CV space
double calculateArgumentDistance( const std::vector<Value*> & vals, const std::vector<double>& arg, ReferenceValuePack& myder, const bool& squared ) const ;
public: public:
explicit ReferenceArguments( const ReferenceConfigurationOptions& ro ); explicit ReferenceArguments( const ReferenceConfigurationOptions& ro );
/// Get the number of reference arguments /// Get the number of reference arguments
...@@ -86,6 +83,9 @@ public: ...@@ -86,6 +83,9 @@ public:
const std::vector<double>& getReferenceMetric(); const std::vector<double>& getReferenceMetric();
/// Return names /// Return names
const std::vector<std::string>& getArgumentNames(); const std::vector<std::string>& getArgumentNames();
/// Calculate the euclidean/malanobius distance the atoms have moved from the reference
/// configuration in CV space
virtual double calculateArgumentDistance( const std::vector<Value*> & vals, const std::vector<double>& arg, ReferenceValuePack& myder, const bool& squared ) const ;
}; };
inline inline
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment