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
0e104b49
Unverified
Commit
0e104b49
authored
Aug 30, 2022
by
David Williams
Committed by
GitHub
Aug 30, 2022
Browse files
Detect NaN to avoid infinite loop in JAMA::Eigenvalue (#3758)
parent
6db41c67
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
platforms/common/src/CommonKernels.cpp
platforms/common/src/CommonKernels.cpp
+7
-0
No files found.
platforms/common/src/CommonKernels.cpp
View file @
0e104b49
...
...
@@ -7571,6 +7571,13 @@ double CommonCalcRMSDForceKernel::executeImpl(ContextImpl& context) {
vector
<
REAL
>
b
;
buffer
.
download
(
b
);
// JAMA::Eigenvalue may run into an infinite loop if we have any NaN
for
(
int
i
=
0
;
i
<
9
;
i
++
)
{
if
(
b
[
i
]
!=
b
[
i
])
throw
OpenMMException
(
"NaN encountered during RMSD force calculation"
);
}
Array2D
<
double
>
F
(
4
,
4
);
F
[
0
][
0
]
=
b
[
0
*
3
+
0
]
+
b
[
1
*
3
+
1
]
+
b
[
2
*
3
+
2
];
F
[
1
][
0
]
=
b
[
1
*
3
+
2
]
-
b
[
2
*
3
+
1
];
...
...
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