Skip to content

Commit 955be01

Browse files
fix documentation for generic functions
1 parent cd22ab0 commit 955be01

File tree

7 files changed

+110
-8
lines changed

7 files changed

+110
-8
lines changed

src/Object_Methods/Free_Objects.jl

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,50 @@
11
import GraphBLASInterface:
2-
GrB_UnaryOp_free, GrB_BinaryOp_free, GrB_Monoid_free, GrB_Semiring_free,
3-
GrB_Vector_free, GrB_Matrix_free, GrB_Descriptor_free
2+
GrB_free, GrB_UnaryOp_free, GrB_BinaryOp_free, GrB_Monoid_free,
3+
GrB_Semiring_free, GrB_Vector_free, GrB_Matrix_free, GrB_Descriptor_free
4+
5+
"""
6+
GrB_free(object)
7+
8+
Generic method to free a GraphBLAS object.
9+
10+
# Examples
11+
```jldoctest
12+
julia> using GraphBLASInterface, SuiteSparseGraphBLAS
13+
14+
julia> w = GrB_Vector{Int64}()
15+
GrB_Vector{Int64}
16+
17+
julia> I = [0, 2, 4]; X = [10, 20, 30]; n = 3;
18+
19+
julia> GrB_Vector_new(w, GrB_INT64, 5)
20+
GrB_SUCCESS::GrB_Info = 0
21+
22+
julia> GrB_Vector_build(w, I, X, n, GrB_FIRST_INT64)
23+
GrB_SUCCESS::GrB_Info = 0
24+
25+
julia> @GxB_fprint(w, GxB_COMPLETE)
26+
27+
GraphBLAS vector: w
28+
nrows: 5 ncols: 1 max # entries: 3
29+
format: standard CSC vlen: 5 nvec_nonempty: 1 nvec: 1 plen: 1 vdim: 1
30+
hyper_ratio 0.0625
31+
GraphBLAS type: int64_t size: 8
32+
number of entries: 3
33+
column: 0 : 3 entries [0:2]
34+
row 0: int64 10
35+
row 2: int64 20
36+
row 4: int64 30
37+
38+
39+
julia> GrB_free(w)
40+
GrB_SUCCESS::GrB_Info = 0
41+
42+
julia> @GxB_fprint(w, GxB_COMPLETE)
43+
44+
GraphBLAS vector: w NULL
45+
```
46+
"""
47+
function GrB_free end
448

549
"""
650
GrB_UnaryOp_free(unaryop)

src/Operations/Apply.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import GraphBLASInterface:
2-
GrB_Vector_apply, GrB_Matrix_apply
2+
GrB_apply, GrB_Vector_apply, GrB_Matrix_apply
3+
4+
"""
5+
GrB_apply(C, Mask, accum, op, A, desc)
6+
7+
Generic matrix/vector apply.
8+
"""
9+
function GrB_apply end
310

411
"""
512
GrB_Vector_apply(w, mask, accum, op, u, desc)

src/Operations/Assign.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import GraphBLASInterface:
2-
GrB_Vector_assign, GrB_Matrix_assign, GrB_Col_assign, GrB_Row_assign
2+
GrB_assign, GrB_Vector_assign, GrB_Matrix_assign, GrB_Col_assign, GrB_Row_assign
3+
4+
"""
5+
GrB_assign(arg1, Mask, accum, arg4, arg5, ...)
6+
7+
Generic method for submatrix/subvector assignment.
8+
"""
9+
function GrB_assign end
310

