Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function-like behavior for Taylor1, TaylorN, HomogeneousPolynomial #118

Merged
merged 21 commits into from
Sep 29, 2017
Merged

Add function-like behavior for Taylor1, TaylorN, HomogeneousPolynomial #118

merged 21 commits into from
Sep 29, 2017

Conversation

PerezHz
Copy link
Contributor

@PerezHz PerezHz commented Aug 30, 2017

This PR implements a solution for #116, and adds corresponding tests; tests are passing on my fork, thanks everyone for your feedback!

@coveralls
Copy link

coveralls commented Aug 30, 2017

Coverage Status

Coverage increased (+0.3%) to 94.51% when pulling 2f6ae2e on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

@PerezHz
Copy link
Contributor Author

PerezHz commented Aug 30, 2017

PR tests are passing, if there is anything that I missed or that you think should be added, please let me know 😄

@PerezHz PerezHz changed the title WIP: Add function-like behavior for Taylor1, TaylorN, HomogeneousPolynomial Add function-like behavior for Taylor1, TaylorN, HomogeneousPolynomial Aug 30, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 94.468% when pulling dd81b0c on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

@coveralls
Copy link

coveralls commented Aug 30, 2017

Coverage Status

Coverage increased (+0.3%) to 94.51% when pulling dd81b0c on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

@blas-ko
Copy link
Contributor

blas-ko commented Aug 31, 2017

if there is anything that I missed or that you think should be added, please let me know.

It would be a nice feature to take advantage of this PR to implement an evaluate method for an array of values. I'm thinking of something like

julia> using TaylorSeries
julia> import TaylorSeries: evaluate;
julia> function evaluate(p::Taylor1{T},x::Vector{S}) where {T<:Number,S<:Number}
    ll = length(x)
    p_eval = zeros(x)
    for (i,xi) in enumerate(x)
        @inbounds p_eval[i] = evaluate(p,xi)
    end
    return p_eval
end
julia> (p::Taylor1)(x) = evaluate(p,x) #this now works for numbers & arrays!!
julia> p = Taylor1([1,2,3,4])
 1 + 2 t + 3+ 4+ 𝒪(t⁴)
julia> p(1.0)
 10.0
julia> p([1.0,0.0])
2-element Array{Float64,1}:
 10.0
  1.0

The analogous could be done for TaylorN but instead an NxM matrix should be passed as an argument where N: number of variables, M: number of values to be evaluated.

@PerezHz
Copy link
Contributor Author

PerezHz commented Aug 31, 2017

I agree that this functionality should be available for the cases you mention, @blas-ko! Granted, I didn't add the methods you are proposing; but actually, as the way it is now, such cases may already be handled via broadcasting:

#evaluating p at a matrix of Float64s:
julia> p.([1.0 0.0; -1.0 -2.0])
2×2 Array{Float64,2}:
 10.0    1.0
 -2.0  -23.0

#evaluating p at a 3x3x3 matrix of Float64s:
julia> p.(rand(3,3,3))
3×3×3 Array{Float64,3}:
[:, :, 1] =
 8.65957  1.17927  8.12569
 1.13276  2.57914  3.37285
 2.51999  5.42389  2.04953

[:, :, 2] =
 1.03394  1.19053  3.51668
 1.15536  9.98952  4.27719
 7.29441  2.3461   2.76938

[:, :, 3] =
 1.33343  1.11886  1.08465
 5.75461  1.47925  1.78689
 1.47734  2.19666  1.84005

and for TaylorNs:

julia> ξ1, ξ2 = set_variables("ξ", numvars=2, order=15);

julia> f = sin(ξ1+ξ1*ξ2); g = exp(-sin(ξ1)+ξ1*ξ2); h = [f, g];

#evaluating f. at a vector of evaluation points returns a vector of Float64 values:
julia> f.([rand(2),rand(2)])
2-element Array{Float64,1}:
 0.974375
 0.585455

#evaluating g. at a 2x2 matrix of evaluation points returns a 2x2 matrix of Float64 values:
julia> g.( map(x->rand(2), rand(2,2)) )
2×2 Array{Float64,2}:
 0.929124  0.932631
 0.825413  0.888743

