This repository was archived by the owner on Jan 12, 2024. It is now read-only.
PrepareSparseMultiConfigurationalState function excitations is empty array out of memory error #670
Labels
Kind-Enhancement
New feature or request
Status-NeedsApiReview
This PR requires an API review before merging in.
Describe the bug
Running the following programs,
PrepareSparseMultiConfigurationalState
leads to an out of memory error. By looking for the reason, it is because the length ofexcitations
is0
. This causes negative infinity when theLg
function is evaluated inside the function. The debug information: In addition, none of the functions calling truncate (ceiling, floor, round) check the special values such as infinity and NaN, so Truncate (value) is responsible for the out-of-memory error.
It is recommended to add come code to check whether the parameter of the
Truncate
is valid.To Reproduce
Expected behavior
excitations
is an empty array.Actual behavior
System.OverflowException:“Arithmetic operation resulted in an overflow.”
System information
Additional context
I can be honored to submit a PR fix. :)
The text was updated successfully, but these errors were encountered: