|
1 | 1 | using QuasiArrays, LazyArrays, ArrayLayouts, Base64, Test |
2 | 2 | import QuasiArrays: QuasiLazyLayout, QuasiArrayApplyStyle, LazyQuasiMatrix, LazyQuasiArrayStyle |
3 | | -import LazyArrays: MulStyle, ApplyStyle |
| 3 | +import LazyArrays: MulStyle, ApplyStyle, arguments |
4 | 4 |
|
5 | 5 | struct MyQuasiLazyMatrix <: LazyQuasiMatrix{Float64} |
6 | 6 | A::QuasiArray |
@@ -86,6 +86,18 @@ Base.getindex(A::MyQuasiLazyMatrix, x::Float64, y::Float64) = A.A[x,y] |
86 | 86 | A = ApplyQuasiArray(*, ones(Inclusion([1,2,3]), Inclusion([4,5])), fill(2,Inclusion([4,5]))) |
87 | 87 | @test stringmime("text/plain", A) == "(ones(Inclusion([1, 2, 3]), Inclusion([4, 5]))) * (fill(2, Inclusion([4, 5])))" |
88 | 88 | end |
| 89 | + |
| 90 | + @testset "sub *" begin |
| 91 | + A = QuasiArray(rand(3,3),(0:0.5:1,Base.OneTo(3))) |
| 92 | + B = randn(3,3) |
| 93 | + M = ApplyQuasiArray(*, A, B) |
| 94 | + @test arguments(view(M,0.5,:)) == (B', A[0.5,:]) |
| 95 | + @test arguments(view(M,:,2)) == (A, B[:,2]) |
| 96 | + |
| 97 | + M = ApplyQuasiArray(*, B, A') |
| 98 | + @test arguments(view(M,:,0.5)) == (B, A[0.5,:]) |
| 99 | + @test arguments(view(M,2,:)) == (A, B[2,:]) |
| 100 | + end |
89 | 101 | end |
90 | 102 | @testset "\\" begin |
91 | 103 | A = QuasiArray(rand(3,3),(0:0.5:1,0:0.5:1)) |
|
0 commit comments