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
In the following, all sparse kinds will be presented in two main flavors: a data-less type `<matrix>_type` useful for topological graph operations. And real/complex valued types `<matrix>_<kind>` containing the `data` buffer for the matrix values. The following rectangular matrix will be used to showcase how each sparse matrix holds the data internally:
42
+
In the following, all sparse kinds will be presented in two main flavors: a data-less type `<matrix>_type` useful for topological graph operations. And real/complex valued types `<matrix>_<kind>_type` containing the `data` buffer for the matrix values. The following rectangular matrix will be used to showcase how each sparse matrix holds the data internally:
43
43
44
44
$$ M = \begin{bmatrix}
45
45
9 & 0 & 0 & 0 & -3 \\
@@ -57,7 +57,7 @@ Experimental
57
57
The `COO`, triplet or `ijv` format defines all non-zero elements of the matrix by explicitly allocating the `i,j` index and the value of the matrix. While some implementations use separate `row` and `col` arrays for the index, here we use a 2D array in order to promote fast memory acces to `ij`.
58
58
59
59
```Fortran
60
-
type(COO_sp) :: COO
60
+
type(COO_sp_type) :: COO
61
61
call COO%malloc(4,5,10)
62
62
COO%data(:) = real([9,-3,4,7,8,-1,8,4,5,6])
63
63
COO%index(1:2,1) = [1,1]
@@ -81,7 +81,7 @@ Experimental
81
81
The Compressed Sparse Row or Yale format `CSR` stores the matrix structure by compressing the row indices with a counter pointer `rowptr` enabling to know the first and last non-zero column index `col` of the given row.
82
82
83
83
```Fortran
84
-
type(CSR_sp) :: CSR
84
+
type(CSR_sp_type) :: CSR
85
85
call CSR%malloc(4,5,10)
86
86
CSR%data(:) = real([9,-3,4,7,8,-1,8,4,5,6])
87
87
CSR%col(:) = [1,5,1,2,2,3,4,1,3,4]
@@ -97,7 +97,7 @@ Experimental
97
97
The Compressed Sparse Colum `CSC` is similar to the `CSR` format but values are accesed first by column, thus an index counter is given by `colptr` which enables to know the first and last non-zero row index of a given colum.
98
98
99
99
```Fortran
100
-
type(CSC_sp) :: CSC
100
+
type(CSC_sp_type) :: CSC
101
101
call CSC%malloc(4,5,10)
102
102
CSC%data(:) = real([9,4,4,7,8,-1,5,8,6,-3])
103
103
CSC%row(:) = [1,2,4,2,3,3,4,3,4,1]
@@ -113,7 +113,7 @@ Experimental
113
113
The `ELL` format stores data in a dense matrix of $nrows \times K$ in column major order. By imposing a constant number of elements per row $K$, this format will incur in additional zeros being stored, but it enables efficient vectorization as memory acces is carried out by constant sized strides.
0 commit comments