diff --git a/Project.toml b/Project.toml index 5660c73..0a028fa 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "QuasiArrays" uuid = "c4ea9172-b204-11e9-377d-29865faadc5c" authors = ["Sheehan Olver "] -version = "0.11.4" +version = "0.11.5" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" diff --git a/src/calculus.jl b/src/calculus.jl index f8513eb..b80d69d 100644 --- a/src/calculus.jl +++ b/src/calculus.jl @@ -7,8 +7,7 @@ _sum(V::AbstractQuasiArray, dims) = sum_layout(MemoryLayout(V), V, dims) _sum(V::AbstractQuasiArray, ::Colon) = sum_layout(MemoryLayout(V), V, :) _cumsum(A, dims) = cumsum_layout(MemoryLayout(A), A, dims) -cumsum(A::AbstractQuasiArray; dims::Integer) = _cumsum(A, dims) -cumsum(x::AbstractQuasiVector) = cumsum(x, dims=1) +cumsum(A::AbstractQuasiArray; dims::Integer=1) = _cumsum(A, dims) # sum is equivalent to hitting by ones(n) on the left or right diff --git a/test/test_calculus.jl b/test/test_calculus.jl index 77d659b..7693719 100644 --- a/test/test_calculus.jl +++ b/test/test_calculus.jl @@ -19,7 +19,7 @@ using QuasiArrays, IntervalSets, Test @test sum(ApplyQuasiArray(*, A, B); dims=2) ≈ sum(A*B; dims=2) @test sum(b) ≈ last(cumsum(b)) ≈ cumsum(b)[2] - @test cumsum(B; dims=1)[2:2,:] ≈ sum(B; dims=1) + @test cumsum(B)[2:2,:] ≈ cumsum(B; dims=1)[2:2,:] ≈ sum(B; dims=1) @test cumsum(B; dims=2)[:,0.5:0.5] ≈ sum(B; dims=2) @test cumsum(ApplyQuasiArray(*, A, b)) ≈ cumsum(A*b)