Skip to content

Commit 7a42349

Browse files
Merge pull request #89 from shahriariravanian/main
temporary fix for NaNMath
2 parents 8c8405d + 72e40e1 commit 7a42349

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
name = "SymbolicNumericIntegration"
22
uuid = "78aadeae-fbc0-11eb-17b6-c7ec0477ba9e"
33
authors = ["Shahriar Iravanian <[email protected]>"]
4-
version = "1.3.3"
4+
version = "1.3.4"
55

66
[deps]
77
DataDrivenDiffEq = "2445eb08-9709-466a-b3fc-47e12bd697a2"
88
DataDrivenSparse = "5b588203-7d8b-4fab-a537-c31a7f73f46b"
99
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
1010
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
11+
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
1112
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
1213
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1314
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
@@ -17,12 +18,12 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
1718
DataDrivenDiffEq = "1.3"
1819
DataDrivenSparse = "0.1.2"
1920
DataStructures = "0.18.13"
21+
LinearAlgebra = "<0.0.1, 1"
2022
SpecialFunctions = "2"
2123
Statistics = "1.9"
2224
SymbolicUtils = "1.4"
2325
Symbolics = "5.12"
2426
julia = "1.9"
25-
LinearAlgebra = "<0.0.1, 1"
2627

2728
[extras]
2829
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/sparse.jl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,24 @@ function best_hints(eq, x, basis; plan = default_plan(), num_trials = 10)
250250
_, idx = findmin(L)
251251
return H[idx]
252252
end
253+
254+
############################################################################
255+
256+
# Fixing missing NaNMath complex functions.
257+
# Note: this is a temporary hack until upstream (NaNMath or SymbolicUtils) is fixed.
258+
259+
using NaNMath
260+
261+
NaNMath.sqrt(x::Complex) = sqrt(x)
262+
NaNMath.sin(x::Complex) = sin(x)
263+
NaNMath.cos(x::Complex) = cos(x)
264+
NaNMath.tan(x::Complex) = tan(x)
265+
NaNMath.asin(x::Complex) = asin(x)
266+
NaNMath.acos(x::Complex) = acos(x)
267+
NaNMath.acosh(x::Complex) = acosh(x)
268+
NaNMath.atanh(x::Complex) = atanh(x)
269+
NaNMath.log(x::Complex) = log(x)
270+
NaNMath.log2(x::Complex) = log2(x)
271+
NaNMath.log10(x::Complex) = log10(x)
272+
NaNMath.lgamma(x::Complex) = lgamma(x)
273+
NaNMath.log1p(x::Complex) = log1p(x)

0 commit comments

Comments
 (0)