22 #ifndef __PLUMED_tools_KernelFunctions_h
23 #define __PLUMED_tools_KernelFunctions_h
27 #include "core/Value.h"
47 double getCutoff(
const double& width )
const ;
49 KernelFunctions(
const std::vector<double>& at,
const std::vector<double>& sig,
const std::string& type,
const bool multivariate ,
const double&
w,
const bool norm );
51 unsigned ndim()
const;
55 std::vector<unsigned>
getSupport(
const std::vector<double>& dx )
const;
59 double evaluate(
const std::vector<Value*>& pos, std::vector<double>& derivatives,
bool usederiv=
true )
const;
67 for(
unsigned i=0;i<ncv;i++){
68 for(
unsigned j=i;j<ncv;j++){
69 mymatrix(i,j)=mymatrix(j,i)=
width[k];
std::vector< unsigned > getSupport(const std::vector< double > &dx) const
Get the support.
std::vector< double > getCenter() const
Get the position of the center.
static KernelFunctions * read(IFile *ifile, const std::vector< std::string > &valnames)
Read a kernel function from a file.
double evaluate(const std::vector< Value * > &pos, std::vector< double > &derivatives, bool usederiv=true) const
Evaluate the kernel function.
double height
The height of the kernel.
Matrix< double > getMatrix() const
Convert the width into matrix form.
double getCutoff(const double &width) const
Get the cutoff for a kernel.
std::vector< double > getContinuousSupport() const
get it in continuous form
unsigned ndim() const
Get the dimensionality of the kernel.
std::vector< double > center
The center of the kernel function.
enum PLMD::KernelFunctions::@4 ktype
What type of kernel are we using.
std::vector< double > width
The width of the kernel.
bool diagonal
Is the metric matrix diagonal.
KernelFunctions(const std::vector< double > &at, const std::vector< double > &sig, const std::string &type, const bool multivariate, const double &w, const bool norm)
T norm(const std::vector< T > &A)
Calculate the dot product between a vector and itself.