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
4112ece5
"olla/vscode:/vscode.git/clone" did not exist on "baa4dcfd37b1ccb7d1d4b8d46e6bb632ded4478e"
Commit
4112ece5
authored
Nov 23, 2009
by
Mark Friedrichs
Browse files
Mods to get validation code to compile on windows
parent
e8a4c506
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
libraries/validate/include/ValidateOpenMM.h
libraries/validate/include/ValidateOpenMM.h
+1
-0
libraries/validate/src/ValidateOpenMM.cpp
libraries/validate/src/ValidateOpenMM.cpp
+2
-1
libraries/validate/src/ValidateOpenMMForces.cpp
libraries/validate/src/ValidateOpenMMForces.cpp
+3
-4
No files found.
libraries/validate/include/ValidateOpenMM.h
View file @
4112ece5
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include <typeinfo>
#include <typeinfo>
#ifdef _MSC_VER
#ifdef _MSC_VER
#include <limits>
#define isinf !_finite
#define isinf !_finite
#define isnan _isnan
#define isnan _isnan
#endif
#endif
...
...
libraries/validate/src/ValidateOpenMM.cpp
View file @
4112ece5
...
@@ -77,6 +77,7 @@ ValidateOpenMM::ValidateOpenMM( void ) {
...
@@ -77,6 +77,7 @@ ValidateOpenMM::ValidateOpenMM( void ) {
ValidateOpenMM
::~
ValidateOpenMM
()
{
ValidateOpenMM
::~
ValidateOpenMM
()
{
}
}
int
ValidateOpenMM
::
isNan
(
double
number
){
int
ValidateOpenMM
::
isNan
(
double
number
){
return
isinf
(
number
)
||
isnan
(
number
)
?
1
:
0
;
return
isinf
(
number
)
||
isnan
(
number
)
?
1
:
0
;
}
}
...
@@ -843,7 +844,7 @@ void ValidateOpenMM::copyConstraints( const System& systemToCopy, System* system
...
@@ -843,7 +844,7 @@ void ValidateOpenMM::copyConstraints( const System& systemToCopy, System* system
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
for
(
unsigned
int
ii
=
0
;
ii
<
systemToCopy
.
getNumConstraints
();
ii
++
){
for
(
int
ii
=
0
;
ii
<
systemToCopy
.
getNumConstraints
();
ii
++
){
int
particle1
,
particle2
;
int
particle1
,
particle2
;
double
distance
;
double
distance
;
systemToCopy
.
getConstraintParameters
(
ii
,
particle1
,
particle2
,
distance
);
systemToCopy
.
getConstraintParameters
(
ii
,
particle1
,
particle2
,
distance
);
...
...
libraries/validate/src/ValidateOpenMMForces.cpp
View file @
4112ece5
...
@@ -505,7 +505,7 @@ void ValidateOpenMMForces::compareOpenMMForces( Context& context, Platform& plat
...
@@ -505,7 +505,7 @@ void ValidateOpenMMForces::compareOpenMMForces( Context& context, Platform& plat
const
System
&
system
=
context
.
getSystem
();
const
System
&
system
=
context
.
getSystem
();
std
::
vector
<
int
>
compareAllForces
;
std
::
vector
<
int
>
compareAllForces
;
for
(
unsigned
int
ii
=
0
;
ii
<
system
.
getNumForces
();
ii
++
){
for
(
int
ii
=
0
;
ii
<
system
.
getNumForces
();
ii
++
){
std
::
vector
<
int
>
compareForces
;
std
::
vector
<
int
>
compareForces
;
std
::
string
forceName
=
getForceName
(
system
.
getForce
(
ii
)
);
std
::
string
forceName
=
getForceName
(
system
.
getForce
(
ii
)
);
if
(
isExcludedForce
(
forceName
)
==
0
){
if
(
isExcludedForce
(
forceName
)
==
0
){
...
@@ -772,7 +772,7 @@ std::string ValidateOpenMMForces::getSummary( std::vector<ForceValidationResult*
...
@@ -772,7 +772,7 @@ std::string ValidateOpenMMForces::getSummary( std::vector<ForceValidationResult*
#define LOCAL_SPRINTF12(a,b,c,d,e,f,g,h,i,j,k,l) sprintf( (a), (b), (c), (d), (e), (f), (g), (h), (i), (j), (k), (l) );
#define LOCAL_SPRINTF12(a,b,c,d,e,f,g,h,i,j,k,l) sprintf( (a), (b), (c), (d), (e), (f), (g), (h), (i), (j), (k), (l) );
#endif
#endif
int
maxMissesToPrint
=
getMaxErrorsToPrint
();
unsigned
int
maxMissesToPrint
=
static_cast
<
unsigned
int
>
(
getMaxErrorsToPrint
()
)
;
std
::
stringstream
summary
;
std
::
stringstream
summary
;
std
::
string
tab
=
" "
;
std
::
string
tab
=
" "
;
int
useForces
=
1
;
int
useForces
=
1
;
...
@@ -829,8 +829,7 @@ std::string ValidateOpenMMForces::getSummary( std::vector<ForceValidationResult*
...
@@ -829,8 +829,7 @@ std::string ValidateOpenMMForces::getSummary( std::vector<ForceValidationResult*
std
::
vector
<
double
>
forceNorms2
=
forceValidationResults
[
ii
]
->
getForceNorms
(
1
);
std
::
vector
<
double
>
forceNorms2
=
forceValidationResults
[
ii
]
->
getForceNorms
(
1
);
for
(
unsigned
int
kk
=
0
;
kk
<
inconsistentIndices
.
size
()
&&
kk
<
maxMissesToPrint
;
kk
++
){
for
(
unsigned
int
kk
=
0
;
kk
<
inconsistentIndices
.
size
()
&&
kk
<
maxMissesToPrint
;
kk
++
){
int
jj
=
inconsistentIndices
[
kk
];
int
jj
=
inconsistentIndices
[
kk
];
if
(
isinf
(
forceNorms1
[
jj
]
)
||
isnan
(
forceNorms1
[
jj
]
)
||
if
(
isNan
(
forceNorms1
[
jj
]
)
||
isNan
(
forceNorms2
[
jj
]
)
){
isinf
(
forceNorms2
[
jj
]
)
||
isnan
(
forceNorms2
[
jj
]
)
){
(
void
)
LOCAL_SPRINTF5
(
value
,
" nan at index %6d norms: [%12.5e %12.5e]"
,
jj
,
forceNorms1
[
jj
],
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
);
summary
<<
_getLine
(
tab
,
"Error"
,
value
);
}
else
{
}
else
{
...
...
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