Linear Solvers#

Intel MKL Pardiso#

Warning

doxygenclass: Cannot find class “mocca::mkl::MatrixTypes” in doxygen xml output for project “mocca” from directory: doxygen/xml/

template<typename T>
class PardisoSolver : public mocca::internal::Solver<PardisoSolver<T>>#

A sparse direct factorization and solver from the Intel MKL PARDISO library.

This class solve a sparse linear system \( \mathbb{A} \vec{x} = \vec{b}\) via direct LLT (symmetric positive definite), LDLT (symmetric undefinite), QLUT (structurally symmetric) or QLUR (asymmetric) factorization using the Intel MKL PARDISO library. See https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2023-2/onemkl-pardiso-parallel-direct-sparse-solver-iface.html for more information.

Note

This solver is only available when using the Intel MKL (i.e., MOCCA_BLAS=MKL). Not all parameter options are supported.

Warning

This solver only supports CSRMatrix. The template parameter T corresponds to the element type of the matrix.

Public Functions

inline PardisoSolver()#

Default constructor. Initialize the parameters of the solver to their default values.

inline PardisoSolver(CSRMatrix<T> &mat, param_t type)#

Constructs a new solver and sets the coefficient matrix. Immediately after, this routine will analyze and factorize the matrix.

Parameters:
  • mat[in] coefficient matrix

  • type[in] type of coefficient matrix. See mkl::MatrixType for all the options.

inline virtual ~PardisoSolver()#

Destructor. Free the internal allocated resources.

inline std::array<param_t, 64> &param()#
Returns:

a reference to the parameters of the solver.

inline index_t rows() const#
Returns:

the number of rows of the underlying matrix

inline index_t cols() const#
Returns:

the number of columns of the underlying matrix

inline void set_matrix(CSRMatrix<T> &mat, param_t type)#

Sets the coefficient matrix and then right after analyzes and factorizes the matrix.

Parameters:
  • mat[in] coefficient matrix

  • type[in] type of coefficient matrix. See mkl::MatrixType for all the options.

template<internal::TypeLayout L>
inline evaluator<L> solve(CSRMatrix<T> &A, param_t type, const Vector<T, L> &b)#

Solve the sparse linear system \( \mathbb{A} \vec{x} = \vec{b}\).

Parameters:
  • A[in] coefficient matrix

  • type[in] type of coefficient matrix. See mkl::MatrixType for all the options.

  • b[in] right hand side

template<internal::TypeLayout L>
inline evaluator<L> solve(const Vector<T, L> &b)#

Solve the sparse linear system \( \mathbb{A} \vec{x} = \vec{b}\).

Note

You must first set the coefficient matrix before calling this method using either the constructor or the set_matrix() method.

Parameters:

b[in] right hand side

inline void free()#

Free all the internal resources allocated by the solver.