Const correctness in iterative solvers
The constructors of IterativeSolver
s 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>
.
Merge request reports
Activity
added 1 commit
- 8a207add - make the linear operator and scalarproduct in iterative solver const
added 1 commit
- 04198859 - make the linear operator and scalarproduct in iterative solver const
- Resolved by Nils-Arne Dreier
This needs a changelog entry, doesn't it?
added 1 commit
- 3140383a - add changelog entry for const correctness in `IterativeSolver`
mentioned in merge request !422
- Resolved by Nils-Arne Dreier
There is one tiny thing I'm a bit concerned about.
- you changed the signature of the factory
- does this still work with user-defined solvers, where the constructor takes a mutable
shared_ptr
?
Perhaps we should add a small test, where we add a user-defined solver!?
I guess we need to compare benefits vs. costs. How many user defined solvers are there that use the factory (the problem only is there, right?)? Should be few and they might have cursed missing constness before.
Maybe we can make a prominent entry in the changelog about it and break compatibility this time
mentioned in merge request !453 (merged)
added 85 commits
-
3a8ec4bd...0da65674 - 84 commits from branch
master
- 1c8084b7 - add const qualifier to LinearOperator and ScalarProduct in Iterative solvers.
-
3a8ec4bd...0da65674 - 84 commits from branch
imho this is OK to merge. @markus.blatt further objections?
mentioned in commit 90236d45