411
"""
512
GrB_Vector_assign(w, mask, accum, u, I, ni, desc)

src/Operations/Element_wise_addition.jl

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
import GraphBLASInterface:
2-
GrB_eWiseAdd_Vector_Semiring, GrB_eWiseAdd_Vector_Monoid, GrB_eWiseAdd_Vector_BinaryOp,
2+
GrB_eWiseAdd, GrB_eWiseAdd_Vector_Semiring, GrB_eWiseAdd_Vector_Monoid, GrB_eWiseAdd_Vector_BinaryOp,
33
GrB_eWiseAdd_Matrix_Semiring, GrB_eWiseAdd_Matrix_Monoid, GrB_eWiseAdd_Matrix_BinaryOp
44

5+
"""
6+
GrB_eWiseAdd(C, mask, accum, op, A, B, desc)
7+
8+
Generic method for element-wise matrix and vector operations: using set union.
9+
10+
`GrB_eWiseAdd` computes `C<Mask> = accum (C, A + B)`, where pairs of elements in two matrices (or two vectors)
11+
are pairwise "added". The "add" operator can be any binary operator. With the plus operator,
12+
this is the same matrix addition in conventional linear algebra. The pattern of the result T = A + B is
13+
the set union of A and B. Entries outside of the union are not computed. That is, if both A(i, j) and B(i, j)
14+
are present in the pattern of A and B, then T(i, j) = A(i, j) "+" B(i, j). If only A(i, j) is present
15+
then T(i, j) = A (i, j) and the "+" operator is not used. Likewise, if only B(i, j) is in the pattern of B
16+
but A(i, j) is not in the pattern of A, then T(i, j) = B(i, j). For a semiring, the mult operator is the
17+
semiring's add operator.
18+
"""
19+
function GrB_eWiseAdd end
20+
521
"""
622
GrB_eWiseAdd_Vector_Semiring(w, mask, accum, semiring, u, v, desc)
723

src/Operations/Element_wise_multiplication.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
import GraphBLASInterface:
2-
GrB_eWiseMult_Vector_Semiring, GrB_eWiseMult_Vector_Monoid, GrB_eWiseMult_Vector_BinaryOp,
2+
GrB_eWiseMult, GrB_eWiseMult_Vector_Semiring, GrB_eWiseMult_Vector_Monoid, GrB_eWiseMult_Vector_BinaryOp,
33
GrB_eWiseMult_Matrix_Semiring, GrB_eWiseMult_Matrix_Monoid, GrB_eWiseMult_Matrix_BinaryOp
44

5+
"""
6+
GrB_eWiseMult(C, mask, accum, op, A, B, desc)
7+
8+
Generic method for element-wise matrix and vector operations: using set intersection.
9+
10+
`GrB_eWiseMult` computes `C<Mask> = accum (C, A .* B)`, where pairs of elements in two matrices (or vectors) are
11+
pairwise "multiplied" with C(i, j) = mult (A(i, j), B(i, j)). The "multiplication" operator can be any binary operator.
12+
The pattern of the result T = A .* B is the set intersection (not union) of A and B. Entries outside of the intersection
13+
are not computed. This is primary difference with `GrB_eWiseAdd`. The input matrices A and/or B may be transposed first,
14+
via the descriptor. For a semiring, the mult operator is the semiring's multiply operator; this differs from the
15+
eWiseAdd methods which use the semiring's add operator instead.
16+
"""
17+
function GrB_eWiseMult end
18+
519
"""
620
GrB_eWiseMult_Vector_Semiring(w, mask, accum, semiring, u, v, desc)
721

src/Operations/Extract.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import GraphBLASInterface:
2-
GrB_Vector_extract, GrB_Matrix_extract, GrB_Col_extract
2+
GrB_extract, GrB_Vector_extract, GrB_Matrix_extract, GrB_Col_extract
3+
4+
"""
5+
GrB_extract(arg1, Mask, accum, arg4, ...)
6+
7+
Generic matrix/vector extraction.
8+
"""
9+
function GrB_extract end
310

411
"""
512
GrB_Vector_extract(w, mask, accum, u, I, ni, desc)

src/Operations/Reduce.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import GraphBLASInterface:
2-
GrB_Matrix_reduce_Monoid, GrB_Matrix_reduce_BinaryOp,
2+
GrB_reduce, GrB_Matrix_reduce_Monoid, GrB_Matrix_reduce_BinaryOp,
33
GrB_Matrix_reduce, GrB_Vector_reduce
44

5+
"""
6+
GrB_reduce(arg1, arg2, arg3, arg4, ...)
7+
8+
Generic method for matrix/vector reduction to a vector or scalar.
9+
"""
10+
function GrB_reduce end
11+
512
"""
613
GrB_Matrix_reduce_Monoid(w, mask, accum, monoid, A, desc)
714

0 commit comments

Comments
 (0)