r"""Returns the compressed sparse row (CSR) representation of the sparse matrix. See `CSR in Wikipedia `_. This function also returns value indices as an index tensor, ind
(self)
| 139 | return self.c_sparse_matrix.indices() |
| 140 | |
| 141 | def csr(self) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: |
| 142 | r"""Returns the compressed sparse row (CSR) representation of the sparse |
| 143 | matrix. |
| 144 | |
| 145 | See `CSR in Wikipedia <https://en.wikipedia.org/wiki/ |
| 146 | Sparse_matrix#Compressed_sparse_row_(CSR, _CRS_or_Yale_format)>`_. |
| 147 | |
| 148 | This function also returns value indices as an index tensor, indicating |
| 149 | the order of the values of non-zero elements in the CSR representation. |
| 150 | A ``None`` value indices array indicates the order of the values stays |
| 151 | the same as the values of the SparseMatrix. |
| 152 | |
| 153 | Returns |
| 154 | ------- |
| 155 | torch.Tensor |
| 156 | Row indptr |
| 157 | torch.Tensor |
| 158 | Column indices |
| 159 | torch.Tensor |
| 160 | Value indices |
| 161 | |
| 162 | Examples |
| 163 | -------- |
| 164 | |
| 165 | >>> indices = torch.tensor([[1, 2, 1], [2, 4, 3]]) |
| 166 | >>> A = dglsp.spmatrix(indices) |
| 167 | >>> A.csr() |
| 168 | (tensor([0, 0, 2, 3]), tensor([2, 3, 4]), tensor([0, 2, 1])) |
| 169 | """ |
| 170 | return self.c_sparse_matrix.csr() |
| 171 | |
| 172 | def csc(self) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: |
| 173 | r"""Returns the compressed sparse column (CSC) representation of the |
no outgoing calls