Line data Source code
1 : #pragma once 2 : 3 : #include "WLSProblem.h" 4 : 5 : namespace elsa 6 : { 7 : /** 8 : * @brief Class representing a Tikhonov regularized weighted least squares problem 9 : * 10 : * @author Nikola Dinev 11 : * 12 : * @tparam data_t data type for the domain and range of the problem, defaulting to real_t 13 : * 14 : * This class represents a Tikhonov regularized weighted least squares problem. 15 : * Some common examples are: 16 : * - \f$ \argmin_x \frac{1}{2} \| Ax - b \|_2^2 + \lambda \| x \|_2^2 \f$ 17 : * - \f$ \argmin_x \frac{1}{2} \| Ax - b \|_2^2 + \lambda \| x - x^* \|_2^2 \f$ 18 : * - \f$ \argmin_x \frac{1}{2} \| Ax - b \|_2^2 + \lambda \| Lx \|_2^2 \f$ 19 : * - \f$ \argmin_x \frac{1}{2} \| Ax - b \|_2^2 + \lambda \| L(x - x^*) \|_2^2 \f$, 20 : * where \f$ A \f$ is a linear operator and \f$ b \f$ and \f$ x^* \f$ are data vectors, 21 : * \f$ \lambda \f$ is the regularization weight, and \f$ L \f$ is a discretized differential 22 : * operator. 23 : * 24 : * This class supports a wider range of problems - any problem of the form 25 : * \f$ \argmin_x \frac{1}{2} \| Ax - b \|_{W,2}^2 + \sum_{i=1}^n \lambda_i \| B_ix - x^*_i 26 : * \|_{V_i,2}^2 \f$ is considered a Tikhonov problem. Here \f$ A \f$ and \f$ B_i \f$ are linear 27 : * operators, \f$ b \f$ and \f$ x^*_i \f$ are data vectors, \f$ \lambda_i \f$ are the 28 : * regularization weights, and \f$ W \f$ and \f$ V_i \f$ are scaling operators. 29 : */ 30 : template <typename data_t = real_t> 31 : class TikhonovProblem : public Problem<data_t> 32 : { 33 : public: 34 : /** 35 : * @brief Construct a Tikhonov problem of the form 36 : * \f$ \argmin_x \frac{1}{2} \| Ax - b \|_2^2 + \lambda \| x \|_2^2 \f$ 37 : * 38 : * @param[in] A a linear operator 39 : * @param[in] b a data vector 40 : * @param[in] lambda regularization weight 41 : */ 42 : TikhonovProblem(const LinearOperator<data_t>& A, const DataContainer<data_t> b, 43 : real_t lambda = 0.5f); 44 : 45 : /** 46 : * @brief Constructor for a Tikhonov problem 47 : * 48 : * @param[in] wlsProblem a wls problem specifying the data term and the initial solution 49 : * @param[in] regTerms the regularization terms, all should be of type L2NormPow2 or 50 : * WeightedL2NormPow2 51 : */ 52 : TikhonovProblem(const WLSProblem<data_t>& wlsProblem, 53 : const std::vector<RegularizationTerm<data_t>>& regTerms); 54 : 55 : /** 56 : * @brief Constructor for a Tikhonov problem 57 : * 58 : * @param[in] wlsProblem a wls problem specifying the data term and the initial solution 59 : * @param[in] regTerm the regularization term, should be of type L2NormPow2 or 60 : * WeightedL2NormPow2 61 : */ 62 : TikhonovProblem(const WLSProblem<data_t>& wlsProblem, 63 : const RegularizationTerm<data_t>& regTerm); 64 : 65 : /// default destructor 66 34 : ~TikhonovProblem() override = default; 67 : 68 : protected: 69 : /// default copy constructor, hidden from non-derived classes to prevent potential slicing 70 8 : TikhonovProblem(const TikhonovProblem<data_t>&) = default; 71 : 72 : /// implement the polymorphic clone operation 73 : TikhonovProblem<data_t>* cloneImpl() const override; 74 : 75 : private: 76 : /// lift from base class 77 : using Problem<data_t>::_regTerms; 78 : }; 79 : } // namespace elsa