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

Fix to compile

parent a162c89e
...@@ -308,7 +308,7 @@ public: ...@@ -308,7 +308,7 @@ public:
* @param name the name of the variable to get * @param name the name of the variable to get
* @return the current value of the parameter * @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. * Set the value of a global variable.
* *
......
...@@ -125,7 +125,7 @@ double CustomIntegrator::getGlobalVariable(int index) const { ...@@ -125,7 +125,7 @@ double CustomIntegrator::getGlobalVariable(int index) const {
} }
double CustomIntegrator::getGlobalVariableByName(const string& name) 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]) { if (name == globalNames[i]) {
return getGlobalVariable(i); return getGlobalVariable(i);
} }
...@@ -145,11 +145,12 @@ void CustomIntegrator::setGlobalVariable(int index, double value) { ...@@ -145,11 +145,12 @@ void CustomIntegrator::setGlobalVariable(int index, double value) {
} }
void CustomIntegrator::setGlobalVariableByName(const string& name, 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]) { if (name == globalNames[i]) {
setGlobalVariable(i, value); setGlobalVariable(i, value);
return; return;
} }
}
throw OpenMMException("Illegal global variable name: "+name); throw OpenMMException("Illegal global variable name: "+name);
} }
...@@ -162,7 +163,7 @@ void CustomIntegrator::getPerDofVariable(int index, vector<Vec3>& values) const ...@@ -162,7 +163,7 @@ void CustomIntegrator::getPerDofVariable(int index, vector<Vec3>& values) const
} }
void CustomIntegrator::getPerDofVariableByName(const string& name, 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]) { if (name == perDofNames[i]) {
getPerDofVariable(i, values); getPerDofVariable(i, values);
return; return;
......
...@@ -161,6 +161,7 @@ UNITS = { ...@@ -161,6 +161,7 @@ UNITS = {
("*", "getEwaldErrorTolerance") : (None, ()), ("*", "getEwaldErrorTolerance") : (None, ()),
("*", "getFriction") : ("1/unit.picosecond", ()), ("*", "getFriction") : ("1/unit.picosecond", ()),
("*", "getGlobalVariable") : (None, ()), ("*", "getGlobalVariable") : (None, ()),
("*", "getGlobalVariableByName") : (None, ()),
("*", "getIntegrator") : (None, ()), ("*", "getIntegrator") : (None, ()),
("*", "getMapParameters") : (None, ()), ("*", "getMapParameters") : (None, ()),
("*", "getName") : (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