-
Notifications
You must be signed in to change notification settings - Fork 6
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
Embrace view
for subspaces
#21
Comments
I guess this is related to this issue; I'm adding restrictions to FiniteDifferencesQuasi.jl, and encounter the same problem as mentioned in #37: julia> N = 10
10
julia> ρ = 1.0
1.0
julia> R = RadialDifferences(N, ρ)
Radial finite differences basis {Float64} on 0.0..10.5 with 10 points spaced by ρ = 1.0
julia> r = axes(R, 1)
Inclusion(0.0..10.5)
julia> D = Derivative(r)
Derivative{Float64,IntervalSets.Interval{:closed,:closed,Float64}}(Inclusion(0.0..10.5))
julia> R̃ = R[:,3:8]
Radial finite differences basis {Float64} on 0.0..10.5 with 10 points spaced by ρ = 1.0, restricted to basis functions 3..8 ⊂ 1..10
julia> materialize(applied(*, R̃', D, R))
6×10 BandedMatrices.BandedMatrix{Float64,Array{Float64,2},Base.OneTo{Int64}}:
⋅ -0.533333 0.0 0.514286 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ -0.514286 0.0 0.507937 ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ -0.507937 0.0 0.505051 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ -0.505051 0.0 0.503497 ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ -0.503497 0.0 0.502564 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ -0.502564 0.0 0.501961 ⋅
julia> apply(*, R̃', D, R)
6×10 BandedMatrices.BandedMatrix{Float64,Array{Float64,2},Base.OneTo{Int64}}:
⋅ -0.533333 0.0 0.514286 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ -0.514286 0.0 0.507937 ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ -0.507937 0.0 0.505051 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ -0.505051 0.0 0.503497 ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ -0.503497 0.0 0.502564 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ -0.502564 0.0 0.501961 ⋅
julia> R̃'D*R
6×10 Array{Float64,2}:
0.0 -0.533333 0.0 0.514286 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 -0.514286 0.0 0.507937 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 -0.507937 0.0 0.505051 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 -0.505051 0.0 0.503497 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 -0.503497 0.0 0.502564 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 -0.502564 0.0 0.501961 0.0 My interpretation so far is that this occurs due to Could an alternative approach to the steps you outlined above be to add a trait that decides whether to |
I think this is done. |
At the moment the following makes a lazy
*
, but I think it should be left as aview
:I believe this is what you were asking for @jagot.
The steps to make it work are
getindex
for lazy multiplication of viewsD*view(S,:,kr)
toview(D*S,:,kr)
The text was updated successfully, but these errors were encountered: