Skip to content

Commit ebe81d2

Browse files
add generic extract methods
1 parent 4da8497 commit ebe81d2

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/Operations/Extract.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
"""
2+
GrB_extract(arg1, Mask, accum, arg4, ...)
3+
4+
Generic matrix/vector extraction.
5+
"""
6+
function GrB_extract(arg1, Mask, accum, arg4, args...)
7+
T = typeof(arg1)
8+
U = typeof(arg4)
9+
if T <: GrB_Vector
10+
if U <: GrB_Vector
11+
return GrB_Vector_extract(arg1, Mask, accum, arg4, args...)
12+
elseif U <: GrB_Matrix
13+
return GrB_Col_extract(arg1, Mask, accum, arg4, args...)
14+
end
15+
elseif T <: GrB_Matrix
16+
return GrB_Matrix_extract(arg1, Mask, accum, arg4, args...)
17+
end
18+
end
19+
120
"""
221
GrB_Vector_extract(w, mask, accum, u, I, ni, desc)
322

src/SuiteSparseGraphBLAS.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ GrB_eWiseAdd_Matrix_Semiring, GrB_eWiseAdd_Matrix_Monoid, GrB_eWiseAdd_Matrix_Bi
189189
GrB_eWiseAdd,
190190

191191
# Extract
192-
GrB_Vector_extract, GrB_Matrix_extract, GrB_Col_extract,
192+
GrB_extract, GrB_Vector_extract, GrB_Matrix_extract, GrB_Col_extract,
193193

194194
# Apply
195195
GrB_apply, GrB_Vector_apply, GrB_Matrix_apply,

0 commit comments

Comments
 (0)