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
Copy file name to clipboardExpand all lines: docs/src/index.md
+113-6Lines changed: 113 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,8 @@ Post 1.0 goals include:
24
24
3. More efficient import and export between Julia and GraphBLAS
25
25
4. Support for other GraphBLAS implementations in a follow-up GraphBLAS.jl
26
26
27
-
!!! warning Printing
27
+
!!! danger "Printing"
28
+
28
29
Printing is done directly by GraphBLAS in this release. This means printed indices are 0-based, and the displayed type is the equivalent C type. The v1.0 release will alleviate this issue.
29
30
30
31
# Installation
@@ -106,8 +107,114 @@ v = GBVector([4], [10])
106
107
A complete list of supported operations can be found in [Operations](@ref).
107
108
GraphBLAS operations are, where possible, wrapped in existing Julia functions. The equivalent Julia functions are:
|`mxm`, `mxv`, `vxm`|``\bf C \langle M \rangle = C \odot AB``|`mul[!]`|
113
+
|`eWiseMult`|``\bf C \langle M \rangle = C \odot (A \otimes B)``|`emul[!]`|
114
+
|`eWiseAdd`|``\bf C \langle M \rangle = C \odot (A \oplus B)``|`eadd[!]`|
115
+
|`extract`|``\bf C \langle M \rangle = C \odot A(I,J)``|`extract[!]`, `getindex`|
116
+
|`subassign`|``\bf C (I,J) \langle M \rangle = C(I,J) \odot A``|`subassign[!]`, `setindex!`|
117
+
|`assign`|``\bf C \langle M \rangle (I,J) = C(I,J) \odot A``|`assign[!]`|
118
+
|`apply`|``{\bf C \langle M \rangle = C \odot} f{\bf (A)}``|`map[!]`|
119
+
||``{\bf C \langle M \rangle = C \odot} f({\bf A},y)``||
120
+
||``{\bf C \langle M \rangle = C \odot} f(x,{\bf A})``||
121
+
|`select`|``{\bf C \langle M \rangle = C \odot} f({\bf A},k)``|`select[!]`|
122
+
|`reduce`|``{\bf w \langle m \rangle = w \odot} [{\oplus}_j {\bf A}(:,j)]``|`reduce[!]`|
123
+
||``s = s \odot [{\oplus}_{ij} {\bf A}(i,j)]``||
124
+
|`transpose`|``\bf C \langle M \rangle = C \odot A^{\sf T}``|`gbtranspose[!]`, lazy: `transpose`, `'`|
125
+
|`kronecker`|``\bf C \langle M \rangle = C \odot \text{kron}(A, B)``|`kron[!]`|
126
+
127
+
where ``\bf M`` is a `GBArray` mask, ``\odot`` is a binary operator for accumulating into ``\bf C``, and ``\otimes`` and ``\oplus`` are a binary operation and commutative monoid respectively.
128
+
129
+
!!! note "assign vs subassign"
130
+
131
+
`subassign` is equivalent to `assign` except that the mask in `subassign` has the dimensions of ``\bf C(I,J)`` vs the dimensions of ``C`` for `assign`, and elements outside of the mask will never be modified by `subassign`.
132
+
133
+
### Common arguments
134
+
135
+
The operations above have a typical set of common arguments. These are:
136
+
137
+
#### `op` - `UnaryOp`, `BinaryOp`, `Monoid`, or `Semiring`:
138
+
139
+
This is the key argument to most of these operations, which determines ``\oplus``, ``\otimes``, or ``f`` in the table above as well as the semiring used in `mul`.
140
+
Most operations are restricted to one type of operator.
141
+
142
+
!!! warning "Keyword vs Positional"
143
+
For some operations like `mul` and `emul` this is a keyword argument which defaults to the typical arithmetic operators.
144
+
For others like `map` this is the first argument, since there is no sensible default choice.
145
+
146
+
147
+
148
+
!!! tip "Built-Ins"
149
+
The built-in operators can be found in the submodules: `UnaryOps`, `BinaryOps`, `Monoids`, and `Semirings`.
150
+
151
+
#### `desc` - `Descriptor`:
152
+
153
+
The descriptor argument allows the user to modify the operation in some fashion. The most common options are:
If `STRUCTURE` is set the operation will use the presence of a value rather than the value itself to determine whether the index is masked.
163
+
If `COMPLEMENT` is set the presence/truth value is complemented (ie. if **no** value is present or the value is **false** that index is masked).
164
+
165
+
-`desc.output` == [DEFAULT | REPLACE]
166
+
167
+
If `REPLACE` is set the operation will replace all values in the output matrix **after** the accumulation step.
168
+
If an index is found in the output matrix, but not in the results of the operation it will be set to `nothing`.
169
+
170
+
171
+
#### `accum` - `BinaryOp`:
172
+
173
+
The `accum` keyword argument provides a binary operation to accumulate results into the result array.
174
+
The accumulation step is performed **before** masking.
175
+
176
+
#### `mask` - `GBArray`:
177
+
178
+
The `mask` keyword argument determines whether each index from the result of an operation appears in the output.
179
+
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.
180
+
The mask may also be complemented.
181
+
182
+
183
+
### Order of Operations
184
+
185
+
A GraphBLAS operation occurs in the following order (steps are skipped when possible):
0 commit comments