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
2507ee7f
Commit
2507ee7f
authored
Jun 25, 2020
by
Charlles Abreu
Browse files
Replaced not_equal macro by notEqual function
parent
6bf99439
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
openmmapi/src/SplineFitter.cpp
openmmapi/src/SplineFitter.cpp
+5
-2
No files found.
openmmapi/src/SplineFitter.cpp
View file @
2507ee7f
...
...
@@ -30,6 +30,7 @@
* -------------------------------------------------------------------------- */
#include <vector>
#include <math.h>
#include "openmm/internal/SplineFitter.h"
#include "openmm/OpenMMException.h"
...
...
@@ -37,7 +38,9 @@
using
namespace
OpenMM
;
using
namespace
std
;
#define not_equal(a, b) (abs((a)-(b)) > 1e-15 + 1e-15*abs(b)) // same as scipy.interpolate()
static
bool
notEqual
(
double
a
,
double
b
)
{
return
(
fabs
(
a
-
b
)
>
1e-15
+
1e-15
*
fabs
(
b
));
}
void
SplineFitter
::
createSpline
(
const
vector
<
double
>&
x
,
const
vector
<
double
>&
y
,
bool
periodic
,
vector
<
double
>&
deriv
)
{
if
(
periodic
)
...
...
@@ -89,7 +92,7 @@ void SplineFitter::createPeriodicSpline(const vector<double>& x, const vector<do
throw
OpenMMException
(
"createPeriodicSpline: x and y vectors must have same length"
);
if
(
n
<
3
)
throw
OpenMMException
(
"createPeriodicSpline: the length of the input array must be at least 3"
);
if
(
not
_e
qual
(
y
[
0
],
y
[
n
-
1
]))
if
(
not
E
qual
(
y
[
0
],
y
[
n
-
1
]))
throw
OpenMMException
(
"createPeriodicSpline: the first and last points must have the same value"
);
deriv
.
resize
(
n
);
...
...
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