#evaluating h=[f,g] at a 2x2 matrix of evaluation points returns a 2x2 matrix of Vector{Float64}(2) values:
julia> h.( map(x->rand(2), rand(2,2)) )
2×2 Array{Array{Float64,1},2}:
 [0.674398, 0.736717]  [0.991339, 0.994949]
 [0.865741, 0.959931]  [0.460701, 0.800402]

#and so on...
julia> h.( [rand(2),rand(2)] )
2-element Array{Array{Float64,1},1}:
 [0.748772, 0.728316]
 [0.165423, 0.964655]

julia> h.( map(x->rand(2), rand(3,2,2)) )
3×2×2 Array{Array{Float64,1},3}:
[:, :, 1] =
 [0.970154, 0.996443]  [0.952156, 0.628598]
 [0.434873, 0.979518]  [0.750666, 0.492932]
 [0.839201, 0.475184]  [0.151065, 0.894432]

[:, :, 2] =
 [0.966398, 0.597349]  [0.414589, 0.901062]
 [0.045531, 0.992213]  [0.58178, 0.701201] 
 [0.395325, 0.718587]  [0.951338, 0.66144] 

I think this is, in a sense, more julian, but also more general; otherwise one would have to define a method for each particular case... The only caveat is that this behavior is only supported by julia 0.6+

EDIT: Sorry for the mistake, just tried these examples on julia 0.5.2 and they worked too!

@PerezHz
Copy link
Contributor Author

PerezHz commented Aug 31, 2017

So, for the particular case case of Taylor1 it might be enough to define:

evaluate{T<:Number,S<:Number}(p::Taylor1{T},x::Vector{S}) = evaluate.(p,x)

Thus

julia> p = Taylor1(rand(10))

julia> vr = rand(5)

julia> p(vr) == p.(vr)
true

julia> p(vr) == evaluate.(p,vr)
true

I'm gonna push this extra method for Taylor1s and corresponding tests! Thanks @blas-ko for your suggestion! I'd like to use some similar broadcasting tricks for TaylorN, but then the second argument would have to be a Vector{Vector{S}}...

@PerezHz
Copy link
Contributor Author

PerezHz commented Aug 31, 2017

Is there an easy way to convert from a Vector{Vector{T}} to an Array{T,2}?

@blas-ko
Copy link
Contributor

blas-ko commented Aug 31, 2017

such cases may already be handled via broadcasting

You're absolutely right, my fault there!

Is there an easy way to convert from a Vector{Vector{T}} to an Array{T,2}?

Maybe hcat

julia> a = [[1,2,3],[4,5,6]];
julia> @time hcat(a...)
  0.000038 seconds (8 allocations: 384 bytes)
3×2 Array{Int64,2}:
 1  1
 1  1
 2  3

@PerezHz
Copy link
Contributor Author

PerezHz commented Aug 31, 2017

Many thanks, @blas-ko!

@coveralls
Copy link

coveralls commented Aug 31, 2017

Coverage Status

Coverage increased (+0.3%) to 94.515% when pulling d7d5b71 on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

Copy link
Member

@lbenet lbenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of merging this.

I have two questions:

  • Is everything type stable? It seems to me that this is the case...

  • What about mixed-types, i.e. Taylor1{TaylorN{T}}, or TaylorN{Taylor1{T}} ?

@PerezHz
Copy link
Contributor Author

PerezHz commented Aug 31, 2017

Is everything type stable? It seems to me that this is the case...

Well, as this functionality is being proposed right now, the function-like behavior of Taylor1, etc., at the end of the day relies on evaluate, so in principle this new behavior should be as type-stable as evaluate is... Do you have any concrete cases in mind?

What about mixed-types, i.e. Taylor1{TaylorN{T}}, or TaylorN{Taylor1{T}} ?

I'm gonna add some tests for the mixtures! That's actually something important that I didn't add! 😅 sorry about that! Regarding the function-like behavior for mixtures, this again relies on evaluate, so there should be no problem, but I'm adding some tests which should check this

