ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
csr_reader.h
Go to the documentation of this file.
1#ifndef CSR_READER_H
2#define CSR_READER_H
3
4#include <fstream>
5
6#include "file_reader.h"
7#include "sparse_matrix.h"
8
9namespace ModuleIO
10{
11
46template <typename T>
48{
49 public:
50 // Constructor
51 csrFileReader(const std::string& filename);
52
53 // read all matrices of all R coordinates
54 void parseFile();
55
56 // get number of R
57 int getNumberOfR() const;
58
59 // get sparse matrix of a specific R coordinate
60 SparseMatrix<T> getMatrix(int Rx, int Ry, int Rz) const;
61
62 // get matrix by using index
63 SparseMatrix<T> getMatrix(int index) const;
64
65 // get R coordinate using index
66 std::vector<int> getRCoordinate(int index) const;
67
68 // get step
69 int getStep() const;
70
71 // get matrix dimension
72 int getMatrixDimension() const;
73
74 private:
75 std::vector<std::vector<int>> RCoordinates;
76 std::vector<SparseMatrix<T>> sparse_matrices;
77 int step;
80};
81
82} // namespace ModuleIO
83
84#endif // READ_CSR_H
A base class of file reader.
Definition file_reader.h:19
Sparse matrix class designed mainly for csr format input and output.
Definition sparse_matrix.h:24
Class to read CSR file.
Definition csr_reader.h:48
int matrixDimension
Definition csr_reader.h:78
std::vector< std::vector< int > > RCoordinates
Definition csr_reader.h:75
std::vector< int > getRCoordinate(int index) const
Definition csr_reader.cpp:193
std::vector< SparseMatrix< T > > sparse_matrices
Definition csr_reader.h:76
int getMatrixDimension() const
Definition csr_reader.cpp:236
void parseFile()
Definition csr_reader.cpp:16
int step
Definition csr_reader.h:77
SparseMatrix< T > getMatrix(int Rx, int Ry, int Rz) const
Definition csr_reader.cpp:215
int getNumberOfR() const
Definition csr_reader.cpp:229
int getStep() const
Definition csr_reader.cpp:243
int numberOfR
Definition csr_reader.h:79
Definition input_help.cpp:10