Skip to content

Const correctness in iterative solvers

Nils-Arne Dreier requested to merge const_correctness_in_iterative_solvers into master

The constructors of IterativeSolvers took std::shared_ptr<LinearOperator<X,Y>> and std::shared_ptr<ScalarProduct<X>> as arguments, where the const version actually should suffice, since the corresponding methods are marked as const.

This MR changes the arguments to std::shared_ptr<const LinearOperator<X,Y>> and std::shared_ptr<const ScalarProduct<X>> and adapts the SolverFactory such that solvers can be created from a const operator.

This is a change of the interface but should not lead to problems due to the implicit conversion of std::shared_ptr<T> to std::shared_ptr<const T>.

Edited by Nils-Arne Dreier

Merge request reports

Loading