Skip to content

Commit 813e7c0

Browse files
bug fixes for OneBasedIndices
1 parent cbef379 commit 813e7c0

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

src/Operations/Assign.jl

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,23 @@ GrB_Matrix_assign(
154154
Mask::T,
155155
accum::U,
156156
A::GrB_Matrix,
157-
I::OneBasedIndices,
157+
I::Union{OneBasedIndices, GrB_ALL_Type},
158158
ni::Union{Int64, UInt64},
159159
J::OneBasedIndices,
160160
nj::Union{Int64, UInt64},
161161
desc::V) where {T <: valid_matrix_mask_types, U <: valid_accum_types, V <: valid_desc_types} = GrB_Matrix_assign(C, Mask, accum, A, ZeroBasedIndices(I), ni, ZeroBasedIndices(J), nj, desc)
162162

163+
GrB_Matrix_assign(
164+
C::GrB_Matrix,
165+
Mask::T,
166+
accum::U,
167+
A::GrB_Matrix,
168+
I::OneBasedIndices,
169+
ni::Union{Int64, UInt64},
170+
J::Union{OneBasedIndices, GrB_ALL_Type},
171+
nj::Union{Int64, UInt64},
172+
desc::V) where {T <: valid_matrix_mask_types, U <: valid_accum_types, V <: valid_desc_types} = GrB_Matrix_assign(C, Mask, accum, A, ZeroBasedIndices(I), ni, ZeroBasedIndices(J), nj, desc)
173+
163174
"""
164175
GrB_Col_assign(C, mask, accum, u, I, ni, j, desc)
165176
@@ -246,11 +257,11 @@ GrB_Col_assign(
246257
mask::T,
247258
accum::U,
248259
u::GrB_Vector,
249-
I::OneBasedIndices,
260+
I::Union{OneBasedIndices, GrB_ALL_Type},
250261
ni::Union{Int64, UInt64},
251262
j::OneBasedIndex,
252263
desc::V
253-
) where {T <: valid_vector_mask_types, U <: valid_accum_types, V <: valid_desc_types} = GrB_Col_assign(C, Mask, accum, u, ZeroBasedIndices(I), ni, ZeroBasedIndex(j), desc)
264+
) where {T <: valid_vector_mask_types, U <: valid_accum_types, V <: valid_desc_types} = GrB_Col_assign(C, mask, accum, u, ZeroBasedIndices(I), ni, ZeroBasedIndex(j), desc)
254265

255266
"""
256267
GrB_Row_assign(C, mask, accum, u, i, J, nj, desc)
@@ -338,7 +349,7 @@ GrB_Row_assign(
338349
accum::U,
339350
u::GrB_Vector,
340351
i::OneBasedIndex,
341-
J::OneBasedIndices,
352+
J::Union{OneBasedIndices, GrB_ALL_Type},
342353
nj::Union{Int64, UInt64},
343354
desc::V
344355
) where {T <: valid_vector_mask_types, U <: valid_accum_types, V <: valid_desc_types} = GrB_Row_assign(C, mask, accum, u, ZeroBasedIndex(i), ZeroBasedIndices(J), nj, desc)
@@ -599,9 +610,21 @@ GrB_Matrix_assign(
599610
Mask::T,
600611
accum::U,
601612
x,
602-
I::OneBasedIndices,
613+
I::Union{OneBasedIndices, GrB_ALL_Type},
603614
ni::Union{Int64, UInt64},
604615
J::OneBasedIndices,
605616
nj::Union{Int64, UInt64},
606617
desc::V
607618
) where {T <: valid_matrix_mask_types, U <: valid_accum_types, V <: valid_desc_types} = GrB_Matrix_assign(C, Mask, accum, x, ZeroBasedIndices(I), ni, ZeroBasedIndices(J), nj, desc)
619+
620+
GrB_Matrix_assign(
621+
C::GrB_Matrix,
622+
Mask::T,
623+
accum::U,
624+
x,
625+
I::OneBasedIndices,
626+
ni::Union{Int64, UInt64},
627+
J::Union{OneBasedIndices, GrB_ALL_Type},
628+
nj::Union{Int64, UInt64},
629+
desc::V
630+
) where {T <: valid_matrix_mask_types, U <: valid_accum_types, V <: valid_desc_types} = GrB_Matrix_assign(C, Mask, accum, x, ZeroBasedIndices(I), ni, ZeroBasedIndices(J), nj, desc)

src/Operations/Extract.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ GrB_Matrix_extract(
175175
Mask::T,
176176
accum::U,
177177
A::GrB_Matrix,
178-
I::OneBasedIndices,
178+
I::Union{OneBasedIndices, GrB_ALL_Type},
179179
ni::Union{Int64, UInt64},
180-
J::OneBasedIndices,
180+
J::Union{OneBasedIndices, GrB_ALL_Type},
181181
nj::Union{Int64, UInt64},
182182
desc::V
183183
) where {T <: valid_matrix_mask_types, U <: valid_accum_types, V <: valid_desc_types} = GrB_Matrix_extract(C, Mask, accum, A, ZeroBasedIndices(I), ni, ZeroBasedIndices(J), nj, desc)
@@ -271,12 +271,12 @@ function GrB_Col_extract( # w<mask> = accum (w, A(I,j))
271271
end
272272

273273
GrB_Col_extract(
274-
w::GrB_Vector,
275-
mask::T,
276-
accum::U,
277-
A::GrB_Matrix,
278-
I::OneBasedIndices,
279-
ni::Union{Int64, UInt64},
280-
j::OneBasedIndex,
274+
w::GrB_Vector,
275+
mask::T,
276+
accum::U,
277+
A::GrB_Matrix,
278+
I::Union{OneBasedIndices, GrB_ALL_Type},
279+
ni::Union{Int64, UInt64},
280+
j::OneBasedIndex,
281281
desc::V
282282
) where {T <: valid_vector_mask_types, U <: valid_accum_types, V <: valid_desc_types} = GrB_Col_extract(w, mask, accum, A, ZeroBasedIndices(I), ni, ZeroBasedIndex(j), desc)

src/Structures.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,4 @@ mutable struct GrB_ALL_Type <: Abstract_GrB_ALL
9292
end
9393
pointer(x::GrB_ALL_Type) = x.p
9494
show(io::IO, ::GrB_ALL_Type) = print("GrB_ALL")
95+
Vector{ZeroBasedIndex}(::GrB_ALL_Type) = GrB_ALL

0 commit comments

Comments
 (0)