gko::experimental::factorization::
Cholesky#
Sparse Cholesky factorisation for symmetric positive-definite systems.
Computes the lower-triangular factor \(L\) such that \(A = L L^H\) and
returns it as a Factorization in CSR format. Requires the symbolic
sparsity pattern to include every fill-in entry — if you only have the
pattern of \(A\) itself, use Ic (IC(0)) instead.
Lives in the experimental namespace pending API stabilisation.
-
template<typename ValueType, typename IndexType>
class Cholesky # Inherits from
public gko::EnablePolymorphicObject<Cholesky<ValueType, IndexType>, LinOpFactory>
public gko::EnablePolymorphicAssignment<Cholesky<ValueType, IndexType>>
Computes a Cholesky factorization of a symmetric, positive-definite sparse matrix. This LinOpFactory returns a Factorization storing the L and L^H 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 Ic.
- 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::shared_ptr<const LinOp> system_matrix,
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 gko::enable_parameters_type<parameters_type, Cholesky>
Public Members
-
std::shared_ptr<const sparsity_pattern_type> symbolic_factorization#
The combined sparsity pattern L + L^H of the factors L and L^H. 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.
-
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 totrueto skip the sorting (therefore, shortening the runtime). However, if it is unknown or if the matrix is known to be not sorted, it must remainfalse, otherwise, the algorithm may produce incorrect results or crash.