Line data Source code
1 : #pragma once 2 : 3 : #include "SubsetProblem.h" 4 : #include "Scaling.h" 5 : #include "LinearResidual.h" 6 : #include "WLSProblem.h" 7 : 8 : namespace elsa 9 : { 10 : /** 11 : * @brief Class representing a WSL Problem that can be split into subsets. 12 : * 13 : * @author Michael Loipführer - initial code 14 : * 15 : * @tparam data_t data type for the domain and range of the problem, defaulting to real_t 16 : * 17 : * This class represents a WSL problem that can be split into smaller, ordered subsets for use 18 : * in ordered subset solvers like SQS. 19 : */ 20 : template <typename data_t = real_t> 21 : class WLSSubsetProblem : public SubsetProblem<data_t> 22 : { 23 : public: 24 : /** 25 : * @brief Constructor for a subset problem 26 : * 27 : * @param[in] A the full system matrix of the whole WSL problem 28 : * @param[in] b data vector 29 : * @param[in] subsetAs the system matrices corresponding to each subset 30 : * each subset 31 : */ 32 : WLSSubsetProblem(const LinearOperator<data_t>& A, const DataContainer<data_t>& b, 33 : const std::vector<std::unique_ptr<LinearOperator<data_t>>>& subsetAs); 34 : 35 : /// default destructor 36 6 : ~WLSSubsetProblem() override = default; 37 : 38 : protected: 39 : /// default copy constructor for cloning 40 4 : WLSSubsetProblem<data_t>(const WLSSubsetProblem<data_t>&) = default; 41 : 42 : /// implement the polymorphic clone operation 43 : WLSSubsetProblem<data_t>* cloneImpl() const override; 44 : 45 : private: 46 : /// converts a list of of operators corresponding to subsets and a data term with a 47 : /// BlockDescriptor to a list of WLSProblems 48 : static std::unique_ptr<std::vector<std::unique_ptr<Problem<data_t>>>> 49 : wlsProblemsFromOperators( 50 : const std::vector<std::unique_ptr<LinearOperator<data_t>>>& subsetAs, 51 : const DataContainer<data_t>& b); 52 : }; 53 : } // namespace elsa