@PerezHz
Copy link
Contributor Author

PerezHz commented Aug 31, 2017

Thanks for all your comments @lbenet! I actually had to tweak a bit some parts of src/evaluate.jl for the mixtures, but now everything's working smoothly. Tests are passing locally on julia 0.5.2, 0.6.0 and 0.7.0-DEV.1486, but let's see what travis thinks... An important thing that I would like to note is that the tweaks in src/evaluate.jl proposed here are also consistent with TaylorIntegration.jl tests on latest master for julia 0.5.2, 0.6.0 and 0.7.0-DEV

@coveralls
Copy link

coveralls commented Aug 31, 2017

Coverage Status

Coverage increased (+1.2%) to 95.385% when pulling 105efe6 on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

@coveralls
Copy link

coveralls commented Sep 1, 2017

Coverage Status

Coverage increased (+1.0%) to 95.176% when pulling b7605bf on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+1.0%) to 95.176% when pulling b7605bf on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

@coveralls
Copy link

coveralls commented Sep 1, 2017

Coverage Status

Coverage increased (+1.0%) to 95.176% when pulling b7605bf on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

@coveralls
Copy link

coveralls commented Sep 1, 2017

Coverage Status

Coverage increased (+1.4%) to 95.542% when pulling 105efe6 on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+1.4%) to 95.542% when pulling 105efe6 on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.4%) to 95.542% when pulling 105efe6 on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

@PerezHz
Copy link
Contributor Author

PerezHz commented Sep 1, 2017

@lbenet @dpsanders there was a weird error on travis job#652.5, could you please help me restart it? otherwise, tests are passing

@dpsanders
Copy link
Contributor

I restarted the job.

Actually, with the syntax t(3) to evaluate, is there now any need for the function called evaluate?

@PerezHz
Copy link
Contributor Author

PerezHz commented Sep 1, 2017

I restarted the job.

Thanks, David!

Actually, with the syntax t(3) to evaluate, is there now any need for the function called evaluate?

Well, currently t(3) is only an alternative syntax for evaluate(t,3) (is that what is called syntactic sugar?), i.e. t(3) == evaluate(t,3), where t is a Taylor1... But I agree, if done carefully, I think it would be possible to get rid completely of the evaluate function, if we substituted the code for the evaluate methods in the definition of the (p::Taylor1)(x) methods, etc. On the other hand, probably there still would be a need for the in-place version of evaluate (i.e., the evaluate! function).

@PerezHz
Copy link
Contributor Author

PerezHz commented Sep 1, 2017

The last commit addresses more mixture cases, such as evaluating a TaylorN{Taylor1{Float64}} or an Array{TaylorN{Taylor1{Float64}}} at an Array{Taylor1{Float64}}; I added the corresponding evaluate methods and tests... On travis, once again there was a job (travis job #653.5) with some weird errors which had nothing to do with TaylorSeries.jl; after restarting everything should be working fine... Locally, tests are passing in julia 0.5.2, 0.6.0 and 0.7.0-DEV.1599

@lbenet
Copy link
Member

lbenet commented Sep 1, 2017

Actually, with the syntax t(3) to evaluate, is there now any need for the function called evaluate?

Probably we should keep evaluate for a while, and eventually not exporting it or simply deprecate it.

I just restarted one test that hung.

@coveralls
Copy link

coveralls commented Sep 1, 2017

Coverage Status

Coverage increased (+1.8%) to 95.947% when pulling cc63849 on PerezHz:jp/functors into 2381ad4 on JuliaDiff:master.

@PerezHz
Copy link
Contributor Author

PerezHz commented Sep 1, 2017

Probably we should keep evaluate for a while, and eventually not exporting it or simply deprecate it.

I agree!

I just restarted one test that hung.

Many thanks, @lbenet!

@coveralls
Copy link

coveralls commented Sep 2, 2017

Coverage Status

Coverage increased (+1.8%) to 95.947% when pulling 6ad8bc7 on PerezHz:jp/functors into 347fce1 on JuliaDiff:master.

@PerezHz
Copy link
Contributor Author

PerezHz commented Sep 3, 2017

Could you add something to the docs, and then we merge this?

Sure! I added some general details about this new behavior in the User's Guide section of the docs. I was also thinking that I should add some docstrings, but I was thinking whether I should add those in the evaluate docstrings, or in the docstrings for the constructors of Taylor1, HomogeneousPolynomial and TaylorN variables?

I'm asking this because, as I understood from JuliaDocs/Documenter.jl#228 and JuliaDocs/Documenter.jl#290, currently it is not possible to write docstrings for these kinds of methods, and the recommended approach mentioned there is to document within the type's docstring that objects of that type are callable and provide a usage example there. So, how would you recommend me to proceed?

@coveralls
Copy link

coveralls commented Sep 3, 2017

Coverage Status

Coverage increased (+1.8%) to 95.947% when pulling 8c666f7 on PerezHz:jp/functors into 347fce1 on JuliaDiff:master.

@coveralls
Copy link

coveralls commented Sep 7, 2017

Coverage Status

Coverage increased (+1.8%) to 95.967% when pulling 948936d on PerezHz:jp/functors into 347fce1 on JuliaDiff:master.

@coveralls
Copy link

coveralls commented Sep 7, 2017

Coverage Status

Coverage increased (+1.8%) to 95.96% when pulling b34a836 on PerezHz:jp/functors into 347fce1 on JuliaDiff:master.

@PerezHz
Copy link
Contributor Author

PerezHz commented Sep 27, 2017

I've updated the docstrings for evaluate as well as the docstrings for the Taylor1, HomogeneousPolynomial and TaylorN constructors. That's the only change since last commit, so travis should give green lights. If there is anything that you think should be added, please let me know; otherwise, this should be ready to be merged...

@PerezHz
Copy link
Contributor Author

PerezHz commented Sep 27, 2017

Job #19.4 is failing on travis... While working with TaylorSeries.jl, I've seen this error is related to a test which fails from time to time (test/onevariable.jl, line 343) due to use of random variables, but if re-run, then it should pass

EDIT: Sorry, "job #19.4 on travis" refers to a travis job on my fork; tests are passing for this PR!

@coveralls
Copy link

coveralls commented Sep 27, 2017

Coverage Status

Coverage increased (+1.8%) to 95.957% when pulling dad55f6 on PerezHz:jp/functors into 347fce1 on JuliaDiff:master.

@PerezHz
Copy link
Contributor Author

PerezHz commented Sep 27, 2017

Tests are now passing!

Copy link
Member

@lbenet lbenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While everyhting appears to be ok, I have some comments.

src/evaluate.jl Outdated
@@ -88,8 +97,25 @@ function evaluate{T<:Number}(a::Taylor1{T}, x::Taylor1{T})
end
suma
end
function evaluate{T<:NumberNotSeries}(a::Taylor1{Taylor1{T}}, x::Taylor1{T})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NumberNotSeries here may be too restrictive; I'm thinking in cases such as Taylor1{Taylor1{...{T}...}. Would everything work if T<:Number?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it should work! Thanks!

src/evaluate.jl Outdated
evaluate{T<:Number}(a::TaylorN{T}) = a[1][1]

function evaluate{T<:Number}(x::Array{TaylorN{T},1}, δx::Array{T,1})
x0 = Array{T}( length(x) )
evaluate!( x, δx, x0 )
return x0
end

function evaluate{T<:NumberNotSeries}(x::Array{TaylorN{T},1}, δx::Array{Taylor1{T},1})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I think the two following methods can be written as one, using T<:NumberNotSeriesN.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌Great! Thanks!

@@ -100,6 +126,25 @@ function evaluate!{T<:Number}(x::Array{TaylorN{T},1}, δx::Array{T,1},
end
nothing
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lbenet!

@PerezHz
Copy link
Contributor Author

PerezHz commented Sep 29, 2017

@lbenet: just pushed the changes you suggested; tests are passing locally on 0.5.2, 0.6.0, and 0.7.0-DEV and are running on travis right now. Again, many thanks!

@coveralls
Copy link

coveralls commented Sep 29, 2017

Coverage Status

Coverage increased (+1.8%) to 95.934% when pulling b9bda83 on PerezHz:jp/functors into 347fce1 on JuliaDiff:master.

@lbenet
Copy link
Member

lbenet commented Sep 29, 2017

Thanks a lot for your contribution! I am merging it right now!

@blas-ko
Copy link
Contributor

blas-ko commented Sep 29, 2017

I was just checking evaluation and it seems that broadcasting is pretty slow; check the following

julia> using TaylorSeries; import TaylorSeries: evaluate 

julia> function evaluate{T<:Number}(a::Taylor1{T},vals::Vector{T})
           ll = length(vals)
           sumas = zeros(T,ll)
           for i in 1:ll
               sumas[i] = evaluate(a,vals[i])
           end
           return sumas
       end
evaluate (generic function with 15 methods)

julia> function evaluate{T<:Number,S<:Number}(a::Taylor1{T},vals::Vector{S})
           ll = length(vals)
           R = promote_type(S,T)
           sumas = zeros(R,ll)
           for i in 1:ll
               sumas[i] = evaluate(a,vals[i])
           end
           return sumas
       end
evaluate (generic function with 16 methods)

julia> t = Taylor1(10); a = collect(0.:0.5:10);

julia> using BenchmarkTools

julia> @btime evaluate(t,a); @btime evaluate.(t,a);
  402.035 ns (1 allocation: 256 bytes)
  7.380 μs (26 allocations: 1.31 KiB)

I've not done this with the other cases, but in this particular case the difference is yuuuge. Maybe it's worth it to write the specific methods for evaluating in vectors or matrices.

@lbenet lbenet merged commit 3b68fb3 into JuliaDiff:master Sep 29, 2017
@lbenet
Copy link
Member

lbenet commented Sep 29, 2017

@blas-ko I just merged this PR, seemingly at the same time you wrote your comment, though I was a bit faster ;-).

You are right that broadcasting (here) incurs in some allocations that cost time, roughly a factor 18. Note that

julia> @which evaluate.(t,a)
broadcast(f, A, Bs...) in Base.Broadcast at broadcast.jl:434

so my guess is that internally broadcast calls evaluate(t,a[i]) with some internal evaluations, which are not as efficient as the explicit method. In other words, if there is a method that does broadcasting, use it.

blas-ko pushed a commit to blas-ko/TaylorSeries.jl that referenced this pull request Oct 2, 2017
JuliaDiff#118)

* Add function-like behavior for Taylor1

* Relocate new code

* Add function-like behavior for TaylorN

* Fix TaylorN functor methods

* Add tests for Taylor1

* Add more Taylor1 tests

* Add TaylorN tests; more Taylor1 tests; add missing evaluate methods

* Add function-like behavior for HomogeneousPolynomial and corresponding tests

* Add missing tests for HomogeneousPolynomial

* Add another test for Taylor1s

* Fix test

* Add extra evaluate method for Taylor1 (suggested by @blas-ko)

* Add an evaluate test for mixtures (more to come)

* Add tests for mixtures; add/fix evaluate methods

* A small fix

* Add missing evaluate methods for mixtures and tests

* Update docs

* Add evaluate method and tests

* Fix new method

* Update docstrings

* Changes suggested by @lbenet 's review
blas-ko pushed a commit to blas-ko/TaylorSeries.jl that referenced this pull request Oct 6, 2017
JuliaDiff#118)

* Add function-like behavior for Taylor1

* Relocate new code

* Add function-like behavior for TaylorN

* Fix TaylorN functor methods

* Add tests for Taylor1

* Add more Taylor1 tests

* Add TaylorN tests; more Taylor1 tests; add missing evaluate methods

* Add function-like behavior for HomogeneousPolynomial and corresponding tests

* Add missing tests for HomogeneousPolynomial

* Add another test for Taylor1s

* Fix test

* Add extra evaluate method for Taylor1 (suggested by @blas-ko)

* Add an evaluate test for mixtures (more to come)

* Add tests for mixtures; add/fix evaluate methods

* A small fix

* Add missing evaluate methods for mixtures and tests

* Update docs

* Add evaluate method and tests

* Fix new method

* Update docstrings

* Changes suggested by @lbenet 's review
lbenet pushed a commit that referenced this pull request Oct 8, 2017
* Added function and macro `taylor_expand` for expanding arbitraty functions.

* Deleted macros and set order as keyword argument so methods doesnt clash

`taylor_expand(f,x0::Int64)` and `taylor_expand(f,order)` clashed.

* Added some tests for `taylor_expand`.

* un-exported taylor_expand macros.

* Updated taylor_expand tests.

* Added taylor_expand method for TaylorN and warning if number of variables is changed.

* Fix travis issue for taylor_expand (hopefully).

* Added taylor_expand! and tests for Taylor1.

Followed suggestion from @lbenet.

* Add function-like behavior for Taylor1, TaylorN, HomogeneousPolynomial (#118)

* Add function-like behavior for Taylor1

* Relocate new code

* Add function-like behavior for TaylorN

* Fix TaylorN functor methods

* Add tests for Taylor1

* Add more Taylor1 tests

* Add TaylorN tests; more Taylor1 tests; add missing evaluate methods

* Add function-like behavior for HomogeneousPolynomial and corresponding tests

* Add missing tests for HomogeneousPolynomial

* Add another test for Taylor1s

* Fix test

* Add extra evaluate method for Taylor1 (suggested by @blas-ko)

* Add an evaluate test for mixtures (more to come)

* Add tests for mixtures; add/fix evaluate methods

* A small fix

* Add missing evaluate methods for mixtures and tests

* Update docs

* Add evaluate method and tests

* Fix new method

* Update docstrings

* Changes suggested by @lbenet 's review

* Added method for evaluating a TaylorN with an array of TaylorNs.

* Added taylor_expand! method for TaylorN

* Added some test for taylor_expand!

* Documentation for taylor_expand and taylor_expand!

* Added function and macro `taylor_expand` for expanding arbitraty functions.

* Deleted macros and set order as keyword argument so methods doesnt clash

`taylor_expand(f,x0::Int64)` and `taylor_expand(f,order)` clashed.

* Added some tests for `taylor_expand`.

* un-exported taylor_expand macros.

* Updated taylor_expand tests.

* Added taylor_expand method for TaylorN and warning if number of variables is changed.

* Fix travis issue for taylor_expand (hopefully).

* Added taylor_expand! and tests for Taylor1.

Followed suggestion from @lbenet.

* Add function-like behavior for Taylor1, TaylorN, HomogeneousPolynomial (#118)

* Add function-like behavior for Taylor1

* Relocate new code

* Add function-like behavior for TaylorN

* Fix TaylorN functor methods

* Add tests for Taylor1

* Add more Taylor1 tests

* Add TaylorN tests; more Taylor1 tests; add missing evaluate methods

* Add function-like behavior for HomogeneousPolynomial and corresponding tests

* Add missing tests for HomogeneousPolynomial

* Add another test for Taylor1s

* Fix test

* Add extra evaluate method for Taylor1 (suggested by @blas-ko)

* Add an evaluate test for mixtures (more to come)

* Add tests for mixtures; add/fix evaluate methods

* A small fix

* Add missing evaluate methods for mixtures and tests

* Update docs

* Add evaluate method and tests

* Fix new method

* Update docstrings

* Changes suggested by @lbenet 's review

* Added method for evaluating a TaylorN with an array of TaylorNs.

* Added taylor_expand! method for TaylorN

* Added some test for taylor_expand!

* Documentation for taylor_expand and taylor_expand!

* Corrected silly mistake from rebasing.

* Rearanged taylor_expand tests to another place.

They use set_variables internally.

* called coeff_table directly so it doesn't make a copy.

* changed docs for taylor_expand

* Changed taylor_expand for TaylorN.

* It doesn't use set_variables() anymore.
* typeof(x0) is preserved if possible.

* Changed taylor_expand! for update!

* Added 1 more test...

* Little performance and compatibility fix for taylor_expand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants