paso::SparseMatrix Struct Reference

`#include <SparseMatrix.h>`

Inheritance diagram for paso::SparseMatrix:

## Public Member Functions

| SparseMatrix (SparseMatrixType type, Pattern_ptr pattern, dim_t rowBlockSize, dim_t colBlockSize, bool patternIsUnrolled)
| ~SparseMatrix ()
void | setValues (double 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 | unroll (SparseMatrixType type) const
SparseMatrix_ptr | 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 | getBlock (int blockid) const
SparseMatrix_ptr | 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)

## Static Public Member Functions

static SparseMatrix_ptr | 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
double * | 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()

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

References block_size, col_block_size, len, MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, MATRIX_FORMAT_DIAGONAL_BLOCK, MATRIX_FORMAT_OFFSET1, numCols, numRows, pattern, row_block_size, setValues(), unroll(), and val.

Referenced by getBlock(), getSubmatrix(), getTranspose(), loadMM_toCSR(), and unroll().

## ~SparseMatrix()

paso::SparseMatrix::~SparseMatrix | ( |  | ) |

References paso::MKL_free(), PASO_MKL, PASO_SMOOTHER, PASO_UMFPACK, paso::Preconditioner_LocalSmoother_free(), solver_p, solver_package, paso::UMFPACK_free(), and val.

## Member Function Documentation

## addAbsRow_CSR_OFFSET0()

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

References block_size, col_block_size, pattern, row_block_size, and val.

Referenced by getSparsity().

## addRow_CSR_OFFSET0()

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

References block_size, col_block_size, pattern, row_block_size, and val.

Referenced by getSparsity().

## applyBlockMatrix()

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

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

## applyDiagonal_CSR_OFFSET0()

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

References col_block_size, pattern, row_block_size, and val.

Referenced by getSparsity().

## borrowColoringPointer()

index_t* paso::SparseMatrix::borrowColoringPointer | ( |  | ) | const

inline

## borrowMainDiagonalPointer()

index_t* paso::SparseMatrix::borrowMainDiagonalPointer | ( |  | ) | const

inline

Referenced by copyBlockFromMainDiagonal(), copyBlockToMainDiagonal(), copyFromMainDiagonal(), and copyToMainDiagonal().

## copyBlockFromMainDiagonal()

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

References block_size, borrowMainDiagonalPointer(), pattern, and val.

## copyBlockToMainDiagonal()

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

References block_size, borrowMainDiagonalPointer(), pattern, and val.

## copyFromMainDiagonal()

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

References block_size, borrowMainDiagonalPointer(), col_block_size, pattern, row_block_size, and val.

## copyToMainDiagonal()

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

References block_size, borrowMainDiagonalPointer(), col_block_size, pattern, row_block_size, and val.

## getBlock()

SparseMatrix_ptr paso::SparseMatrix::getBlock | ( | int | blockid | ) | const

References numRows, pattern, row_block_size, SparseMatrix(), type, and val.

## getNumColors()

dim_t paso::SparseMatrix::getNumColors | ( |  | ) | const

inline

## getNumCols()

dim_t paso::SparseMatrix::getNumCols | ( |  | ) | const

inline

References numCols.

Referenced by saveMM().

## getNumRows()

dim_t paso::SparseMatrix::getNumRows | ( |  | ) | const

inline

References numRows.

Referenced by saveMM().

## getSize()

double paso::SparseMatrix::getSize | ( |  | ) | const

inline

References len.

Referenced by getSparsity().

## getSparsity()

double paso::SparseMatrix::getSparsity | ( |  | ) | const

inline

References addAbsRow_CSR_OFFSET0(), addRow_CSR_OFFSET0(), applyDiagonal_CSR_OFFSET0(), getSize(), getTotalNumCols(), getTotalNumRows(), loadMM_toCSR(), maxAbsRow_CSR_OFFSET0(), nullifyRows_CSR(), nullifyRows_CSR_BLK1(), nullifyRowsAndCols_CSC(), nullifyRowsAndCols_CSC_BLK1(), nullifyRowsAndCols_CSR(), and nullifyRowsAndCols_CSR_BLK1().

## getSubmatrix()

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

References block_size, paso::BlockOps_Cpy_N(), col_block_size, MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, pattern, row_block_size, SparseMatrix(), type, and val.

