paso::SparseMatrix< T > Struct Template Reference

`#include <SparseMatrix.h>`

Inheritance diagram for paso::SparseMatrix< T >:

## Public Member Functions

| SparseMatrix (SparseMatrixType type, Pattern_ptr pattern, dim_t rowBlockSize, dim_t colBlockSize, bool patternIsUnrolled)
| ~SparseMatrix ()
void | setValues (T value)
void | copyFromMainDiagonal (double *out) const
void | copyToMainDiagonal (const double *in)
void | copyBlockFromMainDiagonal (double *out) const
void | copyBlockToMainDiagonal (const double *in)
void | applyBlockMatrix (double *block_diag, index_t *pivot, double *x, const double *b) const
void | invMain (double *inv_diag, index_t *pivot) const
SparseMatrix_ptr< double > | unroll (SparseMatrixType type) const
SparseMatrix_ptr< double > | getSubmatrix (dim_t n_row_sub, dim_t n_col_sub, const index_t *row_list, const index_t *new_col_index) const
SparseMatrix_ptr< double > | getBlock (int blockid) const
SparseMatrix_ptr< double > | getTranspose () const
void | saveHB_CSC (const char *filename) const
void | saveMM (const char *filename) const
index_t * | borrowMainDiagonalPointer () const
index_t * | borrowColoringPointer () const
dim_t | getNumColors () const
dim_t | maxDeg () const
dim_t | getTotalNumRows () const
dim_t | getTotalNumCols () const
dim_t | getNumRows () const
dim_t | getNumCols () const
double | getSize () const
double | getSparsity () const
void | nullifyRowsAndCols_CSC_BLK1 (const double *mask_row, const double *mask_col, double main_diagonal_value)
void | nullifyRowsAndCols_CSR_BLK1 (const double *mask_row, const double *mask_col, double main_diagonal_value)
void | nullifyRowsAndCols_CSC (const double *mask_row, const double *mask_col, double main_diagonal_value)
void | nullifyRowsAndCols_CSR (const double *mask_row, const double *mask_col, double main_diagonal_value)
void | nullifyRows_CSR_BLK1 (const double *mask_row, double main_diagonal_value)
void | nullifyRows_CSR (const double *mask_row, double main_diagonal_value)
void | maxAbsRow_CSR_OFFSET0 (double *array) const
void | addAbsRow_CSR_OFFSET0 (double *array) const
void | addRow_CSR_OFFSET0 (double *array) const
void | applyDiagonal_CSR_OFFSET0 (const double *left, const double *right)
SparseMatrix_ptr< double > | loadMM_toCSR (const char *filename)
void | saveMM (const char *filename) const
void | addAbsRow_CSR_OFFSET0 (double *array) const
void | maxAbsRow_CSR_OFFSET0 (double *array) const
void | addRow_CSR_OFFSET0 (double *array) const
void | copyBlockToMainDiagonal (const double *in)
void | copyBlockFromMainDiagonal (double *out) const
void | copyFromMainDiagonal (double *out) const
void | copyToMainDiagonal (const double *in)
void | applyDiagonal_CSR_OFFSET0 (const double *left, const double *right)
void | invMain (double *inv_diag, index_t *pivot) const
void | applyBlockMatrix (double *block_diag, index_t *pivot, double *x, const double *b) const
SparseMatrix_ptr< double > | getTranspose () const
SparseMatrix_ptr< double > | unroll (SparseMatrixType newType) const
void | saveMM (const char *filename) const
void | saveHB_CSC (const char *filename) const
void | saveMM (const char *filename) const
void | saveHB_CSC (const char *filename) const
void | saveMM (const char *filename) const
SparseMatrix_ptr< double > | getSubmatrix (dim_t n_row_sub, dim_t n_col_sub, const index_t *row_list, const index_t *new_col_index) const
SparseMatrix_ptr< double > | getBlock (int blockid) const
void | nullifyRows_CSR_BLK1 (const double *mask_row, double main_diagonal_value)
void | nullifyRows_CSR (const double *mask_row, double main_diagonal_value)
void | saveHB_CSC (const char *filename) const
void | saveHB_CSC (const char *filename) const

## Static Public Member Functions

static SparseMatrix_ptr< double > | loadMM_toCSR (const char *filename)

## Public Attributes

SparseMatrixType | type
dim_t | row_block_size
dim_t | col_block_size
dim_t | block_size
dim_t | numRows
dim_t | numCols
Pattern_ptr | pattern
dim_t | len
T * | val
| this is used for classical CSR or CSC More...
index_t | solver_package
| package controlling the solver pointer More...
void * | solver_p
| pointer to data needed by a solver More...

## Constructor & Destructor Documentation

## SparseMatrix()

template<typename T >

paso::SparseMatrix< T >::SparseMatrix | ( | SparseMatrixType | type,
|  | Pattern_ptr | pattern,
|  | dim_t | rowBlockSize,
|  | dim_t | colBlockSize,
|  | bool | patternIsUnrolled
| ) |  |

References paso::SparseMatrix< T >::block_size, paso::SparseMatrix< T >::col_block_size, paso::SparseMatrix< T >::len, MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, MATRIX_FORMAT_DIAGONAL_BLOCK, MATRIX_FORMAT_OFFSET1, paso::SparseMatrix< T >::numCols, paso::SparseMatrix< T >::numRows, paso::SparseMatrix< T >::pattern, paso::SparseMatrix< T >::row_block_size, paso::SparseMatrix< T >::setValues(), paso::SparseMatrix< T >::unroll(), and paso::SparseMatrix< T >::val.

## ~SparseMatrix()

template<typename T >

paso::SparseMatrix< T >::~SparseMatrix

References paso::MKL_free(), paso::MUMPS_free(), PASO_MKL, PASO_MUMPS, PASO_SMOOTHER, PASO_UMFPACK, paso::Preconditioner_LocalSmoother_free(), and paso::UMFPACK_free().

## Member Function Documentation

## addAbsRow_CSR_OFFSET0() [1/2]

void paso::SparseMatrix< double >::addAbsRow_CSR_OFFSET0 | ( | double * | array | ) | const

## addAbsRow_CSR_OFFSET0() [2/2]

template<typename T >

void paso::SparseMatrix< T >::addAbsRow_CSR_OFFSET0 | ( | double * | array | ) | const

## addRow_CSR_OFFSET0() [1/2]

void paso::SparseMatrix< double >::addRow_CSR_OFFSET0 | ( | double * | array | ) | const

## addRow_CSR_OFFSET0() [2/2]

template<typename T >

void paso::SparseMatrix< T >::addRow_CSR_OFFSET0 | ( | double * | array | ) | const

## applyBlockMatrix() [1/2]

void paso::SparseMatrix< double >::applyBlockMatrix | ( | double * | block_diag,
|  | index_t * | pivot,
|  | double * | x,
|  | const double * | b
| ) |  | const

References paso::BlockOps_solveAll(), and paso::util::copy().

## applyBlockMatrix() [2/2]

template<typename T >

void paso::SparseMatrix< T >::applyBlockMatrix | ( | double * | block_diag,
|  | index_t * | pivot,
|  | double * | x,
|  | const double * | b
| ) |  | const

## applyDiagonal_CSR_OFFSET0() [1/2]

void paso::SparseMatrix< double >::applyDiagonal_CSR_OFFSET0 | ( | const double * | left,
|  | const double * | right
| ) |  |

## applyDiagonal_CSR_OFFSET0() [2/2]

template<typename T >

void paso::SparseMatrix< T >::applyDiagonal_CSR_OFFSET0 | ( | const double * | left,
|  | const double * | right
| ) |  |

## borrowColoringPointer()

template<typename T >

index_t* paso::SparseMatrix< T >::borrowColoringPointer | ( |  | ) | const

inline

References paso::SparseMatrix< T >::pattern.

## borrowMainDiagonalPointer()

template<typename T >

index_t* paso::SparseMatrix< T >::borrowMainDiagonalPointer | ( |  | ) | const

inline

References paso::SparseMatrix< T >::pattern.

## copyBlockFromMainDiagonal() [1/2]

void paso::SparseMatrix< double >::copyBlockFromMainDiagonal | ( | double * | out | ) | const

## copyBlockFromMainDiagonal() [2/2]

template<typename T >

void paso::SparseMatrix< T >::copyBlockFromMainDiagonal | ( | double * | out | ) | const

## copyBlockToMainDiagonal() [1/2]

void paso::SparseMatrix< double >::copyBlockToMainDiagonal | ( | const double * | in | ) |

## copyBlockToMainDiagonal() [2/2]

template<typename T >

void paso::SparseMatrix< T >::copyBlockToMainDiagonal | ( | const double * | in | ) |

## copyFromMainDiagonal() [1/2]

void paso::SparseMatrix< double >::copyFromMainDiagonal | ( | double * | out | ) | const

## copyFromMainDiagonal() [2/2]

template<typename T >

void paso::SparseMatrix< T >::copyFromMainDiagonal | ( | double * | out | ) | const

## copyToMainDiagonal() [1/2]

void paso::SparseMatrix< double >::copyToMainDiagonal | ( | const double * | in | ) |

## copyToMainDiagonal() [2/2]

template<typename T >

void paso::SparseMatrix< T >::copyToMainDiagonal | ( | const double * | in | ) |

## getBlock() [1/2]

template<typename T >

SparseMatrix_ptr<double> paso::SparseMatrix< T >::getBlock | ( | int | blockid | ) | const

## getBlock() [2/2]

SparseMatrix_ptr< double > paso::SparseMatrix< double >::getBlock | ( | int | blockid | ) | const

## getNumColors()

template<typename T >

dim_t paso::SparseMatrix< T >::getNumColors | ( |  | ) | const

inline

References paso::SparseMatrix< T >::pattern.

## getNumCols()

template<typename T >

dim_t paso::SparseMatrix< T >::getNumCols | ( |  | ) | const

inline

References paso::SparseMatrix< T >::numCols.

## getNumRows()

template<typename T >

dim_t paso::SparseMatrix< T >::getNumRows | ( |  | ) | const

inline

References paso::SparseMatrix< T >::numRows.

## getSize()

template<typename T >

double paso::SparseMatrix< T >::getSize | ( |  | ) | const

inline

References paso::SparseMatrix< T >::len.

Referenced by paso::SparseMatrix< T >::getSparsity().

## getSparsity()

template<typename T >

double paso::SparseMatrix< T >::getSparsity | ( |  | ) | const

inline

References paso::SparseMatrix< T >::getSize(), paso::SparseMatrix< T >::getTotalNumCols(), and paso::SparseMatrix< T >::getTotalNumRows().

## getSubmatrix() [1/2]

template<typename T >

SparseMatrix_ptr<double> paso::SparseMatrix< T >::getSubmatrix | ( | dim_t | n_row_sub,
|  | dim_t | n_col_sub,
|  | const index_t * | row_list,
|  | const index_t * | new_col_index
| ) |  | const

## getSubmatrix() [2/2]

SparseMatrix_ptr< double > paso::SparseMatrix< double >::getSubmatrix | ( | dim_t | n_row_sub,
|  | dim_t | n_col_sub,
|  | const index_t * | row_list,
|  | const index_t * | new_col_index
| ) |  | const

References paso::BlockOps_Cpy_N(), MATRIX_FORMAT_CSC, and MATRIX_FORMAT_OFFSET1.

## getTotalNumCols()

template<typename T >

dim_t paso::SparseMatrix< T >::getTotalNumCols | ( |  | ) | const

inline

References paso::SparseMatrix< T >::col_block_size, and paso::SparseMatrix< T >::numCols.

Referenced by paso::SparseMatrix< T >::getSparsity().

## getTotalNumRows()

template<typename T >

dim_t paso::SparseMatrix< T >::getTotalNumRows | ( |  | ) | const

inline

References paso::SparseMatrix< T >::numRows, and paso::SparseMatrix< T >::row_block_size.

Referenced by paso::SparseMatrix< T >::getSparsity().

## getTranspose() [1/2]

SparseMatrix_ptr< double > paso::SparseMatrix< double >::getTranspose | ( |  | ) | const

References paso::util::comparIndex(), paso::Pattern::fromIndexListArray(), and MATRIX_FORMAT_DIAGONAL_BLOCK.

## getTranspose() [2/2]

template<typename T >

SparseMatrix_ptr<double> paso::SparseMatrix< T >::getTranspose | ( |  | ) | const

## invMain() [1/2]

void paso::SparseMatrix< double >::invMain | ( | double * | inv_diag,
|  | index_t * | pivot
| ) |  | const

References paso::BlockOps_Cpy_N(), paso::BlockOps_invM_2(), paso::BlockOps_invM_3(), and paso::BlockOps_invM_N().

## invMain() [2/2]

template<typename T >

void paso::SparseMatrix< T >::invMain | ( | double * | inv_diag,
|  | index_t * | pivot
| ) |  | const

## loadMM_toCSR() [1/2]

SparseMatrix_ptr< double > paso::SparseMatrix< double >::loadMM_toCSR | ( | const char * | filename | ) |

References paso::M, MATRIX_FORMAT_DEFAULT, mm_is_general, mm_is_real, mm_is_sparse, mm_read_banner(), mm_read_mtx_crd_size(), paso::N, paso::nz, and paso::q_sort().

## loadMM_toCSR() [2/2]

template<typename T >

static SparseMatrix_ptr<double> paso::SparseMatrix< T >::loadMM_toCSR | ( | const char * | filename | ) |

static

## maxAbsRow_CSR_OFFSET0() [1/2]

void paso::SparseMatrix< double >::maxAbsRow_CSR_OFFSET0 | ( | double * | array | ) | const

## maxAbsRow_CSR_OFFSET0() [2/2]

template<typename T >

void paso::SparseMatrix< T >::maxAbsRow_CSR_OFFSET0 | ( | double * | array | ) | const

## maxDeg()

template<typename T >

dim_t paso::SparseMatrix< T >::maxDeg | ( |  | ) | const

inline

References paso::SparseMatrix< T >::pattern.

## nullifyRows_CSR() [1/2]

template<typename T >

void paso::SparseMatrix< T >::nullifyRows_CSR | ( | const double * | mask_row,
|  | double | main_diagonal_value
| ) |  |

## nullifyRows_CSR() [2/2]

void paso::SparseMatrix< double >::nullifyRows_CSR | ( | const double * | mask_row,
|  | double | main_diagonal_value
| ) |  |

References MATRIX_FORMAT_OFFSET1.

## nullifyRows_CSR_BLK1() [1/2]

template<typename T >

void paso::SparseMatrix< T >::nullifyRows_CSR_BLK1 | ( | const double * | mask_row,
|  | double | main_diagonal_value
| ) |  |

## nullifyRows_CSR_BLK1() [2/2]

void paso::SparseMatrix< double >::nullifyRows_CSR_BLK1 | ( | const double * | mask_row,
|  | double | main_diagonal_value
| ) |  |

References MATRIX_FORMAT_OFFSET1.

## nullifyRowsAndCols_CSC()

template<typename T >

void paso::SparseMatrix< T >::nullifyRowsAndCols_CSC | ( | const double * | mask_row,
|  | const double * | mask_col,
|  | double | main_diagonal_value
| ) |  |

References MATRIX_FORMAT_OFFSET1.

## nullifyRowsAndCols_CSC_BLK1()

template<typename T >

void paso::SparseMatrix< T >::nullifyRowsAndCols_CSC_BLK1 | ( | const double * | mask_row,
|  | const double * | mask_col,
|  | double | main_diagonal_value
| ) |  |

References MATRIX_FORMAT_OFFSET1.

## nullifyRowsAndCols_CSR()

template<typename T >

void paso::SparseMatrix< T >::nullifyRowsAndCols_CSR | ( | const double * | mask_row,
|  | const double * | mask_col,
|  | double | main_diagonal_value
| ) |  |

References MATRIX_FORMAT_OFFSET1.

## nullifyRowsAndCols_CSR_BLK1()

template<typename T >

void paso::SparseMatrix< T >::nullifyRowsAndCols_CSR_BLK1 | ( | const double * | mask_row,
|  | const double * | mask_col,
|  | double | main_diagonal_value
| ) |  |

References MATRIX_FORMAT_OFFSET1.

## saveHB_CSC() [1/5]

template<typename T >

void paso::SparseMatrix< T >::saveHB_CSC | ( | const char * | filename | ) | const

## saveHB_CSC() [2/5]

void paso::SparseMatrix< double >::saveHB_CSC | ( | const char * | filename | ) | const

## saveHB_CSC() [3/5]

void paso::SparseMatrix< cplx_t >::saveHB_CSC | ( | const char * | filename | ) | const

## saveHB_CSC() [4/5]

void paso::SparseMatrix< double >::saveHB_CSC | ( | const char * | filename | ) | const

References paso::generate_HB(), paso::M, MATRIX_FORMAT_OFFSET1, and paso::N.

## saveHB_CSC() [5/5]

void paso::SparseMatrix< cplx_t >::saveHB_CSC | ( | const char * | filename | ) | const

## saveMM() [1/5]

void paso::SparseMatrix< double >::saveMM | ( | const char * | filename | ) | const

References paso::M, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DIAGONAL_BLOCK, MATRIX_FORMAT_OFFSET1, mm_initialize_typecode, mm_set_coordinate, mm_set_matrix, mm_set_real, mm_write_banner(), mm_write_mtx_crd_size(), and paso::N.

## saveMM() [2/5]

void paso::SparseMatrix< cplx_t >::saveMM | ( | const char * | filename | ) | const

## saveMM() [3/5]

template<typename T >

void paso::SparseMatrix< T >::saveMM | ( | const char * | filename | ) | const

## saveMM() [4/5]

void paso::SparseMatrix< double >::saveMM | ( | const char * | filename | ) | const

## saveMM() [5/5]

void paso::SparseMatrix< cplx_t >::saveMM | ( | const char * | filename | ) | const

## setValues()

template<typename T >

void paso::SparseMatrix< T >::setValues | ( | T | value | ) |

References MATRIX_FORMAT_OFFSET1.

Referenced by paso::SparseMatrix< T >::SparseMatrix().

## unroll() [1/2]

SparseMatrix_ptr< double > paso::SparseMatrix< double >::unroll | ( | SparseMatrixType | newType | ) | const

References paso::util::comparIndex(), MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, and MATRIX_FORMAT_OFFSET1.

## unroll() [2/2]

template<typename T >

SparseMatrix_ptr<double> paso::SparseMatrix< T >::unroll | ( | SparseMatrixType | type | ) | const

Referenced by paso::SparseMatrix< T >::SparseMatrix().

## Member Data Documentation

## block_size

template<typename T >

dim_t paso::SparseMatrix< T >::block_size

Referenced by paso::SparseMatrix< T >::SparseMatrix().

## col_block_size

template<typename T >

dim_t paso::SparseMatrix< T >::col_block_size

Referenced by paso::SparseMatrix< T >::getTotalNumCols(), and paso::SparseMatrix< T >::SparseMatrix().

## len

template<typename T >

dim_t paso::SparseMatrix< T >::len

Referenced by paso::SparseMatrix< T >::getSize(), and paso::SparseMatrix< T >::SparseMatrix().

## numCols

template<typename T >

dim_t paso::SparseMatrix< T >::numCols

Referenced by paso::SparseMatrix< T >::getNumCols(), paso::SparseMatrix< T >::getTotalNumCols(), and paso::SparseMatrix< T >::SparseMatrix().

## numRows

template<typename T >

dim_t paso::SparseMatrix< T >::numRows

Referenced by paso::SparseMatrix< T >::getNumRows(), paso::SparseMatrix< T >::getTotalNumRows(), paso::MKL_free(), and paso::SparseMatrix< T >::SparseMatrix().

## pattern

template<typename T >

Pattern_ptr paso::SparseMatrix< T >::pattern

Referenced by paso::SparseMatrix< T >::borrowColoringPointer(), paso::SparseMatrix< T >::borrowMainDiagonalPointer(), paso::SparseMatrix< T >::getNumColors(), paso::SparseMatrix< T >::maxDeg(), paso::MKL_free(), and paso::SparseMatrix< T >::SparseMatrix().

## row_block_size

template<typename T >

dim_t paso::SparseMatrix< T >::row_block_size

Referenced by paso::SparseMatrix< T >::getTotalNumRows(), and paso::SparseMatrix< T >::SparseMatrix().

## solver_p

template<typename T >

void* paso::SparseMatrix< T >::solver_p

pointer to data needed by a solver

Referenced by paso::MKL_free(), paso::MUMPS_free(), and paso::UMFPACK_free().

## solver_package

template<typename T >

index_t paso::SparseMatrix< T >::solver_package

package controlling the solver pointer

Referenced by paso::MKL_free().

## type

template<typename T >

SparseMatrixType paso::SparseMatrix< T >::type

## val

template<typename T >

T* paso::SparseMatrix< T >::val

this is used for classical CSR or CSC

Referenced by paso::MKL_free(), and paso::SparseMatrix< T >::SparseMatrix().

The documentation for this struct was generated from the following file:

- SparseMatrix.h