@@ -114,51 +114,3 @@ ODE_DEFAULT_UNSTABLE_CHECK(dt, u, p, t) = false
114
114
function ODE_DEFAULT_UNSTABLE_CHECK (dt, u:: Union{Number, AbstractArray{<:Number}} , p, t)
115
115
INFINITE_OR_GIANT (u)
116
116
end
117
-
118
- # Nonlinear Solve Norm (norm(_, 2))
119
- NONLINEARSOLVE_DEFAULT_NORM (u:: Union{AbstractFloat, Complex} ) = @fastmath abs (u)
120
- function NONLINEARSOLVE_DEFAULT_NORM (f:: F ,
121
- u:: Union{AbstractFloat, Complex} ) where {F}
122
- return @fastmath abs (f (u))
123
- end
124
-
125
- function NONLINEARSOLVE_DEFAULT_NORM (u:: Array {
126
- T}) where {T <: Union{AbstractFloat, Complex} }
127
- x = zero (T)
128
- @inbounds @fastmath for ui in u
129
- x += abs2 (ui)
130
- end
131
- return Base. FastMath. sqrt_fast (real (x))
132
- end
133
-
134
- function NONLINEARSOLVE_DEFAULT_NORM (f:: F ,
135
- u:: Union {Array{T}, Iterators. Zip{<: Tuple{Vararg{Array{T}}} }}) where {
136
- F, T <: Union{AbstractFloat, Complex} }
137
- x = zero (T)
138
- @inbounds @fastmath for ui in u
139
- x += abs2 (f (ui))
140
- end
141
- return Base. FastMath. sqrt_fast (real (x))
142
- end
143
-
144
- function NONLINEARSOLVE_DEFAULT_NORM (u:: StaticArraysCore.StaticArray {
145
- <: Tuple , T}) where {T <: Union{AbstractFloat, Complex} }
146
- return Base. FastMath. sqrt_fast (real (sum (abs2, u)))
147
- end
148
-
149
- function NONLINEARSOLVE_DEFAULT_NORM (f:: F ,
150
- u:: StaticArraysCore.StaticArray{<:Tuple, T} ) where {
151
- F, T <: Union{AbstractFloat, Complex} }
152
- return Base. FastMath. sqrt_fast (real (sum (abs2 ∘ f, u)))
153
- end
154
-
155
- function NONLINEARSOLVE_DEFAULT_NORM (u:: AbstractArray )
156
- return Base. FastMath. sqrt_fast (UNITLESS_ABS2 (u))
157
- end
158
-
159
- function NONLINEARSOLVE_DEFAULT_NORM (f:: F , u:: AbstractArray ) where {F}
160
- return Base. FastMath. sqrt_fast (UNITLESS_ABS2 (f, u))
161
- end
162
-
163
- NONLINEARSOLVE_DEFAULT_NORM (u) = norm (u)
164
- NONLINEARSOLVE_DEFAULT_NORM (f:: F , u) where {F} = norm (f .(u))
0 commit comments