gko::experimental::factorization::Lu#

Sparse LU factorisation for general systems. Computes \(L\) and \(U\) such that \(A = L U\) and returns them as a Factorization in CSR format. Requires the symbolic pattern to include every fill-in entry — for the no-fill ILU(0) variant use Ilu.

Lives in the experimental namespace pending API stabilisation.

template<typename ValueType, typename IndexType>
class Lu #

Inherits from

Computes an LU factorization of a sparse matrix. This LinOpFactory returns a Factorization storing the L and U factors for the provided system matrix in matrix::Csr format. If no symbolic factorization is provided, it will be computed first. It expects all fill-in entries to be present in the symbolic factorization. If the symbolic factorization is missing some entries, please refer to Ilu.

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

inline const parameters_type &get_parameters()#

Returns the parameters used to construct the factory.

Returns:

the parameters used to construct the factory.

inline const parameters_type &get_parameters() const#

Returns the parameters used to construct the factory.

Returns:

the parameters used to construct the factory.

std::unique_ptr<factorization_type> generate(
std::shared_ptr<const LinOp> system_matrix,
) const#

Creates a new product from the given components.

The method will create an ComponentsType object from the arguments of this method, and pass it to the generate_impl() function which will create a new AbstractProductType.

Note

This function overrides the default LinOpFactory::generate to return a Factorization instead of a generic LinOp, which would need to be cast to Factorization again to access its factors. It is only necessary because smart pointers aren’t covariant.

Template Parameters:

Args – types of arguments passed to the constructor of ComponentsType

Parameters:

args – arguments passed to the constructor of ComponentsType

Returns:

an instance of AbstractProductType

Public Static Functions

static inline parameters_type build()#

Creates a new parameter_type to set up the factory.

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

std::shared_ptr<const sparsity_pattern_type> symbolic_factorization#

The combined sparsity pattern L + U of the factors L and U. It can be used to avoid the potentially costly symbolic factorization of the system matrix if its symbolic factorization is already known. If it is set to nullptr, the symbolic factorization will be computed.

Note

Currently, the symbolic factorization needs to be provided if the system matrix does not have a symmetric sparsity pattern.

symbolic_type symbolic_algorithm#

If the symbolic factorization of the matrix is not provided to the factory, this parameter controls which algorithm will be used to compute it.

Note

Only use symbolic_factorization_algorithm::symmetric if you are sure your matrix has a symmetric sparsity pattern!

bool skip_sorting#

The system_matrix, which will be given to this factory, must be sorted (first by row, then by column) in order for the algorithm to work. If it is known that the matrix will be sorted, this parameter can be set to true to skip the sorting (therefore, shortening the runtime). However, if it is unknown or if the matrix is known to be not sorted, it must remain false, otherwise, the algorithm may produce incorrect results or crash.