Skip to content

Commit 5d927a6

Browse files
committed
quasimatrix ldiv
1 parent 4336eca commit 5d927a6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/bases/bases.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ end
111111
a,b = arguments(B)
112112
@assert a isa AbstractQuasiVector # Only works for vec .* mat
113113
ab = (A * (A \ a)) .* b # broadcasted should be overloaded
114-
# MemoryLayout(ab) isa BroadcastLayout && error("Overload broadcasted(_, ::typeof(*), ::$(typeof(ab.args[1])), ::$(typeof(b)))")
114+
MemoryLayout(ab) isa BroadcastLayout && return transform_ldiv(A, ab)
115115
A \ ab
116116
end
117117

@@ -177,6 +177,7 @@ struct ProjectionFactorization{T, FAC<:Factorization{T}, INDS} <: Factorization{
177177
end
178178

179179
\(a::ProjectionFactorization, b::AbstractQuasiVector) = (a.F \ b)[a.inds]
180+
\(a::ProjectionFactorization, b::AbstractQuasiMatrix) = (a.F \ b)[a.inds,:]
180181
\(a::ProjectionFactorization, b::AbstractVector) = (a.F \ b)[a.inds]
181182

182183
_factorize(::SubBasisLayout, L) = ProjectionFactorization(factorize(parent(L)), parentindices(L)[2])
@@ -188,6 +189,8 @@ end
188189

189190
\(a::MappedFactorization, b::AbstractQuasiVector) = a.F \ view(b, a.map)
190191
\(a::MappedFactorization, b::AbstractVector) = a.F \ b
192+
\(a::MappedFactorization, b::AbstractQuasiMatrix) = a.F \ view(b, a.map, :)
193+
191194

192195
function invmap end
193196

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ end
439439
@test ContinuumArrays.demap(view(axes(L,1),y)) == axes(L,1)
440440

441441
@test L[y,:] \ (y .* exp.(y)) L[y,:] \ BroadcastQuasiVector(y -> y*exp(y), y)
442-
@ent L[y,:] \ (y .* L[y,:])
442+
@test L[y,:] \ (y .* L[y,1:3]) [L[y,:]\(y .* L[y,1]) L[y,:]\(y .* L[y,2]) L[y,:]\(y .* L[y,3])]
443443
end
444444
end
445445

0 commit comments

Comments
 (0)