Skip to content

Commit 4336eca

Browse files
committed
add tests
1 parent 7e2285f commit 4336eca

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/bases/bases.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ function copy(P::Ldiv{<:MappedBasisLayouts,<:AbstractLazyLayout})
8989
A,B = P.A, P.B
9090
demap(A) \ B[invmap(basismap(A))]
9191
end
92-
copy(P::Ldiv{<:MappedBasisLayouts,ApplyLayout{typeof(*)}}) = copy(Ldiv{UnknownLayout,ApplyLayout{typeof(*)}}(P.A,P.B))
92+
copy(L::Ldiv{<:MappedBasisLayouts,ApplyLayout{typeof(*)}}) = copy(Ldiv{UnknownLayout,ApplyLayout{typeof(*)}}(L.A,L.B))
93+
copy(L::Ldiv{<:MappedBasisLayouts,ApplyLayout{typeof(*)},<:Any,<:AbstractQuasiVector}) = transform_ldiv(L.A, L.B)
9394

9495
@inline copy(L::Ldiv{<:AbstractBasisLayout,<:SubBasisLayouts}) = apply(\, L.A, ApplyQuasiArray(L.B))
9596
@inline function copy(L::Ldiv{<:SubBasisLayouts,<:AbstractBasisLayout})
@@ -110,7 +111,7 @@ end
110111
a,b = arguments(B)
111112
@assert a isa AbstractQuasiVector # Only works for vec .* mat
112113
ab = (A * (A \ a)) .* b # broadcasted should be overloaded
113-
MemoryLayout(ab) isa BroadcastLayout && error("Overload broadcasted(_, ::typeof(*), ::$(typeof(ab.args[1])), ::$(typeof(b)))")
114+
# MemoryLayout(ab) isa BroadcastLayout && error("Overload broadcasted(_, ::typeof(*), ::$(typeof(ab.args[1])), ::$(typeof(b)))")
114115
A \ ab
115116
end
116117

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ end
437437
@testset "vec demap" begin
438438
@test L[y,:] \ exp.(axes(L,1))[y] L[y,:] \ exp.(y) factorize(L[y,:]) \ exp.(y)
439439
@test ContinuumArrays.demap(view(axes(L,1),y)) == axes(L,1)
440+
441+
@test L[y,:] \ (y .* exp.(y)) L[y,:] \ BroadcastQuasiVector(y -> y*exp(y), y)
442+
@ent L[y,:] \ (y .* L[y,:])
440443
end
441444
end
442445

0 commit comments

Comments
 (0)