Different implementation of the override
This commit is contained in:
parent
132b5176fe
commit
1107f86bd8
@ -106,11 +106,10 @@ export
|
|||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
import NaNMath
|
|
||||||
# define functions (e.g. `_extrema`, that uses the NaNMath version (which ignores NaNs)) when the type is applicable
|
# define functions (e.g. `_extrema`, that uses the NaNMath version (which ignores NaNs)) when the type is applicable
|
||||||
for fun in (:extrema, :minimum, :maximum, :mean)
|
for fun in (:extrema, :minimum, :maximum, :mean)
|
||||||
@eval $(Symbol(string("_",fun)))(x...) = Base.$(fun)(x...)
|
@eval $(Symbol(string("_",fun))){F<:AbstractFloat, N<:Integer}(x::AbstractArray{F, N}) = Base.$(fun)(filter(!isnan(x)))
|
||||||
@eval $(Symbol(string("_",fun))){F <: AbstractFloat}(x::AbstractVector{F}) = NaNMath.$(fun)(x)
|
@eval $(Symbol(string("_",fun)))(x) = Base.$(fun)(x)
|
||||||
end
|
end
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user