Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:RISCV
python-scipy
nan.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File nan.patch of Package python-scipy
diff --git a/scipy/linalg/_matfuncs_expm.pyx.in b/scipy/linalg/_matfuncs_expm.pyx.in index c5c577a7e..e03b13717 100644 --- a/scipy/linalg/_matfuncs_expm.pyx.in +++ b/scipy/linalg/_matfuncs_expm.pyx.in @@ -11,7 +11,7 @@ import random cimport numpy as cnp import numpy as np from libc.stdlib cimport malloc, free -from libc.math cimport fabs, ceil, log2, pow +from libc.math cimport fabs, ceil, log2, pow, isnan from scipy.linalg.cython_lapack cimport (sgetrf, sgetrs, dgetrf, dgetrs, cgetrf, cgetrs, zgetrf, zgetrs) from scipy.linalg.cython_blas cimport (sgemm, saxpy, sscal, scopy, sgemv, @@ -96,7 +96,7 @@ def pick_pade_structure(cnp.ndarray[ndim=3, dtype=numpy_lapack_t] Am): cnp.npy_intp n = Am.shape[1] cnp.npy_intp i cnp.npy_intp [2] dims - int lm = 0 + double lm = 0 int s = 0 double normA double d4, d6, d8, d10 @@ -150,7 +150,9 @@ def pick_pade_structure(cnp.ndarray[ndim=3, dtype=numpy_lapack_t] Am): np.matmul(absA, work_arr, out=work_arr) temp = np.max(work_arr) - lm = max(<int>ceil(log2(temp/normA/coeff[0])/6), 0) + lm = ceil(log2(temp/normA/coeff[0])/6) + if isnan(lm) or lm < 0: + lm = 0 if eta0 < theta[0] and lm == 0: return 3, s @@ -161,7 +163,9 @@ def pick_pade_structure(cnp.ndarray[ndim=3, dtype=numpy_lapack_t] Am): np.matmul(absA, work_arr, out=work_arr) temp = np.max(work_arr) - lm = max(<int>ceil(log2(temp/normA/coeff[1])/10), 0) + lm = ceil(log2(temp/normA/coeff[1])/10) + if isnan(lm) or lm < 0: + lm = 0 if eta1 < theta[1] and lm == 0: return 5, s @@ -180,7 +184,9 @@ def pick_pade_structure(cnp.ndarray[ndim=3, dtype=numpy_lapack_t] Am): np.matmul(absA, work_arr, out=work_arr) temp = np.max(work_arr) - lm = max(<int>ceil(log2(temp/normA/coeff[2])/14), 0) + lm = ceil(log2(temp/normA/coeff[2])/14) + if isnan(lm) or lm < 0: + lm = 0 if eta2 < theta[2] and lm == 0: return 7, s @@ -191,7 +197,9 @@ def pick_pade_structure(cnp.ndarray[ndim=3, dtype=numpy_lapack_t] Am): np.matmul(absA, work_arr, out=work_arr) temp = np.max(work_arr) - lm = max(<int>ceil(log2(temp/normA/coeff[3])/18), 0) + lm = ceil(log2(temp/normA/coeff[3])/18) + if isnan(lm) or lm < 0: + lm = 0 if eta2 < theta[3] and lm == 0: return 9, s @@ -206,7 +214,10 @@ def pick_pade_structure(cnp.ndarray[ndim=3, dtype=numpy_lapack_t] Am): eta3 = max(d8, d10) eta4 = min(eta2, eta3) - s = max(<int>ceil(log2(eta4/theta[4])), 0) + lm = ceil(log2(eta4/theta[4])) + if isnan(lm) or lm < 0: + lm = 0 + s = <int>lm if s != 0: two_pow_s = 2.** (-s) absA *= two_pow_s @@ -221,7 +232,10 @@ def pick_pade_structure(cnp.ndarray[ndim=3, dtype=numpy_lapack_t] Am): np.matmul(absA, work_arr, out=work_arr) temp = np.max(work_arr) - s += max(<int>ceil(log2(temp/normA/coeff[4])/26), 0) + lm = ceil(log2(temp/normA/coeff[4])/26) + if isnan(lm) or lm < 0: + lm = 0 + s += <int>lm return 13, s # ============================================================================ -- 2.46.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor