Skip to content

Commit 2c5a8bb

Browse files
committed
issues to runtests, fix indexing stragglers
1 parent 187940a commit 2c5a8bb

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/indexutils.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ end
3939
# 1 <= length(szA | szB) <= 2
4040
# size checks should be done elsewhere.
4141
function _combinesizes(A, B)
42-
if A isa AbstractVector || B isa AbstractVector
42+
if (A isa AbstractVector && B isa AbstractMatrix) ||
43+
(B isa AbstractVector && A isa AbstractMatrix)
4344
return (size(A, 1), size(A, 2))
4445
else
4546
return size(A)

src/operations/extract.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ function extract!(
6969
I = decrement!(I)
7070
J = decrement!(J)
7171
@wraperror LibGraphBLAS.GrB_Matrix_extract(gbpointer(C), mask, getaccum(accum, eltype(C)), gbpointer(parent(A)), I, ni, J, nj, desc)
72-
I isa Vector && increment!(I)
73-
J isa Vector && increment!(J)
72+
I isa AbstractVector && increment!(I)
73+
J isa AbstractVector && increment!(J)
7474
return C
7575
end
7676
"""
@@ -138,7 +138,7 @@ function extract!(
138138
desc = _handledescriptor(desc)
139139
mask === nothing && (mask = C_NULL)
140140
@wraperror LibGraphBLAS.GrB_Matrix_extract(gbpointer(w), mask, getaccum(accum, eltype(w)), gbpointer(u), I, ni, UInt64[0], 1, desc)
141-
I isa Vector && increment!(I)
141+
I isa AbstractVector && increment!(I)
142142
return w
143143
end
144144

test/issues.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
A = GBMatrix([1,1,2,2,3,4,4,5,6,7,7,7], [2,4,5,7,6,1,3,6,3,3,4,5], [1:12...])
66
@test A[:, 2] isa GBVector
77
@test A[2, :] isa GBVector
8-
@test emul(A[:, 2], B) == GBVector([1], [1])
8+
@test emul(A[:, 2], B) == GBVector([1], [1], nrows = 7)
99

1010
# test that GBMatrix <ewise> GBVector is allowed
1111
# with correct sizes:
@@ -43,3 +43,4 @@
4343
@test_throws ArgumentError GBMatrix{Int, Int}(10, 10)
4444
@test_throws ArgumentError GBVector{Int, Int}(10)
4545
end
46+
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ println("$(SuiteSparseGraphBLAS.get_lib())")
7676
include_test("operatorutils.jl")
7777
include_test("ops.jl")
7878
include_test("gbarray.jl")
79+
include_test("issues.jl")
7980
include_test("operations/ewise.jl")
8081
include_test("operations/kron.jl")
8182
include_test("operations/map.jl")

0 commit comments

Comments
 (0)