74 typedef vector<double>::const_iterator
myiter;
76 bool operator ()(pair<unsigned , myiter>
const&
a, pair<unsigned , myiter>
const& b) {
77 return *(a.second) < *(b.second);
83 vector< pair<unsigned , myiter> > order(v.size());
85 for (myiter it = v.begin(); it != v.end(); ++it, ++
n){
86 order[
n] = make_pair(n, it);
89 sort(order.begin(), order.end(),
ordering());
90 typedef vector< pair<unsigned , myiter> >::const_iterator pairiter;
91 vector<int> vv(v.size());n=0;
92 for ( pairiter it = order.begin(); it != order.end(); ++it ){
93 vv[
n]=(*it).first;n++;
101 bool operator ()(pair<Value * , double>
const&
a, pair<Value* , double>
const& b) {
102 return (a).second > (b).second;
109 virtual void calculate();
110 virtual void prepare();
111 static void registerKeywords(
Keywords& keys);
114 PLUMED_REGISTER_ACTION(FuncPathMSD,
"FUNCPATHMSD")
117 Function::registerKeywords(keys);
119 keys.add(
"compulsory",
"LAMBDA",
"all compulsory keywords should be added like this with a description here");
120 keys.add(
"optional",
"NEIGH_SIZE",
"all optional keywords that have input should be added like a description here");
121 keys.add(
"optional",
"NEIGH_STRIDE",
"all optional keywords that have input should be added like a description here");
122 componentsAreNotOptional(keys);
123 keys.addOutputComponent(
"s",
"default",
"the position on the path");
124 keys.addOutputComponent(
"z",
"default",
"the distance from the path");
142 if(myname!=
"RMSD")plumed_merror(
"This argument is not of RMSD type!!!");
144 log.
printf(
" Consistency check completed! Your path cvs look good!\n");
151 log.
printf(
" Neighbor list enabled: \n");
155 log.
printf(
" Neighbor list NOT enabled \n");
183 typedef vector< pair< Value *,double> >::iterator pairiter;
185 (*it).second=exp(-
lambda*((*it).first->get()));
186 s_path+=(
indexmap[(*it).first])*(*it).second;
187 partition+=(*it).second;
190 val_s_path->
set(s_path);
191 val_z_path->
set(-(1./
lambda)*std::log(partition));
194 double expval=(*it).second;
222 log.
printf(
" NEIGH LIST NOW INCLUDE INDEXES: ");
237 typedef vector< pair<Value*,double> >::iterator pairiter;
238 vector<Value*> argstocall;
243 argstocall.push_back( (*it).first );
virtual void calculate()
Calculate an Action.
Log & log
Reference to the log stream.
Provides the keyword FUNCPATHMSD
void componentIsNotPeriodic(const std::string &name)
Set your value component to have no periodicity.
A class for holding the value of a function together with its derivatives.
void requestArguments(const std::vector< Value * > &arg)
Setup the dependencies.
double getTimeStep() const
Return the timestep.
void checkRead()
Check if Action was properly read.
Value * getPntrToArgument(const unsigned n)
Return a pointer to specific argument.
void clearDerivatives()
Set all the derivatives to zero.
void set(double)
Set the value of the function.
void addComponentWithDerivatives(const std::string &name)
void parse(const std::string &key, T &t)
Parse one keyword as generic type.
This class holds the keywords and their documentation.
virtual void prepare()
this function updates the needed argument list
This class is used to bring the relevant information to the Action constructor.
map< Value *, double > indexmap
int printf(const char *fmt,...)
Formatted output with explicit format - a la printf.
const std::string & getName() const
Returns the name.
Base class for all the input Actions.
void resizeDerivatives(int n)
Set the number of derivatives.
ActionWithValue * getPntrToAction()
This returns the pointer to the action where this value is calculated.
vector< double >::const_iterator myiter
vector< int > increasingOrder(vector< double > &v)
long int getStep() const
Return the present timestep.
vector< pair< Value *, double > > neighpair
int getNumberOfComponents() const
Returns the number of values defined.
This is the abstract base class to use for implementing new CV function, within it there is informati...
Value * getPntrToComponent(int i)
Return a pointer to the component by index.
vector< Value * > allArguments
unsigned getNumberOfArguments() const
Returns the number of arguments.
void setDerivative(int, double)