gko::experimental::reorder::
ScaledReordered#

Composition wrapper: takes a system matrix \(A\), a permutation \(P\), and an optional diagonal scaling, and presents the solver with the reordered/rescaled system \(\hat A = D_r P A P^T D_c\) while the application code sees the original. Apply / solve calls map back and forth transparently — useful for “reorder once, solve many times” workflows.

template<typename ValueType = default_precision, typename IndexType = int32>
class ScaledReordered #

Inherits from

Provides an interface to wrap reorderings like Rcm and diagonal scaling like equilibration around a LinOp like e.g. a sparse direct solver.

Reorderings can be useful for reducing fill-in in the numerical factorization phase of direct solvers, diagonal scaling can help improve the numerical stability by reducing the condition number of the system matrix.

With a permutation matrix P, a row scaling R and a column scaling C, the inner operator is applied to the system matrix P*R*A*C*P^T instead of A. Instead of A*x = b, the inner operator attempts to solve the equivalent linear system P*R*A*C*P^T*y = P*R*b and retrieves the solution x = C*P^T*y. Note: The inner system matrix is computed from a clone of A, so the original system matrix is not changed.

Template Parameters:
  • ValueType – Type of the values of all matrices used in this class

  • IndexType – Type of the indices of all matrices used in this class

struct parameters_type#

Public Members

std::shared_ptr<const LinOpFactory> inner_operator#

The inner operator factory that is to be generated on the scaled and reordered system matrix.

std::shared_ptr<const ReorderingBaseFactory> reordering#

The reordering that is to be applied to the system matrix. If a reordering is provided, the system matrix must be of type Permutable<IndexType>.

std::shared_ptr<const matrix::Diagonal<value_type>> row_scaling#

The row scaling that is to be applied to the system matrix.

std::shared_ptr<const matrix::Diagonal<value_type>> col_scaling#

The column scaling that is to be applied to the system matrix.