LCOV - code coverage report
Current view: top level - elsa/functionals - L0PseudoNorm.cpp (source / functions) Hit Total Coverage
Test: coverage-all.lcov Lines: 18 19 94.7 %
Date: 2024-05-16 04:22:26 Functions: 12 24 50.0 %

          Line data    Source code
       1             : #include "L0PseudoNorm.h"
       2             : #include "DataContainer.h"
       3             : #include "TypeCasts.hpp"
       4             : 
       5             : namespace elsa
       6             : {
       7             :     template <typename data_t>
       8             :     L0PseudoNorm<data_t>::L0PseudoNorm(const DataDescriptor& domainDescriptor)
       9             :         : Functional<data_t>(domainDescriptor)
      10           8 :     {
      11           8 :     }
      12             : 
      13             :     template <typename data_t>
      14             :     data_t L0PseudoNorm<data_t>::evaluateImpl(const DataContainer<data_t>& Rx) const
      15           2 :     {
      16           2 :         return static_cast<data_t>(Rx.l0PseudoNorm());
      17           2 :     }
      18             : 
      19             :     template <typename data_t>
      20             :     void L0PseudoNorm<data_t>::getGradientImpl(const DataContainer<data_t>&,
      21             :                                                DataContainer<data_t>&) const
      22           2 :     {
      23           2 :         throw std::logic_error("L0PseudoNorm: not differentiable, so no gradient! (busted!)");
      24           2 :     }
      25             : 
      26             :     template <typename data_t>
      27             :     LinearOperator<data_t> L0PseudoNorm<data_t>::getHessianImpl(const DataContainer<data_t>&) const
      28           2 :     {
      29           2 :         throw std::logic_error("L0PseudoNorm: not differentiable, so no Hessian! (busted!)");
      30           2 :     }
      31             : 
      32             :     template <typename data_t>
      33             :     L0PseudoNorm<data_t>* L0PseudoNorm<data_t>::cloneImpl() const
      34           2 :     {
      35           2 :         return new L0PseudoNorm(this->getDomainDescriptor());
      36           2 :     }
      37             : 
      38             :     template <typename data_t>
      39             :     bool L0PseudoNorm<data_t>::isEqual(const Functional<data_t>& other) const
      40           2 :     {
      41           2 :         if (!Functional<data_t>::isEqual(other))
      42           0 :             return false;
      43             : 
      44           2 :         return is<L0PseudoNorm>(other);
      45           2 :     }
      46             : 
      47             :     // ------------------------------------------
      48             :     // explicit template instantiation
      49             :     template class L0PseudoNorm<float>;
      50             :     template class L0PseudoNorm<double>;
      51             :     template class L0PseudoNorm<complex<float>>;
      52             :     template class L0PseudoNorm<complex<double>>;
      53             : } // namespace elsa

Generated by: LCOV version 1.14