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
6e543d20
Commit
6e543d20
authored
Nov 25, 2009
by
Peter Eastman
Browse files
Fixed compilation errors
parent
9904545a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
19 deletions
+11
-19
libraries/validate/include/ValidateOpenMM.h
libraries/validate/include/ValidateOpenMM.h
+4
-8
libraries/validate/src/ValidateOpenMM.cpp
libraries/validate/src/ValidateOpenMM.cpp
+2
-2
libraries/validate/src/ValidateOpenMMForces.cpp
libraries/validate/src/ValidateOpenMMForces.cpp
+5
-5
openmmapi/include/openmm/Force.h
openmmapi/include/openmm/Force.h
+0
-4
No files found.
libraries/validate/include/ValidateOpenMM.h
View file @
6e543d20
...
...
@@ -44,11 +44,7 @@
#include <sstream>
#include <typeinfo>
#ifdef _MSC_VER
#include <limits>
#define isinf !_finite
#define isnan _isnan
#endif
#include <limits>
namespace
OpenMM
{
...
...
@@ -111,14 +107,14 @@ public:
static
const
std
::
string
CUSTOM_NONBONDED_FORCE
;
/**
* Return true if input number is nan
* Return true if input number is nan
or infinity
*
* @param number number to test
*
* @return true if number is nan
* @return true if number is nan
or infinity
*/
static
int
isNan
(
double
number
);
static
int
isNan
OrInfinity
(
double
number
);
/**
* Get force name
...
...
libraries/validate/src/ValidateOpenMM.cpp
View file @
6e543d20
...
...
@@ -78,8 +78,8 @@ ValidateOpenMM::~ValidateOpenMM() {
}
int
ValidateOpenMM
::
isNan
(
double
number
){
return
isinf
(
number
)
||
isnan
(
number
)
?
1
:
0
;
int
ValidateOpenMM
::
isNan
OrInfinity
(
double
number
){
return
(
number
!=
number
||
number
==
std
::
numeric_limits
<
double
>::
infinity
()
||
number
==
-
std
::
numeric_limits
<
double
>::
infinity
()
)
?
1
:
0
;
}
FILE
*
ValidateOpenMM
::
getLog
(
void
)
const
{
...
...
libraries/validate/src/ValidateOpenMMForces.cpp
View file @
6e543d20
...
...
@@ -46,7 +46,7 @@ ForceValidationResult::ForceValidationResult( const Context& context1, const Con
_potentialEnergies
[
0
]
=
state1
.
getPotentialEnergy
();
_potentialEnergies
[
1
]
=
state2
.
getPotentialEnergy
();
if
(
ValidateOpenMM
::
isNan
(
_potentialEnergies
[
0
]
)
||
ValidateOpenMM
::
isNan
(
_potentialEnergies
[
1
]
)
){
if
(
ValidateOpenMM
::
isNan
OrInfinity
(
_potentialEnergies
[
0
]
)
||
ValidateOpenMM
::
isNan
OrInfinity
(
_potentialEnergies
[
1
]
)
){
_nansDetected
++
;
}
...
...
@@ -154,7 +154,7 @@ void ForceValidationResult::_calculateNormOfForceVector( int forceIndex ){
for
(
unsigned
int
ii
=
0
;
ii
<
_forces
[
forceIndex
].
size
();
ii
++
){
Vec3
f1
=
_forces
[
forceIndex
][
ii
];
_norms
[
forceIndex
].
push_back
(
std
::
sqrt
(
(
f1
[
0
]
*
f1
[
0
])
+
(
f1
[
1
]
*
f1
[
1
])
+
(
f1
[
2
]
*
f1
[
2
])
)
);
if
(
ValidateOpenMM
::
isNan
(
f1
[
0
]
)
||
ValidateOpenMM
::
isNan
(
f1
[
1
]
)
||
ValidateOpenMM
::
isNan
(
f1
[
2
]
)
){
if
(
ValidateOpenMM
::
isNan
OrInfinity
(
f1
[
0
]
)
||
ValidateOpenMM
::
isNan
OrInfinity
(
f1
[
1
]
)
||
ValidateOpenMM
::
isNan
OrInfinity
(
f1
[
2
]
)
){
_nansDetected
++
;
}
}
...
...
@@ -375,7 +375,7 @@ void ForceValidationResult::compareForces( double tolerance ){
clearInconsistentForceIndexList
(
);
for
(
unsigned
int
jj
=
0
;
jj
<
forces1
.
size
();
jj
++
){
if
(
ValidateOpenMM
::
isNan
(
forceNorms1
[
jj
]
)
||
ValidateOpenMM
::
isNan
(
forceNorms2
[
jj
]
)
){
if
(
ValidateOpenMM
::
isNan
OrInfinity
(
forceNorms1
[
jj
]
)
||
ValidateOpenMM
::
isNan
OrInfinity
(
forceNorms2
[
jj
]
)
){
registerInconsistentForceIndex
(
jj
);
}
else
{
double
delta
=
std
::
sqrt
(
(
forces1
[
jj
][
0
]
-
forces2
[
jj
][
0
])
*
(
forces1
[
jj
][
0
]
-
forces2
[
jj
][
0
])
+
...
...
@@ -405,7 +405,7 @@ void ForceValidationResult::compareForceNorms( double tolerance ){
clearInconsistentForceIndexList
(
);
for
(
unsigned
int
jj
=
0
;
jj
<
forceNorms0
.
size
();
jj
++
){
if
(
ValidateOpenMM
::
isNan
(
forceNorms0
[
jj
]
)
||
ValidateOpenMM
::
isNan
(
forceNorms1
[
jj
]
)
){
if
(
ValidateOpenMM
::
isNan
OrInfinity
(
forceNorms0
[
jj
]
)
||
ValidateOpenMM
::
isNan
OrInfinity
(
forceNorms1
[
jj
]
)
){
registerInconsistentForceIndex
(
jj
);
}
else
{
double
sum
=
0.5
*
(
fabs
(
forceNorms0
[
jj
]
)
+
fabs
(
forceNorms1
[
jj
]
)
);
...
...
@@ -829,7 +829,7 @@ std::string ValidateOpenMMForces::getSummary( std::vector<ForceValidationResult*
std
::
vector
<
double
>
forceNorms2
=
forceValidationResults
[
ii
]
->
getForceNorms
(
1
);
for
(
unsigned
int
kk
=
0
;
kk
<
inconsistentIndices
.
size
()
&&
kk
<
maxMissesToPrint
;
kk
++
){
int
jj
=
inconsistentIndices
[
kk
];
if
(
isNan
(
forceNorms1
[
jj
]
)
||
isNan
(
forceNorms2
[
jj
]
)
){
if
(
isNan
OrInfinity
(
forceNorms1
[
jj
]
)
||
isNan
OrInfinity
(
forceNorms2
[
jj
]
)
){
(
void
)
LOCAL_SPRINTF5
(
value
,
" nan at index %6d norms: [%12.5e %12.5e]"
,
jj
,
forceNorms1
[
jj
],
forceNorms2
[
jj
]
);
summary
<<
_getLine
(
tab
,
"Error"
,
value
);
}
else
{
...
...
openmmapi/include/openmm/Force.h
View file @
6e543d20
...
...
@@ -66,10 +66,6 @@ protected:
* The ForceImpl will be deleted automatically when the Context is deleted.
*/
virtual
ForceImpl
*
createImpl
()
=
0
;
private:
Force
&
operator
=
(
const
Force
&
rhs
);
Force
(
const
Force
&
rhs
);
};
}
// namespace OpenMM
...
...
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