13 std::vector<double>
val;
25 std::cerr <<
"error, r!=c, square matrix only now" << std::endl;
38 std::cerr <<
"error, r!=c, square matrix only now" << std::endl;
56 d_real_SpMat(
int r,
int c,
int NNZ,
int* row_pointer,
int* col_index,
double* value){
58 std::cerr <<
"error, r!=c, square matrix only now" << std::endl;
65 for(
int i=0; i<
row+1; i++){
71 for(
int i=0; i<
nnz; i++){
82 d_real_SpMat(std::vector<int>& row_pointer, std::vector<int>& col_index, std::vector<double>& value){
84 row_ptr.resize(row_pointer.size());
85 for(
int i=0; i<
row_ptr.size()+1; i++){
89 val.resize(value.size());
90 col_ind.resize(col_index.size());
91 for(
int i=0; i<
val.size(); i++){
103 d_real_SpMat(
int r, std::vector<int>& row_index, std::vector<int>& col_index, std::vector<double>& value){
109 for (
int i = 0; i < row_index.size(); i++) {
110 int idx = row_index[0];
121 val.resize(value.size());
122 col_ind.resize(col_index.size());
123 for(
int i=0; i<
val.size(); i++){
141 void input_mm(
const char* filename);
157 double at(
const int r,
const int c);
160 void insert(
const int r,
const int c,
const double a);
172 std::vector<double>::reference
data() {
double precision CRS format sparse matrix
d_real_vector get_col_vec(const int c)
get col vector A[*,c]
std::vector< double >::reference data()
get CRS value array
std::vector< int > col_ind
d_real_SpMat(std::vector< int > &row_pointer, std::vector< int > &col_index, std::vector< double > &value)
create CRS matrix from CRS vectors
d_real_vector get_row_vec(const int r)
get row vector A[r,*]
void input_mm(const char *filename)
input matrix from matrix market format
void output_mm(const char *filename)
output matrix to matrix market format
int get_nnz() const
get # of col.
void output()
output matrix to standard I/O
std::vector< int > row_ptr
void insert(const int r, const int c, const double a)
insert value a to A[r, c]
d_real_vector get_diag_vec()
get diagonal vector
int get_row() const
get # of row
double at(const int r, const int c)
get A[r, c]
std::vector< double > val
d_real_SpMat(int r, int c, int NNZ, int *row_pointer, int *col_index, double *value)
create CRS matrix from CRS pointer
d_real_SpMat & operator=(const d_real_SpMat &mat)
copy operator
d_real_SpMat(int r, int c)
allocate size r * c matrix
d_real_SpMat(int r, std::vector< int > &row_index, std::vector< int > &col_index, std::vector< double > &value)
create CRS matrix from COO vectors
d_real_SpMat(int r, int c, int NNZ)
allocate size r * c, nnz=NNZ matrix
void copy(const d_real_SpMat &mat)
copy, mat = A
Double precision vector class, This class is almost same as std::vector<double>
Double-double precision vector class.