## getTotalNumCols()

dim_t paso::SparseMatrix::getTotalNumCols | ( |  | ) | const

inline

References col_block_size, and numCols.

Referenced by getSparsity().

## getTotalNumRows()

dim_t paso::SparseMatrix::getTotalNumRows | ( |  | ) | const

inline

References numRows, and row_block_size.

Referenced by getSparsity().

## getTranspose()

SparseMatrix_ptr paso::SparseMatrix::getTranspose | ( |  | ) | const

References block_size, col_block_size, paso::util::comparIndex(), paso::Pattern::fromIndexListArray(), MATRIX_FORMAT_DIAGONAL_BLOCK, numCols, numRows, pattern, row_block_size, SparseMatrix(), type, and val.

## invMain()

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

References block_size, paso::BlockOps_Cpy_N(), paso::BlockOps_invM_2(), paso::BlockOps_invM_3(), paso::BlockOps_invM_N(), col_block_size, numRows, pattern, row_block_size, and val.

## loadMM_toCSR()

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

static

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, paso::q_sort(), SparseMatrix(), and val.

Referenced by getSparsity().

## maxAbsRow_CSR_OFFSET0()

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

References block_size, col_block_size, pattern, row_block_size, and val.

Referenced by getSparsity().

## maxDeg()

dim_t paso::SparseMatrix::maxDeg | ( |  | ) | const

inline

## nullifyRows_CSR()

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

References block_size, col_block_size, MATRIX_FORMAT_OFFSET1, pattern, row_block_size, type, and val.

Referenced by getSparsity().

## nullifyRows_CSR_BLK1()

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

References MATRIX_FORMAT_OFFSET1, pattern, type, and val.

Referenced by getSparsity().

## nullifyRowsAndCols_CSC()

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

References block_size, col_block_size, MATRIX_FORMAT_OFFSET1, pattern, row_block_size, type, and val.

Referenced by getSparsity().

## nullifyRowsAndCols_CSC_BLK1()

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

References MATRIX_FORMAT_OFFSET1, pattern, type, and val.

Referenced by getSparsity().

## nullifyRowsAndCols_CSR()

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

References block_size, col_block_size, MATRIX_FORMAT_OFFSET1, pattern, row_block_size, type, and val.

Referenced by getSparsity().

## nullifyRowsAndCols_CSR_BLK1()

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

References MATRIX_FORMAT_OFFSET1, pattern, type, and val.

Referenced by getSparsity().

## saveHB_CSC()

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

References col_block_size, paso::generate_HB(), len, MATRIX_FORMAT_OFFSET1, paso::N, numCols, numRows, pattern, row_block_size, type, and val.

## saveMM()

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

References block_size, col_block_size, getNumCols(), getNumRows(), 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(), paso::N, pattern, row_block_size, type, and val.

## setValues()

void paso::SparseMatrix::setValues | ( | double | value | ) |

References block_size, MATRIX_FORMAT_OFFSET1, pattern, type, and val.

Referenced by SparseMatrix().

## unroll()

SparseMatrix_ptr paso::SparseMatrix::unroll | ( | SparseMatrixType | type | ) | const

References block_size, col_block_size, paso::util::comparIndex(), MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, numRows, pattern, row_block_size, SparseMatrix(), type, and val.

Referenced by SparseMatrix().

## Member Data Documentation

## block_size

dim_t paso::SparseMatrix::block_size

Referenced by addAbsRow_CSR_OFFSET0(), addRow_CSR_OFFSET0(), copyBlockFromMainDiagonal(), copyBlockToMainDiagonal(), copyFromMainDiagonal(), copyToMainDiagonal(), getSubmatrix(), getTranspose(), invMain(), maxAbsRow_CSR_OFFSET0(), nullifyRows_CSR(), nullifyRowsAndCols_CSC(), nullifyRowsAndCols_CSR(), saveMM(), setValues(), SparseMatrix(), and unroll().

## col_block_size

dim_t paso::SparseMatrix::col_block_size

Referenced by addAbsRow_CSR_OFFSET0(), addRow_CSR_OFFSET0(), applyDiagonal_CSR_OFFSET0(), copyFromMainDiagonal(), copyToMainDiagonal(), getSubmatrix(), getTotalNumCols(), getTranspose(), invMain(), maxAbsRow_CSR_OFFSET0(), nullifyRows_CSR(), nullifyRowsAndCols_CSC(), nullifyRowsAndCols_CSR(), saveHB_CSC(), saveMM(), SparseMatrix(), and unroll().

