Skip to content

Commit 40b5f7e

Browse files
committed
Support demap for Expansions
1 parent a27fcb3 commit 40b5f7e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ContinuumArrays"
22
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
3-
version = "0.8.0"
3+
version = "0.8.1"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/bases/bases.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ _broadcast_mul_ldiv(_, A, B) = copy(Ldiv{typeof(MemoryLayout(A)),UnknownLayout}(
119119
copy(L::Ldiv{<:AbstractBasisLayout,BroadcastLayout{typeof(*)}}) = _broadcast_mul_ldiv(map(MemoryLayout,arguments(L.B)), L.A, L.B)
120120
copy(L::Ldiv{<:AbstractBasisLayout,BroadcastLayout{typeof(*)},<:Any,<:AbstractQuasiVector}) = _broadcast_mul_ldiv(map(MemoryLayout,arguments(L.B)), L.A, L.B)
121121

122+
# ambiguity
123+
copy(L::Ldiv{<:MappedBasisLayouts,BroadcastLayout{typeof(*)}}) = _broadcast_mul_ldiv(map(MemoryLayout,arguments(L.B)), L.A, L.B)
124+
122125

123126
# expansion
124127
_grid(_, P) = error("Overload Grid")
@@ -268,6 +271,9 @@ function broadcasted(::LazyQuasiArrayStyle{1}, ::typeof(*), a::Expansion, f::Exp
268271
end
269272

270273

274+
_function_mult_broadcasted(_, _, a, B) = Base.Broadcast.Broadcasted{LazyQuasiArrayStyle{2}}(*, (a, B))
275+
broadcasted(::LazyQuasiArrayStyle{2}, ::typeof(*), a::Expansion, B::AbstractQuasiMatrix) = _function_mult_broadcasted(MemoryLayout(a), MemoryLayout(B), a, B)
276+
271277
@eval function ==(f::Expansion, g::Expansion)
272278
S,c = arguments(f)
273279
T,d = arguments(g)
@@ -351,6 +357,11 @@ function demap(V::SubQuasiArray{<:Any,2})
351357
kr, jr = parentindices(V)
352358
demap(parent(V)[kr,:])[:,jr]
353359
end
360+
function demap(wB::ApplyQuasiArray{<:Any,typeof(*)})
361+
a = arguments(wB)
362+
*(demap(first(a)), tail(a)...)
363+
end
364+
354365

355366
basismap(x::SubQuasiArray) = parentindices(x)[1]
356367
basismap(x::BroadcastQuasiArray) = basismap(x.args[1])

0 commit comments

Comments
 (0)