Commit a39e5bee authored by Charlles Abreu's avatar Charlles Abreu
Browse files

Direct value return in Continuous1DFunction.getPeriodic

parent 09600365
...@@ -94,9 +94,8 @@ public: ...@@ -94,9 +94,8 @@ public:
/** /**
* Get the periodicity status of the tabulated function. * Get the periodicity status of the tabulated function.
* *
* @param periodic whether the function is periodic
*/ */
void getPeriodic(bool& periodic) const; bool getPeriodic() const;
/** /**
* Set the parameters for the tabulated function. * Set the parameters for the tabulated function.
* *
......
...@@ -46,8 +46,8 @@ void Continuous1DFunction::getFunctionParameters(vector<double>& values, double& ...@@ -46,8 +46,8 @@ void Continuous1DFunction::getFunctionParameters(vector<double>& values, double&
max = this->max; max = this->max;
} }
void Continuous1DFunction::getPeriodic(bool& periodic) const { bool Continuous1DFunction::getPeriodic() const {
periodic = this->periodic; return periodic;
} }
void Continuous1DFunction::setFunctionParameters(const vector<double>& values, double min, double max) { void Continuous1DFunction::setFunctionParameters(const vector<double>& values, double min, double max) {
......
...@@ -721,7 +721,7 @@ vector<float> ExpressionUtilities::computeFunctionCoefficients(const TabulatedFu ...@@ -721,7 +721,7 @@ vector<float> ExpressionUtilities::computeFunctionCoefficients(const TabulatedFu
double min, max; double min, max;
fn.getFunctionParameters(values, min, max); fn.getFunctionParameters(values, min, max);
bool periodic; bool periodic;
fn.getPeriodic(periodic); periodic = fn.getPeriodic();
int numValues = values.size(); int numValues = values.size();
vector<double> x(numValues), derivs; vector<double> x(numValues), derivs;
for (int i = 0; i < numValues; i++) for (int i = 0; i < numValues; i++)
......
...@@ -76,7 +76,7 @@ extern "C" OPENMM_EXPORT CustomFunction* createReferenceTabulatedFunction(const ...@@ -76,7 +76,7 @@ extern "C" OPENMM_EXPORT CustomFunction* createReferenceTabulatedFunction(const
ReferenceContinuous1DFunction::ReferenceContinuous1DFunction(const Continuous1DFunction& function) : function(function) { ReferenceContinuous1DFunction::ReferenceContinuous1DFunction(const Continuous1DFunction& function) : function(function) {
function.getFunctionParameters(values, min, max); function.getFunctionParameters(values, min, max);
function.getPeriodic(periodic); periodic = function.getPeriodic();
int numValues = values.size(); int numValues = values.size();
x.resize(numValues); x.resize(numValues);
for (int i = 0; i < numValues; i++) for (int i = 0; i < numValues; i++)
...@@ -89,7 +89,7 @@ ReferenceContinuous1DFunction::ReferenceContinuous1DFunction(const Continuous1DF ...@@ -89,7 +89,7 @@ ReferenceContinuous1DFunction::ReferenceContinuous1DFunction(const Continuous1DF
ReferenceContinuous1DFunction::ReferenceContinuous1DFunction(const ReferenceContinuous1DFunction& other) : function(other.function) { ReferenceContinuous1DFunction::ReferenceContinuous1DFunction(const ReferenceContinuous1DFunction& other) : function(other.function) {
function.getFunctionParameters(values, min, max); function.getFunctionParameters(values, min, max);
function.getPeriodic(periodic); periodic = function.getPeriodic();
x = other.x; x = other.x;
values = other.values; values = other.values;
derivs = other.derivs; derivs = other.derivs;
......
...@@ -52,7 +52,7 @@ void Continuous1DFunctionProxy::serialize(const void* object, SerializationNode& ...@@ -52,7 +52,7 @@ void Continuous1DFunctionProxy::serialize(const void* object, SerializationNode&
for (auto v : values) for (auto v : values)
valuesNode.createChildNode("Value").setDoubleProperty("v", v); valuesNode.createChildNode("Value").setDoubleProperty("v", v);
bool periodic; bool periodic;
function.getPeriodic(periodic); periodic = function.getPeriodic();
node.setBoolProperty("periodic", periodic); node.setBoolProperty("periodic", periodic);
} }
......
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