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
The usual AbstractArray and SparseArray indexing should work here. Including indexing by scalars, vectors, and ranges.
41
+
Normal AbstractArray and SparseArray indexing should work here. Including indexing by scalars, vectors, and ranges.
43
42
44
43
!!! danger "Indexing Structural Zeros"
45
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)`.
46
45
47
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 `+∞`.
48
47
49
-
We'll use the small matrix from the Introduction to illustrate the indexing capabilities. We will also use `SparseArrays.SparseMatrixCSC` for the pretty printing functionality, which should be available in this package in `v1.0`.
50
-
51
48
```@repl mat
52
49
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...])
53
50
SparseMatrixCSC(A)
@@ -57,21 +54,18 @@ A[[1,3,5,7], :]
57
54
A[1:2:7, :]
58
55
A[:,:]
59
56
A[:, 5]
60
-
SparseMatrixCSC(A[:,:, desc=T0]) #Transpose the first argument
57
+
SparseMatrixCSC(A'[:,:]) #Transpose the first argument
61
58
```
62
59
63
60
All of this same functionality exists for vectors in 1-dimension.
64
61
65
62
# Transpose
66
-
The typical lazy Julia `transpose` is available as usual, and the adjoint operator `'` is also
63
+
The lazy Julia `transpose` is available, and the adjoint operator `'` is also
67
64
overloaded to be equivalent.
68
65
69
66
`x = A'` will create a `Transpose` wrapper.
70
67
When an operation uses this argument it will cause the `desc` to set `INP<0|1> = T_<0|1>`.
71
68
72
-
!!! warning
73
-
Vectors do not support transposition at this time. A matrix with the column or row size set to `1` may be a solution.
0 commit comments