gko::experimental::solver::
Direct#

Direct solver built from a sparse \(LU\) or Cholesky factorisation supplied by a Factorization factory. The factorisation is computed once during generate() and reused across every apply(); each apply runs a forward solve on the lower factor (\(L\)) followed by a backward solve on the upper factor (\(U\) for \(LU\), \(L^H\) for Cholesky).

The factorisation factory is provided as the factorization factory parameter, typically a built-in factorisation (Cholesky, Lu) or a user-supplied one. The native Ginkgo triangular solvers (LowerTrs, UpperTrs) handle the substitutions. The num_rhs factory parameter (default 1) sizes the CUDA triangular-solve setup; on CUDA, apply with a different number of right-hand sides throws. The factorisation and substitution kernels run on the Reference, OpenMP, CUDA and HIP executors.

For an introduction to direct solvers in Ginkgo, see the direct solver concept page.

template<typename ValueType, typename IndexType>
class Direct #

Inherits from

A direct solver based on a factorization into lower and upper triangular factors (with an optional diagonal scaling). The solver is built from the Factorization returned by the provided LinOpFactory.

Template Parameters:
  • ValueType – the type used to store values of the system matrix

  • IndexType – the type used to store sparsity pattern indices of the system matrix

Public Functions

virtual std::unique_ptr<LinOp> transpose() const override#

Returns a LinOp representing the transpose of the Transposable object.

Returns:

a pointer to the new transposed object

virtual std::unique_ptr<LinOp> conj_transpose() const override#

Returns a LinOp representing the conjugate transpose of the Transposable object.

Returns:

a pointer to the new conjugate transposed object

Direct(const Direct&)#

Creates a copy of the solver.

Direct(Direct&&)#

Moves from the given solver, leaving it empty.

Public Static Functions

static parameters_type parse(
const config::pnode &config,
const config::registry &context,
const config::type_descriptor &td_for_child = config::make_type_descriptor<ValueType, IndexType>(),
)#

Create the parameters from the property_tree. Because this is directly tied to the specific type, the value/index type settings within config are ignored and type_descriptor is only used for children configs.

Parameters:
  • config – the property tree for setting

  • context – the registry

  • td_for_child – the type descriptor for children configs. The default uses the value/index type of this class.

Returns:

parameters

struct parameters_type #

Inherits from

Public Members

gko::size_type num_rhs#

Number of right hand sides.

Note

This value is currently only required for the CUDA executor, which will throw an exception if a different number of rhs is passed to Direct::apply.

std::shared_ptr<const LinOpFactory> factorization#

The factorization factory to use for generating the factors.