DD-AVX  2.0.0
d_real_SpMat Class Reference

double precision CRS format sparse matrix More...

#include <DD-AVX_d_spmat.hpp>

Collaboration diagram for d_real_SpMat:
Collaboration graph

Public Member Functions

 d_real_SpMat ()
 
 d_real_SpMat (int r, int c)
 allocate size r * c matrix More...
 
 d_real_SpMat (int r, int c, int NNZ)
 allocate size r * c, nnz=NNZ matrix More...
 
 d_real_SpMat (int r, int c, int NNZ, int *row_pointer, int *col_index, double *value)
 create CRS matrix from CRS pointer More...
 
 d_real_SpMat (std::vector< int > &row_pointer, std::vector< int > &col_index, std::vector< double > &value)
 create CRS matrix from CRS vectors More...
 
 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 More...
 
void clear ()
 free More...
 
void input_mm (const char *filename)
 input matrix from matrix market format More...
 
void output_mm (const char *filename)
 output matrix to matrix market format More...
 
void output ()
 output matrix to standard I/O More...
 
int get_row () const
 get # of row More...
 
int get_nnz () const
 get # of col. More...
 
double at (const int r, const int c)
 get A[r, c] More...
 
void insert (const int r, const int c, const double a)
 insert value a to A[r, c] More...
 
d_real_vector get_row_vec (const int r)
 get row vector A[r,*] More...
 
d_real_vector get_col_vec (const int c)
 get col vector A[*,c] More...
 
d_real_vector get_diag_vec ()
 get diagonal vector More...
 
std::vector< double >::reference data ()
 get CRS value array More...
 
void copy (const d_real_SpMat &mat)
 copy, mat = A More...
 
d_real_SpMatoperator= (const d_real_SpMat &mat)
 copy operator
More...
 

Public Attributes

int row =0
 
int nnz =0
 
std::vector< double > val
 
std::vector< int > row_ptr
 
std::vector< int > col_ind
 

Detailed Description

double precision CRS format sparse matrix

Definition at line 9 of file DD-AVX_d_spmat.hpp.

Constructor & Destructor Documentation

◆ d_real_SpMat() [1/6]

d_real_SpMat::d_real_SpMat ( )
inline

Definition at line 17 of file DD-AVX_d_spmat.hpp.

◆ d_real_SpMat() [2/6]

d_real_SpMat::d_real_SpMat ( int  r,
int  c 
)
inline

allocate size r * c matrix

Parameters
r# of row
c# of col

Definition at line 23 of file DD-AVX_d_spmat.hpp.

◆ d_real_SpMat() [3/6]

d_real_SpMat::d_real_SpMat ( int  r,
int  c,
int  NNZ 
)
inline

allocate size r * c, nnz=NNZ matrix

Definition at line 36 of file DD-AVX_d_spmat.hpp.

◆ d_real_SpMat() [4/6]

d_real_SpMat::d_real_SpMat ( int  r,
int  c,
int  NNZ,
int *  row_pointer,
int *  col_index,
double *  value 
)
inline

create CRS matrix from CRS pointer

Parameters
r# of row
c# of col
NNZ# of non-zero elements
row_pointerwhich stores the starting points of the rows of the arrays value and col_ind (size M+1)
col_indexwhich stores the column numbers of the non-zero elements (size nnz)
valuewhich stores the non-zero elements (size nnz)

Definition at line 56 of file DD-AVX_d_spmat.hpp.

◆ d_real_SpMat() [5/6]

d_real_SpMat::d_real_SpMat ( std::vector< int > &  row_pointer,
std::vector< int > &  col_index,
std::vector< double > &  value 
)
inline

create CRS matrix from CRS vectors

Parameters
row_pointerwhich stores the starting points of the rows of the arrays value and col_ind (size M+1)
col_indexwhich stores the column numbers of the non-zero elements (size nnz)
valuewhich stores the non-zero elements (size nnz)

Definition at line 82 of file DD-AVX_d_spmat.hpp.

◆ d_real_SpMat() [6/6]

d_real_SpMat::d_real_SpMat ( int  r,
std::vector< int > &  row_index,
std::vector< int > &  col_index,
std::vector< double > &  value 
)
inline

create CRS matrix from COO vectors

Parameters
r# of row
row_indexwhich stores the row numbers of the non-zero elements (size nnz)
col_indexwhich stores the column numbers of the non-zero elements (size nnz)
valuewhich stores the non-zero elements (size nnz)

Definition at line 103 of file DD-AVX_d_spmat.hpp.

Member Function Documentation

◆ clear()

void d_real_SpMat::clear ( )
inline

free

Definition at line 131 of file DD-AVX_d_spmat.hpp.

◆ input_mm()

void d_real_SpMat::input_mm ( const char *  filename)

input matrix from matrix market format

Definition at line 16 of file matrix_IO.cpp.

◆ output_mm()

void d_real_SpMat::output_mm ( const char *  filename)

output matrix to matrix market format

Definition at line 125 of file matrix_IO.cpp.

◆ output()

void d_real_SpMat::output ( )

output matrix to standard I/O

Definition at line 112 of file matrix_IO.cpp.

◆ get_row()

int d_real_SpMat::get_row ( ) const
inline

get # of row

Definition at line 151 of file DD-AVX_d_spmat.hpp.

Here is the caller graph for this function:

◆ get_nnz()

int d_real_SpMat::get_nnz ( ) const
inline

get # of col.

Definition at line 154 of file DD-AVX_d_spmat.hpp.

◆ at()

double d_real_SpMat::at ( const int  r,
const int  c 
)

get A[r, c]

Definition at line 3 of file matrix_sys.cpp.

◆ insert()

void d_real_SpMat::insert ( const int  r,
const int  c,
const double  a 
)

insert value a to A[r, c]

Definition at line 12 of file matrix_sys.cpp.

◆ get_row_vec()

d_real_vector d_real_SpMat::get_row_vec ( const int  r)

get row vector A[r,*]

Definition at line 58 of file matrix_sys.cpp.

◆ get_col_vec()

d_real_vector d_real_SpMat::get_col_vec ( const int  c)

get col vector A[*,c]

Definition at line 73 of file matrix_sys.cpp.

◆ get_diag_vec()

d_real_vector d_real_SpMat::get_diag_vec ( )

get diagonal vector

Definition at line 91 of file matrix_sys.cpp.

◆ data()

std::vector<double>::reference d_real_SpMat::data ( )
inline

get CRS value array

Definition at line 172 of file DD-AVX_d_spmat.hpp.

Here is the caller graph for this function:

◆ copy()

void d_real_SpMat::copy ( const d_real_SpMat mat)

copy, mat = A

Definition at line 44 of file matrix_sys.cpp.

Here is the caller graph for this function:

◆ operator=()

d_real_SpMat & d_real_SpMat::operator= ( const d_real_SpMat mat)

copy operator

Definition at line 52 of file matrix_sys.cpp.

Member Data Documentation

◆ row

int d_real_SpMat::row =0

Definition at line 11 of file DD-AVX_d_spmat.hpp.

◆ nnz

int d_real_SpMat::nnz =0

Definition at line 12 of file DD-AVX_d_spmat.hpp.

◆ val

std::vector<double> d_real_SpMat::val

Definition at line 13 of file DD-AVX_d_spmat.hpp.

◆ row_ptr

std::vector<int> d_real_SpMat::row_ptr

Definition at line 14 of file DD-AVX_d_spmat.hpp.

◆ col_ind

std::vector<int> d_real_SpMat::col_ind

Definition at line 15 of file DD-AVX_d_spmat.hpp.


The documentation for this class was generated from the following files: