You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
26
26
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`.
28
28
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.
Copy file name to clipboardExpand all lines: docs/src/binaryops.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ However, the vast majority of binary operators are defined on a single domain.
5
5
6
6
`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`.
7
7
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.
Copy file name to clipboardExpand all lines: docs/src/index.md
+3-6Lines changed: 3 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ A simple BFS is just a matrix-vector multiplication, where `A` is the adjacency
36
36
37
37
## GBArrays
38
38
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.
40
40
41
41
!!! note "GBArray"
42
42
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
68
68
The default orientation of a `GBMatrix` is by-row, the opposite of Julia arrays. However, a `GBMatrix` constructed from a `SparseMatrixCSC` or
69
69
`Matrix` will be stored by-column.\
70
70
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)`
72
72
73
73
Information about storage formats, orientation, conversion, construction and more can be found in [Arrays](@ref).
74
74
@@ -151,9 +151,6 @@ map(increment, M)
151
151
Unfortunately this has a couple problems. The first is that it's slow.\
152
152
Compared to `A .+ 1` which lowers to `apply(+, A, 1)` the `map` call above is ~2.5x slower due to function pointer overhead.
153
153
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
-
157
154
!!! warning "Performance of User Defined Functions"
158
155
Operators which are not already built-in are automatically constructed using function pointers when called.
159
156
Note, however, that their performance is significantly degraded compared to built-in operators,
@@ -187,7 +184,7 @@ sandia(M)
187
184
188
185
# Citing
189
186
190
-
Please cite the following papers:
187
+
Please cite the following papers if you use SuiteSparseGraphBLAS.jl in your work:
Copy file name to clipboardExpand all lines: docs/src/monoids.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ This binary operator must be associative, that is $f(a, f(b, c)) = f(f(a, b), c)
5
5
6
6
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$.
7
7
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.
9
9
10
10
## Built-Ins
11
11
@@ -25,4 +25,8 @@ Monoids are used primarily in the `reduce`(@ref) operation. Their other use is a
Copy file name to clipboardExpand all lines: docs/src/operations.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,8 +64,9 @@ The accumulation step is performed **before** masking.
64
64
### `mask` - `GBArray`:
65
65
66
66
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)`.
Copy file name to clipboardExpand all lines: docs/src/operators.md
+9-42Lines changed: 9 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,18 +8,21 @@ One is an extension to the `v1.3` specification: `SelectOp`.
8
8
!!! danger "Note"
9
9
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).
10
10
11
+
Operators are no longer first class objects in SuiteSparseGraphBLAS.jl v0.8. Only Monoids
12
+
require direct user interaction.
13
+
11
14
Typically operators are positional arguments in one of two places.
12
15
For operations with a clear default operator they appear as the last positional argument:
@@ -43,42 +46,6 @@ SuiteSparseGraphBLAS.jl natively supports the following types:
43
46
- Float32 and Float64
44
47
- ComplexF32 and ComplexF64
45
48
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
-
82
49
## SelectOps
83
50
84
51
The [`SelectOp`](@ref) is a SuiteSparse extension to the specification, although a similar construct is likely to be found in a future specification.
Copy file name to clipboardExpand all lines: docs/src/semirings.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,8 @@ The second, $\otimes$ or "multiply", is a binary operator defined on $D_1 \times
8
8
9
9
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)$.
10
10
11
-
Semirings are used in a single GraphBLAS operation, [`mul!`](@ref).
11
+
Semirings are used in two GraphBLAS operations, `mul!` and [`*`](@ref).
12
12
13
13
## Passing to Functions
14
14
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)`.
0 commit comments