Commit 1b245565 authored by Robert McGibbon's avatar Robert McGibbon
Browse files

Fix to compile

parent a162c89e
......@@ -308,7 +308,7 @@ public:
* @param name the name of the variable to get
* @return the current value of the parameter
*/
double getGlobalVariableByName(const std::string& name);
double getGlobalVariableByName(const std::string& name) const;
/**
* Set the value of a global variable.
*
......
......@@ -125,7 +125,7 @@ double CustomIntegrator::getGlobalVariable(int index) const {
}
double CustomIntegrator::getGlobalVariableByName(const string& name) const {
for (int i = 0; i < (int) globalNames.size(); i++)
for (int i = 0; i < (int) globalNames.size(); i++) {
if (name == globalNames[i]) {
return getGlobalVariable(i);
}
......@@ -145,11 +145,12 @@ void CustomIntegrator::setGlobalVariable(int index, double value) {
}
void CustomIntegrator::setGlobalVariableByName(const string& name, double value) {
for (int i = 0; i < (int) globalNames.size(); i++)
for (int i = 0; i < (int) globalNames.size(); i++) {
if (name == globalNames[i]) {
setGlobalVariable(i, value);
return;
}
}
throw OpenMMException("Illegal global variable name: "+name);
}
......@@ -162,7 +163,7 @@ void CustomIntegrator::getPerDofVariable(int index, vector<Vec3>& values) const
}
void CustomIntegrator::getPerDofVariableByName(const string& name, vector<Vec3>& values) const {
for (int i = 0; i < (int) perDofNames.size(); i++)
for (int i = 0; i < (int) perDofNames.size(); i++) {
if (name == perDofNames[i]) {
getPerDofVariable(i, values);
return;
......
......@@ -161,6 +161,7 @@ UNITS = {
("*", "getEwaldErrorTolerance") : (None, ()),
("*", "getFriction") : ("1/unit.picosecond", ()),
("*", "getGlobalVariable") : (None, ()),
("*", "getGlobalVariableByName") : (None, ()),
("*", "getIntegrator") : (None, ()),
("*", "getMapParameters") : (None, ()),
("*", "getName") : (None, ()),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment