Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
a39e5bee
Commit
a39e5bee
authored
Mar 31, 2020
by
Charlles Abreu
Browse files
Direct value return in Continuous1DFunction.getPeriodic
parent
09600365
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
8 deletions
+7
-8
openmmapi/include/openmm/TabulatedFunction.h
openmmapi/include/openmm/TabulatedFunction.h
+1
-2
openmmapi/src/TabulatedFunction.cpp
openmmapi/src/TabulatedFunction.cpp
+2
-2
platforms/common/src/ExpressionUtilities.cpp
platforms/common/src/ExpressionUtilities.cpp
+1
-1
platforms/reference/src/ReferenceTabulatedFunction.cpp
platforms/reference/src/ReferenceTabulatedFunction.cpp
+2
-2
serialization/src/TabulatedFunctionProxies.cpp
serialization/src/TabulatedFunctionProxies.cpp
+1
-1
No files found.
openmmapi/include/openmm/TabulatedFunction.h
View file @
a39e5bee
...
@@ -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.
*
*
...
...
openmmapi/src/TabulatedFunction.cpp
View file @
a39e5bee
...
@@ -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
)
{
...
...
platforms/common/src/ExpressionUtilities.cpp
View file @
a39e5bee
...
@@ -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
++
)
...
...
platforms/reference/src/ReferenceTabulatedFunction.cpp
View file @
a39e5bee
...
@@ -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
;
...
...
serialization/src/TabulatedFunctionProxies.cpp
View file @
a39e5bee
...
@@ -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
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment