You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on PR #118 (see also discussion in #116), I was thinking that perhaps it'd be nice to have defined evaluate{T<:NumberNotSeries}(a::TaylorN{T}, vals::Array{TaylorN{T},1}), or something similar, in order to be able to compose Taylor expansions of N-variable functions. There is already a similar method for Taylor1, which allows to evaluate a Taylor1 on a Taylor1.
What I'm trying to say (using syntax from #118) is that whereas it is possible to compose two Taylor1s,
analogous things cannot currently be done for TaylorNs:
julia>using TaylorSeries
julia> dx =set_variables("x", numvars=4, order=10);
julia> v = [1.0,2,3,4];
julia> dx[1](v) #TaylorN evaluated at a Vector{Float64}1.0
julia>dx(v) #Vector{TaylorN} evaluated at a Vector{Float64}4-element Array{Float64,1}:1.02.03.04.0
julia> dx[1](dx)#TaylorN evaluated at a Vector{TaylorN}
ERROR: MethodError: no method matching evaluate(::TaylorSeries.TaylorN{Float64}, ::Array{TaylorSeries.TaylorN{Float64},1})
Closest candidates are:evaluate(::TaylorSeries.TaylorN{T<:Number}) where T<:Number at /Users/Jorge/forks/TaylorSeries.jl/src/evaluate.jl:211evaluate(::TaylorSeries.TaylorN{T<:Number}, ::Array{S<:Union{Complex, Real},1}) where {T<:Number, S<:Union{Complex, Real}} at /Users/Jorge/forks/TaylorSeries.jl/src/evaluate.jl:164evaluate(::TaylorSeries.TaylorN{T<:Number}, ::Array{TaylorSeries.Taylor1{S<:Union{Complex, Real}},1}) where {T<:Number, S<:Union{Complex, Real}} at /Users/Jorge/forks/TaylorSeries.jl/src/evaluate.jl:188...
Stacktrace:
[1] (::TaylorSeries.TaylorN{Float64})(::Array{TaylorSeries.TaylorN{Float64},1}) at /Users/Jorge/forks/TaylorSeries.jl/src/evaluate.jl:229
julia>dx(dx) #Vector{TaylorN} evaluated at a Vector{TaylorN}
ERROR: MethodError: no method matching evaluate(::Array{TaylorSeries.TaylorN{Float64},1}, ::Array{TaylorSeries.TaylorN{Float64},1})
Closest candidates are:evaluate(::Array{TaylorSeries.TaylorN{T<:Union{Complex, Real}},1}, ::Array{S<:Union{Complex, Real},1}) where {T<:Union{Complex, Real}, S<:Union{Complex, Real}} at /Users/Jorge/forks/TaylorSeries.jl/src/evaluate.jl:220evaluate(::Array{TaylorSeries.TaylorN{T<:Number},1}) where T<:Number at /Users/Jorge/forks/TaylorSeries.jl/src/evaluate.jl:226evaluate(::Array{TaylorSeries.TaylorN{T<:Number},1}, ::Array{T<:Number,1}) where T<:Number at /Users/Jorge/forks/TaylorSeries.jl/src/evaluate.jl:214
Stacktrace:
[1] (::Array{TaylorSeries.TaylorN{Float64},1})(::Array{TaylorSeries.TaylorN{Float64},1}) at /Users/Jorge/forks/TaylorSeries.jl/src/evaluate.jl:234
I have some ideas on this that actually I was already testing while working on #118, so if there's interest I can submit a PR!
The text was updated successfully, but these errors were encountered:
I though also about this some time ago, and while I think it would be nice, it is quite tricky because the way things are currently. But, please, go ahead and submit a PR.
While working on PR #118 (see also discussion in #116), I was thinking that perhaps it'd be nice to have defined
evaluate{T<:NumberNotSeries}(a::TaylorN{T}, vals::Array{TaylorN{T},1})
, or something similar, in order to be able to compose Taylor expansions of N-variable functions. There is already a similar method forTaylor1
, which allows to evaluate aTaylor1
on aTaylor1
.What I'm trying to say (using syntax from #118) is that whereas it is possible to compose two
Taylor1
s,analogous things cannot currently be done for
TaylorN
s:I have some ideas on this that actually I was already testing while working on #118, so if there's interest I can submit a PR!
The text was updated successfully, but these errors were encountered: