LCOV - code coverage report
Current view: top level - elsa/solvers - Landweber.cpp (source / functions) Hit Total Coverage
Test: coverage-all.lcov Lines: 16 22 72.7 %
Date: 2024-05-16 04:22:26 Functions: 8 10 80.0 %

          Line data    Source code
       1             : #include "Landweber.h"
       2             : #include "Scaling.h"
       3             : #include "elsaDefines.h"
       4             : 
       5             : namespace elsa
       6             : {
       7             :     template <typename data_t>
       8             :     Landweber<data_t>::Landweber(const LinearOperator<data_t>& A, const DataContainer<data_t>& b,
       9             :                                  SelfType_t<data_t> stepSize)
      10             :         : LandweberIteration<data_t>(A, b, stepSize)
      11           4 :     {
      12           4 :         this->name_ = "Landweber";
      13           4 :     }
      14             : 
      15             :     template <typename data_t>
      16             :     Landweber<data_t>::Landweber(const LinearOperator<data_t>& A, const DataContainer<data_t>& b)
      17             :         : LandweberIteration<data_t>(A, b)
      18           0 :     {
      19           0 :         this->name_ = "Landweber";
      20           0 :     }
      21             : 
      22             :     template <class data_t>
      23             :     std::unique_ptr<LinearOperator<data_t>>
      24             :         Landweber<data_t>::setupOperators(const LinearOperator<data_t>& A) const
      25           2 :     {
      26           2 :         return adjoint(A).clone();
      27           2 :     }
      28             : 
      29             :     template <typename data_t>
      30             :     bool Landweber<data_t>::isEqual(const Solver<data_t>& other) const
      31           2 :     {
      32           2 :         if (!LandweberIteration<data_t>::isEqual(other))
      33           0 :             return false;
      34             : 
      35           2 :         auto otherSolver = downcast_safe<Landweber<data_t>>(&other);
      36           2 :         return static_cast<bool>(otherSolver);
      37           2 :     }
      38             : 
      39             :     template <typename data_t>
      40             :     Landweber<data_t>* Landweber<data_t>::cloneImpl() const
      41           2 :     {
      42           2 :         if (this->stepSize_.isInitialized()) {
      43           2 :             return new Landweber(*this->A_, this->b_, *this->stepSize_);
      44           2 :         } else {
      45           0 :             return new Landweber(*this->A_, this->b_);
      46           0 :         }
      47           2 :     }
      48             : 
      49             :     // ------------------------------------------
      50             :     // explicit template instantiation
      51             :     template class Landweber<float>;
      52             :     template class Landweber<double>;
      53             : } // namespace elsa

Generated by: LCOV version 1.14