Skip to content

Commit d9b7ed5

Browse files
committed
docdates
1 parent 0a7e297 commit d9b7ed5

File tree

15 files changed

+101
-67
lines changed

15 files changed

+101
-67
lines changed

docs/src/api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
!!! danger "Public vs Private API"
2+
All docstrings are collected on this page. **However**, only assume exported functions and types are part of the public API.
3+
4+
```@autodocs
5+
Modules = [SuiteSparseGraphBLAS, UnaryOps, BinaryOps, Monoids, Semirings, GB_KLU]
6+
```

docs/src/arrays.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ The `GBMatrix` is an opaque sparse matrix structure, which adapts to the sparsit
2424
3. **Sparse Compressed** - [Compressed Sparse Column (CSC)](http://netlib.org/linalg/html_templates/node92.html#SECTION00931200000000000000) or [Compressed Sparse Row(CSR)](http://netlib.org/linalg/html_templates/node91.html)
2525
4. **Doubly Compressed** or **Hypersparse** - Doubly Compressed Sparse Column (DCSC or Hypersparse CSC) and Doubly Compressed Sparse Row (DCSR or Hypersparse CSR). See this paper for more information: [pdf](https://people.eecs.berkeley.edu/~aydin/hypersparse-ipdps08.pdf).
2626

27-
Additionally a when the stored values in a `GBMatrix` are uniform the value array may be stored in the **iso** version of one of the formats above. Rather than storing the full value array, an iso `GBMatrix` will only store the single scalar to improve performance. This is useful for matrices like the unweighted adjacency matrix, where all stored values may be `true`.
27+
Additionally, when the stored values in a `GBMatrix` are uniform the value array may be stored in the **iso** version of one of the formats above. Rather than storing the full value array, an iso `GBMatrix` will only store the single scalar to improve performance. This is useful for matrices like the unweighted adjacency matrix, where all stored values may be `true`.
2828

29-
Users should never need to directly interact with the underlying storage format, SuiteSparse:GraphBLAS will automatically convert between them as necessary.
29+
Users should rarely need to directly interact with the underlying storage format, SuiteSparse:GraphBLAS will automatically convert between them as necessary.
3030

3131
### Construction
3232

docs/src/binaryops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ However, the vast majority of binary operators are defined on a single domain.
55

66
`BinaryOp`s are in almost every GraphBLAS operation. They are the primary `op` argument for [`emul`](@ref), [`eadd`](@ref), and [`apply`](@ref). `BinaryOp`s which are also monoids may be used in [`reduce`](@ref). And every GraphBLAS operation which takes an `accum` keyword argument accepts a `BinaryOp`.
77

8-
In 99% of cases you should pass Julia functions, which will be mapped to built-in operators, or used to create a new user-defined operator.
8+
In almost all cases you should pass Julia functions, which will be mapped to built-in operators, or used to create a new user-defined operator.
99

1010
```@repl
1111
using SuiteSparseGraphBLAS

docs/src/index.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ A simple BFS is just a matrix-vector multiplication, where `A` is the adjacency
3636

3737
## GBArrays
3838

39-
The core SuiteSparseGraphBLAS.jl array types are `GBVector` and `GBMatrix` which are subtypes `SparseArrays.AbstractSparseVector` and `SparseArrays.AbstractSparseMatrix` respectively. There are also several auxiliary array types that restrict one or more behaviors, like row or column orientation. More info on those types can be found ### HERE ###
39+
The core SuiteSparseGraphBLAS.jl array types are `GBVector` and `GBMatrix` which are subtypes `SparseArrays.AbstractSparseVector` and `SparseArrays.AbstractSparseMatrix` respectively.
4040

4141
!!! note "GBArray"
4242
These docs will often refer to the `GBArray` type, which is the union of `AbstractGBVector`, `AbstractGBMatrix` and their lazy Transpose objects.
@@ -68,7 +68,7 @@ Different matrices may be better suited to storage in one of those formats, and
6868
The default orientation of a `GBMatrix` is by-row, the opposite of Julia arrays. However, a `GBMatrix` constructed from a `SparseMatrixCSC` or
6969
`Matrix` will be stored by-column.\
7070
The orientation of a `GBMatrix` can be modified using
71-
`gbset(A, :format, :byrow)` or `gbset(A, :format, :bycol)`, and queried by `gbget(A, :format)`
71+
`setstorageorder!(A, RowMajor())` or `setstorageorder!(A, ColMajor())`, and queried by `StorageOrders.storageorder(A)`
7272

7373
Information about storage formats, orientation, conversion, construction and more can be found in [Arrays](@ref).
7474

@@ -151,9 +151,6 @@ map(increment, M)
151151
Unfortunately this has a couple problems. The first is that it's slow.\
152152
Compared to `A .+ 1` which lowers to `apply(+, A, 1)` the `map` call above is ~2.5x slower due to function pointer overhead.
153153

154-
The second is that everytime we call `map(increment, M)` we will be re-creating the function pointer for `increment` matched to the type of `M`.\
155-
To avoid this the convenience macro `@unop` will provide a permanent constant which is used internally every time `increment` is called with a GraphBLAS operation. See [Operators](@ref) for more information.
156-
157154
!!! warning "Performance of User Defined Functions"
158155
Operators which are not already built-in are automatically constructed using function pointers when called.
159156
Note, however, that their performance is significantly degraded compared to built-in operators,
@@ -187,7 +184,7 @@ sandia(M)
187184

188185
# Citing
189186

190-
Please cite the following papers:
187+
Please cite the following papers if you use SuiteSparseGraphBLAS.jl in your work:
191188

192189
[pdf](https://doi.org/10.1145/3322125):
193190
```bibtex

docs/src/monoids.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This binary operator must be associative, that is $f(a, f(b, c)) = f(f(a, b), c)
55

66
The operator is also be equipped with an identity such that $f(x, 0) = f(0, x) = x$. Some monoids are equipped with a terminal or annihilator such that $z = f(z, x) \forall x$.
77

8-
Monoids are used primarily in the `reduce`(@ref) operation. Their other use is as a component of semirings in the [`mul!`](@ref) operation.
8+
Monoids are used primarily in the [`reduce`](@ref) operation. Their other use is as a component of semirings in the [`mul!`](@ref) operation.
99

1010
## Built-Ins
1111

@@ -25,4 +25,8 @@ Monoids are used primarily in the `reduce`(@ref) operation. Their other use is a
2525
| `` | `LAND_MONOID` | identity: `true`, term: `false` |
2626
| | | |
2727
| | | |
28-
| | | |
28+
| | | |
29+
30+
```@docs
31+
Monoid
32+
```

docs/src/operations.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ The accumulation step is performed **before** masking.
6464
### `mask` - `GBArray`:
6565

6666
The `mask` keyword argument determines whether each index from the result of an operation appears in the output.
67-
The mask may be structural, where the presence of a value indicates the mask is `true`, or valued where the value of the mask indicates its truth value.
68-
The mask may also be complemented. These options are controlled by the `desc` argument.
67+
The mask may be structural, where the presence of a value indicates the mask is `true`, or valued where the value of the mask indicates its truth value. `mask = SuiteSparseGraphBLAS.Structural(A)` will use a structural mask.
68+
69+
The mask may also be complemented. `mask = SuiteSparseGraphBLAS.Complement(A)` or `mask = ~A` will complement a mask. These two options may be combined, for example `mask = ~SuiteSparseGraphBLAS.Structural(A)`.
6970

7071

7172
## Operation Documentation

docs/src/operators.md

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ One is an extension to the `v1.3` specification: `SelectOp`.
88
!!! danger "Note"
99
Operators are **not** callable objects like functions. They **do** behave like functions when used as arguments to higher-order functions (operations in the language of GraphBLAS).
1010

11+
Operators are no longer first class objects in SuiteSparseGraphBLAS.jl v0.8. Only Monoids
12+
require direct user interaction.
13+
1114
Typically operators are positional arguments in one of two places.
1215
For operations with a clear default operator they appear as the last positional argument:
1316

14-
- [`emul(A, B, op::Union{BinaryOp, Function})`](@ref emul)
15-
- [`eadd(A, B, op::Union{BinaryOp, Function})`](@ref eadd)
16-
- [`kron(A, B, op::Union{BinaryOp, Function})`](@ref kron)
17-
- [`*(A, B, op::Union{Semiring, Tuple{Function, Function}})`](@ref *)
17+
- [`emul(A, B, op::Function)`](@ref emul)
18+
- [`eadd(A, B, op::Function)`](@ref eadd)
19+
- [`kron(A, B, op::Function)`](@ref kron)
20+
- [`*(A, B, op::Tuple{Function, Function})`](@ref *)
1821

1922
For other operations without a clear default operator they appear as the first argument:
2023

21-
- [`apply(op::Union{UnaryOp, Function}, A)`](@ref apply)
22-
- [`reduce(op::Union{BinaryOp, Function}, A)`](@ref reduce)
24+
- [`apply(op::Function, A)`](@ref apply)
25+
- [`reduce(op::Union{Monoid, Function}, A)`](@ref reduce)
2326
- [`select(op::Union{SelectOp, Function}, A)`](@ref select)
2427

2528
!!! note "Built-in vs User-defined operators"
@@ -43,42 +46,6 @@ SuiteSparseGraphBLAS.jl natively supports the following types:
4346
- Float32 and Float64
4447
- ComplexF32 and ComplexF64
4548

46-
### Lowering
47-
48-
Operators are lowered from a Julia function to a container like `BinaryOp` or `Semiring`. After this they are lowered once again using the type to a `TypedBinaryOp`, `TypedSemiring`, etc. The `TypedBinaryOp` contains the reference to the C-side GraphBLAS operator. Typed operators, like `TypedSemiring` are constants, found in a submodule (`SuiteSparseGraphBLAS.Semirings` in the case of `TypedSemiring`s).
49-
50-
```@setup operators
51-
using SuiteSparseGraphBLAS
52-
```
53-
```@repl operators
54-
b = binaryop(+, Int32)
55-
56-
s = Semiring(max, +)
57-
s(Float64)
58-
```
59-
60-
All operations should accept the function/tuple form, the `Semiring{typeof(max), typeof(+)}` form, or the `TypedSemiring` form.
61-
Unless you need to specifically cast the arguments to a specific type there is generally no need to use the latter two forms.
62-
63-
You can determine the the input and output types of a type-specific operator with the functions below:
64-
65-
```@docs
66-
xtype
67-
ytype
68-
ztype
69-
```
70-
71-
Some examples of these functions are below.
72-
Note the difference between `ISGT` which returns a result with the same type as the input, and `GT` which returns a `Boolean`.
73-
74-
```@repl operators
75-
xtype(Semirings.LOR_GT_UINT16)
76-
ztype(Semirings.LOR_GT_FP64)
77-
xtype(BinaryOps.ISGT_INT8)
78-
ztype(BinaryOps.ISGT_INT8)
79-
ztype(BinaryOps.GT_INT8)
80-
```
81-
8249
## SelectOps
8350

8451
The [`SelectOp`](@ref) is a SuiteSparse extension to the specification, although a similar construct is likely to be found in a future specification.

docs/src/semirings.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ The second, $\otimes$ or "multiply", is a binary operator defined on $D_1 \times
88

99
A semiring is denoted by a tuple $(D_1, D_2, D_3, \oplus, \otimes, \mathbb{0})$. However in the vast majority of cases $D_1 = D_2 = D_3$ so this is often shortened to $(\oplus, \otimes)$.
1010

11-
Semirings are used in a single GraphBLAS operation, [`mul!`](@ref).
11+
Semirings are used in two GraphBLAS operations, `mul!` and [`*`](@ref).
1212

1313
## Passing to Functions
1414

15-
`mul!` and `*` are the only functions which accept semirings, and the best method to do so is a tuple of binary functions like `*(A, B, (max, +))`. An operator form is also available as `*(min, +)(A, B)`.
16-
17-
Semiring objects may be constructed in a similar fashion: `Semiring(max, +)`.
15+
`mul!` and `*` are the only functions which accept semirings, and the best method to do so is a tuple of binary functions like `*(A, B, (max, +))`. An operator form is also available as `*(min, +)(A, B)`.

docs/src/unaryops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ using SuiteSparseGraphBLAS
2121
2222
op = unaryop(sin, Float64)
2323
24-
map(typedop, GBVector([1.5, 0, pi]))
24+
map(op, GBVector([1.5, 0, pi]))
2525
```
2626

2727
## Built-Ins

docs/src/utilities.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
```@docs
22
setfill
33
setfill!
4+
sparsitystatus
5+
format
6+
setstorageorder!
47
mask
58
mask!
69
gbset
710
Descriptor
811
SuiteSparseGraphBLAS.set_lib!
912
empty!
13+
Complement
14+
Structural
15+
xtype
16+
ytype
17+
ztype
1018
```

0 commit comments

Comments
 (0)