25 #include "tools/HistogramBead.h"
29 namespace vesselbase {
34 std::vector<double>
df;
50 keys.addFlag(
"NORM",
false,
"calculate the fraction of values rather than the number");
54 keys.
reserve(
"numbered",
"BETWEEN",
"calculate the number of values that are within a certain range. "
55 "These quantities are calculated using kernel density estimation as described on "
56 "\\ref histogrambead.",
true);
57 keys.
addOutputComponent(
"between",
"BETWEEN",
"the number/fraction of values within a certain range. This is calculated using one of the "
58 "formula described in the description of the keyword so as to make it continuous. "
59 "You can calculate this quantity multiple times using different parameters.");
67 double min, max; std::string str_min, str_max;
78 if( errormsg.size()!=0 )
error( errormsg );
93 double contr=weight*f;
113 df[0] = 1.0 / denom;
df[1]=0.0;
118 df[0] = 1.0;
df[1]=0.0;
void finish()
Complete the calculation once the loop is finished.
static void reserveKeyword(Keywords &keys)
static void registerKeywords(Keywords &keys)
double getTolerance() const
Return the value of the tolerance.
double getFinalValue(const unsigned &j)
Get the nth value in the distribution.
bool diffweight
Are the derivatives differentiable.
void chainRuleForElementDerivatives(const unsigned &, const unsigned &, const double &, Vessel *)
Merge the derivatives.
static void registerKeywords(Keywords &keys)
void setOutputValue(const double &val)
Set the final value.
Objects that inherit from FunctionVessel can be used (in tandem with PLMD::ActionWithVessel) to calcu...
static void registerKeywords(Keywords &keys)
void mergeFinalDerivatives(const std::vector< double > &df)
This does a combination of the product and chain rules.
void isPeriodic(const double &mlow, const double &mhigh)
void addOutputComponent(const std::string &name, const std::string &key, const std::string &descr)
Add a potential component which can be output by this particular action.
This class holds the keywords and their documentation.
void parseFlag(const std::string &key, bool &t)
Parse one keyword as boolean flag.
void addValueIgnoringTolerance(const unsigned &jval, const double &val)
Add some value to the accumulator and ignore the tolerance.
A class for calculating whether or not values are within a given range using : .
virtual void retrieveDomain(std::string &min, std::string &max)
What are the domains of the base quantities.
#define PLUMED_REGISTER_VESSEL(classname, keyword)
std::string description() const
Between(const VesselOptions &da)
void reserve(const std::string &t, const std::string &k, const std::string &d, const bool isvessel=false)
Reserve a keyword.
void error(const std::string &errmsg)
Report an error.
void set(const std::string ¶ms, const std::string &dd, std::string &errormsg)
This class is used to pass the input to Vessels.
virtual bool isPeriodic()=0
Are the base quantities periodic.
bool addValueUsingTolerance(const unsigned &jval, const double &val)
Add some value to the accumulator if it is greater than tolerance.
std::string function_description()
The rest of the description of what we are calculating.
bool calculate()
Calculate the part of the vessel that is done in the loop.
double calculate(double x, double &df) const
double getNLTolerance() const
Return the value of the neighbor list tolerance.
std::string getAllInput()
This returns the whole input line (it is used for less_than/more_than/between)
double getElementValue(const unsigned &ival) const
Get the value of this element.
ActionWithVessel * getAction()
Return a pointer to the action we are working in.