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

allow functionoperator (batch = false) to accept/return vec'd arrays #210

Merged
merged 3 commits into from
Jul 18, 2023

Conversation

vpuri3
Copy link
Member

@vpuri3 vpuri3 commented Jul 18, 2023

@ChrisRackauckas

with this branch,

julia> f(u, p, t) = 2u; f(v, u, p, t) = mul!(v, 2, u);                                                                                                               [30/1927]
                                           
julia> F = FunctionOperator(f, ones(4, 4));
                                           
julia> F * ones(4, 4)
4×4 Matrix{Float64}:
 2.0  2.0  2.0  2.0
 2.0  2.0  2.0  2.0
 2.0  2.0  2.0  2.0
 2.0  2.0  2.0  2.0                        

julia> F * vec(ones(4, 4))
16-element Vector{Float64}:
 2.0
 2.0
 2.0
 2.0
 2.0
...
julia> mul!(zeros(16), F, ones(16))
16-element Vector{Float64}:
 2.0
 2.0
 2.0
 2.0
 2.0
...

@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #210 (734205b) into master (f169b36) will increase coverage by 0.80%.
The diff coverage is 73.41%.

@@            Coverage Diff             @@
##           master     #210      +/-   ##
==========================================
+ Coverage   70.31%   71.12%   +0.80%     
==========================================
  Files          10       10              
  Lines        1533     1562      +29     
==========================================
+ Hits         1078     1111      +33     
+ Misses        455      451       -4     
Impacted Files Coverage Δ
src/func.jl 84.55% <73.41%> (+3.48%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ChrisRackauckas
Copy link
Member

Should we just remove the vec in that spot of OrdinaryDiffEq if it's hitting an operator?

@vpuri3
Copy link
Member Author

vpuri3 commented Jul 18, 2023

We will remove the entire WOperator object evenetually.

The idea behind this PR is that we should support vec'd arrays anyway because one or the other downstream packages would use it. I've added warnings, docs etc all over the place as well. So after this PR, I believe we will be hitting all use cases and this package will be as versatile as it gets.

@vpuri3
Copy link
Member Author

vpuri3 commented Jul 18, 2023

We should also move preconditioner tests to interfaceII in ODE.jl

@vpuri3
Copy link
Member Author

vpuri3 commented Jul 18, 2023

BTW the failing test in preconditioner.jl is passing now

@ChrisRackauckas ChrisRackauckas merged commit a13f333 into SciML:master Jul 18, 2023
16 checks passed
@vpuri3 vpuri3 deleted the vec branch July 18, 2023 17:36
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.

2 participants