Skip to content

Commit

Permalink
Change AbstractVector to AbstractArray{T,1}
Browse files Browse the repository at this point in the history
  • Loading branch information
mBarreau authored and tansongchen committed Aug 23, 2023
1 parent baf60d3 commit 1aa65d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/derivative.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function derivative end
end

@inline function derivative(f, x::V, l::V,
order::Int64) where {V <: AbstractVector{<:Number}}
order::Int64) where {V <: AbstractArray{<:Number, 1}}
derivative(f, x, l, Val{order + 1}())
end

Expand All @@ -32,7 +32,7 @@ end
make_taylor(t0::T, t1::T, ::Val{N}) where {T, N} = TaylorScalar{T, N}(t0, t1)

@inline function derivative(f, x::V, l::V,
vN::Val{N}) where {V <: AbstractVector{<:Number}, N}
vN::Val{N}) where {V <: AbstractArray{<:Number, 1}, N}
t = map((t0, t1) -> make_taylor(t0, t1, vN), x, l) # i.e. map(TaylorScalar{T, N}, x, l)
return extract_derivative(f(t), N)
end

0 comments on commit 1aa65d7

Please sign in to comment.