template<typename
T>
class ModuleIO::csrFileReader< T >
Class to read CSR file.
This class is used to read CSR file Both save_sparse's compact three-line header (STEP, Matrix Dimension, Matrix number) and the cell-aware format below are accepted. Compact CSR blocks contain an R coordinate/nnz line, values, zero-based column indices, and dimension+1 row pointers. Invalid dimensions, indices and truncated data are rejected for both formats rather than producing an empty matrix. The cell-aware format is like:
Ionic_Step 1
# print density matrix in real space DM(R)
26 # number of localized basis
13 # number of Bravais lattice
vector R
unitcell_information
#--------------------------------------------------------#
# CSR format #
# Outer loop is the number of Bravais lattice vectors. #
# First line is Bravais lattice vector index Rx, Ry, Rz, #
# followed by the number of non-zero elements. #
# Next are three blocks of data. #
#--------------------------------------------------------#
-1 0 0 507
# CSR values
6.73361941e-04 -3.97537783e-05 7.92408228e-04 ...
# CSR column indices
0 1 2 ...
# CSR row pointers
0 26 52 ...
...
It will store the R coordinates and sparse matrices as two vectors. One can use getter functions to get the R coordinates and sparse matrices, and related info including step, matrix dimension, number of R.