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
Normal AbstractArray and SparseArray indexing should work here. Including indexing by scalars, vectors, and ranges.
42
42
43
43
!!! danger "Indexing Structural Zeros"
44
-
When you index a `SparseMatrixCSC` from `SparseArrays`and hit a structural zero (a value within the dimensions of the matrix but not stored) you can expect a `zero(T)`.
44
+
When indexing a `SparseMatrixCSC` from `SparseArrays` a structural, or implicit, zero will be returned as `zero(T)` where `T` is the elemtn type of the matrix.
45
45
46
-
When you index a GBArray you will get `nothing` when you hit a structural zero. This is because the zero in GraphBLAS depends not just on the domain of the elements but also on what you are __doing__ with them. For instance with an element type of `Float64` you could want the zero to be `0.0`, `-∞` or `+∞`.
46
+
When indexing a GBArray a structural zero is instead returned as `nothing`. While this is a significant departure from the `SparseMatrixCSC` it more closely matches the GraphBLAS spec, and enables the consuming method to determine the value of implicit zeros.
47
+
48
+
For instance with an element type of `Float64` you may want the zero to be `0.0`, `-∞` or `+∞` depending on your algorithm. In addition, for graph algorithms there may be a distinction between an implicit zero, indicating the lack of an edge between two vertices in an adjacency matrix, and an explicit zero where the edge exists but has a `0` weight.
47
49
48
50
```@repl mat
49
51
A = GBMatrix([1,1,2,2,3,4,4,5,6,7,7,7], [2,4,5,7,6,1,3,6,3,3,4,5], [1:12...])
@@ -57,15 +59,12 @@ A[:, 5]
57
59
SparseMatrixCSC(A'[:,:]) #Transpose the first argument
58
60
```
59
61
60
-
All of this same functionality exists for vectors in 1-dimension.
62
+
The functionality illustrated above extends to `GBVector` as well.
61
63
62
64
# Transpose
63
65
The lazy Julia `transpose` is available, and the adjoint operator `'` is also
64
66
overloaded to be equivalent.
65
67
66
-
`x = A'` will create a `Transpose` wrapper.
67
-
When an operation uses this argument it will cause the `desc` to set `INP<0|1> = T_<0|1>`.
Copy file name to clipboardExpand all lines: docs/src/operations.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,23 @@ where ``\bf M`` is a `GBArray` mask, ``\odot`` is a binary operator for accumula
26
26
!!! note "assign vs subassign"
27
27
`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`. See the [GraphBLAS User Guide](https://github.com/DrTimothyAldenDavis/GraphBLAS/blob/stable/Doc/GraphBLAS_UserGuide.pdf) for more details.
28
28
29
+
### `mul`
30
+
```@docs
31
+
mul
32
+
emul
33
+
emul!
34
+
eadd
35
+
eadd!
36
+
extract
37
+
subassign!
38
+
assign!
39
+
Base.map
40
+
select
41
+
Base.reduce
42
+
gbtranspose
43
+
LinearAlgebra.kron
44
+
```
45
+
29
46
## Common arguments
30
47
31
48
The operations above have often accept most or all of the following arguments.
@@ -83,20 +100,4 @@ If `REPLACE` is set the option in step 3. is `nothing`, otherwise it is `C[i,j]`
83
100
84
101
All non-mutating operations below support a mutating form by adding an output array as the first argument as well as the `!` function suffix.
0 commit comments