## len

dim_t paso::SparseMatrix::len

Referenced by getSize(), saveHB_CSC(), and SparseMatrix().

## numCols

dim_t paso::SparseMatrix::numCols

Referenced by getNumCols(), getTotalNumCols(), getTranspose(), saveHB_CSC(), and SparseMatrix().

## numRows

dim_t paso::SparseMatrix::numRows

Referenced by applyBlockMatrix(), getBlock(), getNumRows(), getTotalNumRows(), getTranspose(), invMain(), paso::MKL_free(), saveHB_CSC(), SparseMatrix(), and unroll().

## pattern

Pattern_ptr paso::SparseMatrix::pattern

Referenced by addAbsRow_CSR_OFFSET0(), addRow_CSR_OFFSET0(), applyDiagonal_CSR_OFFSET0(), copyBlockFromMainDiagonal(), copyBlockToMainDiagonal(), copyFromMainDiagonal(), copyToMainDiagonal(), getBlock(), getSubmatrix(), getTranspose(), invMain(), maxAbsRow_CSR_OFFSET0(), paso::MKL_free(), nullifyRows_CSR(), nullifyRows_CSR_BLK1(), nullifyRowsAndCols_CSC(), nullifyRowsAndCols_CSC_BLK1(), nullifyRowsAndCols_CSR(), nullifyRowsAndCols_CSR_BLK1(), saveHB_CSC(), saveMM(), setValues(), SparseMatrix(), and unroll().

## row_block_size

dim_t paso::SparseMatrix::row_block_size

Referenced by addAbsRow_CSR_OFFSET0(), addRow_CSR_OFFSET0(), applyBlockMatrix(), applyDiagonal_CSR_OFFSET0(), copyFromMainDiagonal(), copyToMainDiagonal(), getBlock(), getSubmatrix(), getTotalNumRows(), getTranspose(), invMain(), maxAbsRow_CSR_OFFSET0(), nullifyRows_CSR(), nullifyRowsAndCols_CSC(), nullifyRowsAndCols_CSR(), saveHB_CSC(), saveMM(), SparseMatrix(), and unroll().

## solver_p

void* paso::SparseMatrix::solver_p

pointer to data needed by a solver

Referenced by paso::MKL_free(), paso::UMFPACK_free(), and ~SparseMatrix().

## solver_package

index_t paso::SparseMatrix::solver_package

package controlling the solver pointer

Referenced by paso::MKL_free(), and ~SparseMatrix().

## type

SparseMatrixType paso::SparseMatrix::type

Referenced by getBlock(), getSubmatrix(), getTranspose(), nullifyRows_CSR(), nullifyRows_CSR_BLK1(), nullifyRowsAndCols_CSC(), nullifyRowsAndCols_CSC_BLK1(), nullifyRowsAndCols_CSR(), nullifyRowsAndCols_CSR_BLK1(), saveHB_CSC(), saveMM(), setValues(), and unroll().

## val

double* paso::SparseMatrix::val

this is used for classical CSR or CSC

Referenced by addAbsRow_CSR_OFFSET0(), addRow_CSR_OFFSET0(), applyDiagonal_CSR_OFFSET0(), copyBlockFromMainDiagonal(), copyBlockToMainDiagonal(), copyFromMainDiagonal(), copyToMainDiagonal(), getBlock(), getSubmatrix(), getTranspose(), invMain(), loadMM_toCSR(), maxAbsRow_CSR_OFFSET0(), paso::MKL_free(), nullifyRows_CSR(), nullifyRows_CSR_BLK1(), nullifyRowsAndCols_CSC(), nullifyRowsAndCols_CSC_BLK1(), nullifyRowsAndCols_CSR(), nullifyRowsAndCols_CSR_BLK1(), saveHB_CSC(), saveMM(), setValues(), SparseMatrix(), unroll(), and ~SparseMatrix().

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

- SparseMatrix.h
- SparseMatrix.cpp
- SparseMatrix_getSubmatrix.cpp
- SparseMatrix_nullifyRowsAndCols.cpp
- SparseMatrix_saveHB.cpp