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
549d62bd
Commit
549d62bd
authored
Nov 16, 2012
by
Peter Eastman
Browse files
Fixed failing test cases
parent
873552ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
openmmapi/include/openmm/internal/AssertionUtilities.h
openmmapi/include/openmm/internal/AssertionUtilities.h
+1
-1
platforms/opencl/tests/TestOpenCLMultipleForces.cpp
platforms/opencl/tests/TestOpenCLMultipleForces.cpp
+1
-1
No files found.
openmmapi/include/openmm/internal/AssertionUtilities.h
View file @
549d62bd
...
...
@@ -53,7 +53,7 @@ void OPENMM_EXPORT throwException(const char* file, int line, const std::string&
#define ASSERT_EQUAL_TOL(expected, found, tol) {double _scale_ = std::abs(expected) > 1.0 ? std::abs(expected) : 1.0; if (!(std::abs((expected)-(found))/_scale_ <= (tol))) {std::stringstream details; details << "Expected "<<(expected)<<", found "<<(found); throwException(__FILE__, __LINE__, details.str());}};
#define ASSERT_EQUAL_VEC(expected, found, tol) {
ASSERT_EQUAL_TOL
((expected)[0]
,
(found)[0]
, (tol)); ASSERT_EQUAL_TOL
((expected)[1]
,
(found)[1]
, (tol)); ASSERT_EQUAL_TOL
((expected)[2]
,
(found)[2]
, (tol
));};
#define ASSERT_EQUAL_VEC(expected, found, tol) {
double _norm_ = std::sqrt((expected).dot(expected)); double _scale_ = _norm_ > 1.0 ? _norm_ : 1.0; if ((std::abs(
((expected)[0]
)-(
(found)[0]
))/_scale_ > (tol)) || (std::abs(
((expected)[1]
)-(
(found)[1]
))/_scale_ > (tol)) || (std::abs(
((expected)[2]
)-(
(found)[2]
))/_scale_ > (tol))) {std::stringstream details; details << " Expected "<<(expected)<<", found "<<(found); throwException(__FILE__, __LINE__, details.str(
));}
}
;
#define ASSERT_USUALLY_EQUAL_TOL(expected, found, tol) {double _scale_ = std::abs(expected) > 1.0 ? std::abs(expected) : 1.0; if (!(std::abs((expected)-(found))/_scale_ <= (tol))) {std::stringstream details; details << "Expected "<<(expected)<<", found "<<(found)<<" (This test is stochastic and may occasionally fail)"; throwException(__FILE__, __LINE__, details.str());}};
...
...
platforms/opencl/tests/TestOpenCLMultipleForces.cpp
View file @
549d62bd
...
...
@@ -54,7 +54,7 @@ using namespace std;
OpenCLPlatform
platform
;
const
double
TOL
=
1e-
5
;
const
double
TOL
=
1e-
4
;
void
testForces
()
{
const
int
numParticles
=
100
;
...
...
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