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

          Line data    Source code
       1             : #include "MixedL21Norm.h"
       2             : #include "FiniteDifferences.h"
       3             : #include "ProximalMixedL21Norm.h"
       4             : #include "BlockDescriptor.h"
       5             : 
       6             : namespace elsa
       7             : {
       8             :     template <typename data_t>
       9             :     MixedL21Norm<data_t>::MixedL21Norm(const DataDescriptor& domainDescriptor)
      10             :         : Functional<data_t>(domainDescriptor)
      11           8 :     {
      12           8 :     }
      13             : 
      14             :     template <typename data_t>
      15             :     data_t MixedL21Norm<data_t>::evaluateImpl(const DataContainer<data_t>& Rx) const
      16           2 :     {
      17           2 :         return Rx.l21MixedNorm();
      18           2 :     }
      19             : 
      20             :     template <typename data_t>
      21             :     bool MixedL21Norm<data_t>::isProxFriendly() const
      22           0 :     {
      23           0 :         return true;
      24           0 :     }
      25             : 
      26             :     template <typename data_t>
      27             :     DataContainer<data_t> MixedL21Norm<data_t>::proximal(const DataContainer<data_t>& v,
      28             :                                                          SelfType_t<data_t> t) const
      29           0 :     {
      30           0 :         DataContainer<data_t> out(v.getDataDescriptor());
      31           0 :         proximal(v, t, out);
      32           0 :         return out;
      33           0 :     }
      34             : 
      35             :     template <typename data_t>
      36             :     void MixedL21Norm<data_t>::proximal(const DataContainer<data_t>& v, SelfType_t<data_t> t,
      37             :                                         DataContainer<data_t>& out) const
      38           0 :     {
      39           0 :         ProximalMixedL21Norm<data_t> prox;
      40           0 :         prox.apply(v, t, out);
      41           0 :     }
      42             : 
      43             :     template <typename data_t>
      44             :     void MixedL21Norm<data_t>::getGradientImpl(const DataContainer<data_t>&,
      45             :                                                DataContainer<data_t>&) const
      46           2 :     {
      47           2 :         throw LogicError("MixedL21Norm: not differentiable, so no gradient! (busted!)");
      48           2 :     }
      49             :     template <typename data_t>
      50             :     LinearOperator<data_t> MixedL21Norm<data_t>::getHessianImpl(const DataContainer<data_t>&) const
      51           2 :     {
      52           2 :         throw LogicError("MixedL21Norm: not differentiable, so no hessian! (busted!)");
      53           2 :     }
      54             :     template <typename data_t>
      55             :     MixedL21Norm<data_t>* MixedL21Norm<data_t>::cloneImpl() const
      56           2 :     {
      57           2 :         return new MixedL21Norm(this->getDomainDescriptor());
      58           2 :     }
      59             :     template <typename data_t>
      60             :     bool MixedL21Norm<data_t>::isEqual(const Functional<data_t>& other) const
      61           2 :     {
      62           2 :         if (!Functional<data_t>::isEqual(other))
      63           0 :             return false;
      64             : 
      65           2 :         return is<MixedL21Norm>(other);
      66           2 :     }
      67             : 
      68             :     // ------------------------------------------
      69             :     // explicit template instantiation
      70             :     template class MixedL21Norm<float>;
      71             :     template class MixedL21Norm<double>;
      72             :     // template class MixedL21Norm<complex<float>>;
      73             :     // template class MixedL21Norm<complex<double>>;
      74             : 
      75             : } // namespace elsa

Generated by: LCOV version 1.14