Skip to content

Commit 2b06122

Browse files
authored
== for Hcat (#64)
* == for Hcat * D^2 * b
1 parent 9117b33 commit 2b06122

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "QuasiArrays"
22
uuid = "c4ea9172-b204-11e9-377d-29865faadc5c"
33
authors = ["Sheehan Olver <solver@mac.com>"]
4-
version = "0.5.0"
4+
version = "0.5.1"
55

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

src/lazyquasiarrays.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ axes(A::Applied{<:Any,typeof(^),<:Tuple{<:AbstractQuasiMatrix,<:Number}}) = axes
224224
eltype(::Applied{<:Any,typeof(^),<:Tuple{<:AbstractQuasiMatrix{T},<:Integer}}) where T = T
225225
eltype(::Applied{<:Any,typeof(^),<:Tuple{<:AbstractQuasiMatrix{T},<:Number}}) where T = complex(T)
226226

227-
function *(App::ApplyQuasiMatrix{<:Any,typeof(^),<:Tuple{<:AbstractQuasiMatrix{T},<:Integer}}, b::AbstractQuasiMatrix) where T
227+
function *(App::ApplyQuasiMatrix{<:Any,typeof(^),<:Tuple{<:AbstractQuasiMatrix{T},<:Integer}}, b::AbstractQuasiArray) where T
228228
A,p = arguments(App)
229229
p < 0 && return ApplyQuasiMatrix(^,inv(A),-p)*b
230230
p == 0 && return copy(b)

src/quasiconcat.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ end
2525

2626
\(A::AbstractQuasiArray, H::ApplyQuasiMatrix{<:Any,typeof(hcat)}) = hcat((Ref(A) .\ H.args)...)
2727

28+
function ==(A::ApplyQuasiMatrix{<:Any,typeof(hcat)}, B::ApplyQuasiMatrix{<:Any,typeof(hcat)})
29+
axes.(A.args,2) == axes.(B.args,2) && return all(A.args .== B.args)
30+
Base.invoke(==, Tuple{AbstractQuasiArray,AbstractQuasiArray}, A, B)
31+
end
32+
2833
"""
2934
UnionVcat
3035

test/test_quasiconcat.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import QuasiArrays: ApplyQuasiMatrix, UnionVcat
88
@test B isa ApplyQuasiMatrix{Float64,typeof(hcat)}
99
@test axes(B) == (axes(A,1), Base.OneTo(4))
1010
@test B[0.0,1] == B[0.0,3] == A[0.0,1]
11+
@test B == B
12+
@test B  A
13+
@test B [A A A]
1114
@test_throws BoundsError B[0.1,1]
1215
@test_throws BoundsError B[0.0,5]
1316
@test QuasiArray(B) == B

0 commit comments

Comments
 (0)