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

Use AbstractArray if JacobianWrapper is provided #15

Merged
merged 1 commit into from
Aug 21, 2017

Conversation

YingboMa
Copy link
Member

No description provided.

@ChrisRackauckas
Copy link
Member

I think this should be okay. Thoughts @dextorious ?

@YingboMa
Copy link
Member Author

YingboMa commented Aug 20, 2017

It can avoid allocation for the example that I made in #14 (comment)

julia> DiffEqDiffTools.finite_difference_jacobian!(J, f!, x, Val{:central}, resid, Val{:JacobianWrapper});

julia> @timev DiffEqDiffTools.finite_difference_jacobian!(J, f!, x, Val{:central}, resid, Val{:JacobianWrapper}); # master
  0.000050 seconds (51 allocations: 3.609 KiB)
elapsed time (ns): 50160
bytes allocated:   3696
pool allocs:       51

julia> include("/home/arch/DiffEqDiffTools.jl/src/DiffEqDiffTools.jl")
WARNING: replacing module DiffEqDiffTools
DiffEqDiffTools

julia> DiffEqDiffTools.finite_difference_jacobian!(J, f!, x, Val{:central}, resid, Val{:JacobianWrapper});

julia> @timev DiffEqDiffTools.finite_difference_jacobian!(J, f!, x, Val{:central}, resid, Val{:JacobianWrapper}); # This PR
  0.000013 seconds (14 allocations: 640 bytes)
elapsed time (ns): 12927
bytes allocated:   640
pool allocs:       14

@coveralls
Copy link

coveralls commented Aug 20, 2017

Coverage Status

Coverage remained the same at 43.59% when pulling 6757a5e on YingboMa:master into 1156c83 on JuliaDiffEq:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 43.59% when pulling 6757a5e on YingboMa:master into 1156c83 on JuliaDiffEq:master.

@codecov
Copy link

codecov bot commented Aug 20, 2017

Codecov Report

Merging #15 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #15   +/-   ##
=======================================
  Coverage   34.34%   34.34%           
=======================================
  Files           1        1           
  Lines         198      198           
=======================================
  Hits           68       68           
  Misses        130      130
Impacted Files Coverage Δ
src/finitediff.jl 34.34% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1156c83...6757a5e. Read the comment docs.

@dextorious
Copy link
Contributor

I think this should be fine. Interesting usage example too.

@dextorious dextorious merged commit ff050f4 into JuliaDiff:master Aug 21, 2017
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.

4 participants