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