Skip to content

Commit

Permalink
fix documentation for generic functions
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavmehndiratta committed Jul 6, 2019
1 parent cd22ab0 commit 955be01
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 8 deletions.
48 changes: 46 additions & 2 deletions src/Object_Methods/Free_Objects.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,50 @@
import GraphBLASInterface:
GrB_UnaryOp_free, GrB_BinaryOp_free, GrB_Monoid_free, GrB_Semiring_free,
GrB_Vector_free, GrB_Matrix_free, GrB_Descriptor_free
GrB_free, GrB_UnaryOp_free, GrB_BinaryOp_free, GrB_Monoid_free,
GrB_Semiring_free, GrB_Vector_free, GrB_Matrix_free, GrB_Descriptor_free

"""
GrB_free(object)
Generic method to free a GraphBLAS object.
# Examples
```jldoctest
julia> using GraphBLASInterface, SuiteSparseGraphBLAS
julia> w = GrB_Vector{Int64}()
GrB_Vector{Int64}
julia> I = [0, 2, 4]; X = [10, 20, 30]; n = 3;
julia> GrB_Vector_new(w, GrB_INT64, 5)
GrB_SUCCESS::GrB_Info = 0
julia> GrB_Vector_build(w, I, X, n, GrB_FIRST_INT64)
GrB_SUCCESS::GrB_Info = 0
julia> @GxB_fprint(w, GxB_COMPLETE)
GraphBLAS vector: w
nrows: 5 ncols: 1 max # entries: 3
format: standard CSC vlen: 5 nvec_nonempty: 1 nvec: 1 plen: 1 vdim: 1
hyper_ratio 0.0625
GraphBLAS type: int64_t size: 8
number of entries: 3
column: 0 : 3 entries [0:2]
row 0: int64 10
row 2: int64 20
row 4: int64 30
julia> GrB_free(w)
GrB_SUCCESS::GrB_Info = 0
julia> @GxB_fprint(w, GxB_COMPLETE)
GraphBLAS vector: w NULL
```
"""
function GrB_free end

"""
GrB_UnaryOp_free(unaryop)
Expand Down
9 changes: 8 additions & 1 deletion src/Operations/Apply.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import GraphBLASInterface:
GrB_Vector_apply, GrB_Matrix_apply
GrB_apply, GrB_Vector_apply, GrB_Matrix_apply

"""
GrB_apply(C, Mask, accum, op, A, desc)
Generic matrix/vector apply.
"""
function GrB_apply end

"""
GrB_Vector_apply(w, mask, accum, op, u, desc)
Expand Down
9 changes: 8 additions & 1 deletion src/Operations/Assign.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import GraphBLASInterface:
GrB_Vector_assign, GrB_Matrix_assign, GrB_Col_assign, GrB_Row_assign
GrB_assign, GrB_Vector_assign, GrB_Matrix_assign, GrB_Col_assign, GrB_Row_assign

"""
GrB_assign(arg1, Mask, accum, arg4, arg5, ...)
Generic method for submatrix/subvector assignment.
"""
function GrB_assign end

"""
GrB_Vector_assign(w, mask, accum, u, I, ni, desc)
Expand Down
18 changes: 17 additions & 1 deletion src/Operations/Element_wise_addition.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
import GraphBLASInterface:
GrB_eWiseAdd_Vector_Semiring, GrB_eWiseAdd_Vector_Monoid, GrB_eWiseAdd_Vector_BinaryOp,
GrB_eWiseAdd, GrB_eWiseAdd_Vector_Semiring, GrB_eWiseAdd_Vector_Monoid, GrB_eWiseAdd_Vector_BinaryOp,
GrB_eWiseAdd_Matrix_Semiring, GrB_eWiseAdd_Matrix_Monoid, GrB_eWiseAdd_Matrix_BinaryOp

"""
GrB_eWiseAdd(C, mask, accum, op, A, B, desc)
Generic method for element-wise matrix and vector operations: using set union.
`GrB_eWiseAdd` computes `C<Mask> = accum (C, A + B)`, where pairs of elements in two matrices (or two vectors)
are pairwise "added". The "add" operator can be any binary operator. With the plus operator,
this is the same matrix addition in conventional linear algebra. The pattern of the result T = A + B is
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)
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
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
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
semiring's add operator.
"""
function GrB_eWiseAdd end

"""
GrB_eWiseAdd_Vector_Semiring(w, mask, accum, semiring, u, v, desc)
Expand Down
16 changes: 15 additions & 1 deletion src/Operations/Element_wise_multiplication.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
import GraphBLASInterface:
GrB_eWiseMult_Vector_Semiring, GrB_eWiseMult_Vector_Monoid, GrB_eWiseMult_Vector_BinaryOp,
GrB_eWiseMult, GrB_eWiseMult_Vector_Semiring, GrB_eWiseMult_Vector_Monoid, GrB_eWiseMult_Vector_BinaryOp,
GrB_eWiseMult_Matrix_Semiring, GrB_eWiseMult_Matrix_Monoid, GrB_eWiseMult_Matrix_BinaryOp

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

"""
GrB_eWiseMult_Vector_Semiring(w, mask, accum, semiring, u, v, desc)
Expand Down
9 changes: 8 additions & 1 deletion src/Operations/Extract.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import GraphBLASInterface:
GrB_Vector_extract, GrB_Matrix_extract, GrB_Col_extract
GrB_extract, GrB_Vector_extract, GrB_Matrix_extract, GrB_Col_extract

"""
GrB_extract(arg1, Mask, accum, arg4, ...)
Generic matrix/vector extraction.
"""
function GrB_extract end

"""
GrB_Vector_extract(w, mask, accum, u, I, ni, desc)
Expand Down
9 changes: 8 additions & 1 deletion src/Operations/Reduce.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import GraphBLASInterface:
GrB_Matrix_reduce_Monoid, GrB_Matrix_reduce_BinaryOp,
GrB_reduce, GrB_Matrix_reduce_Monoid, GrB_Matrix_reduce_BinaryOp,
GrB_Matrix_reduce, GrB_Vector_reduce

"""
GrB_reduce(arg1, arg2, arg3, arg4, ...)
Generic method for matrix/vector reduction to a vector or scalar.
"""
function GrB_reduce end

"""
GrB_Matrix_reduce_Monoid(w, mask, accum, monoid, A, desc)
Expand Down

0 comments on commit 955be01

Please sign in to comment.