LCOV - code coverage report
Current view: top level - elsa/functionals - SmoothMixedL21Norm.h (source / functions) Hit Total Coverage
Test: coverage-all.lcov Lines: 1 1 100.0 %
Date: 2024-05-16 04:22:26 Functions: 2 4 50.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include "Functional.h"
       4             : 
       5             : namespace elsa
       6             : {
       7             :     /**
       8             :      * @brief Class representing the smooth mixed L12 functional.
       9             :      *
      10             :      * General p,q norm definition:
      11             :      * @f[
      12             :      * \|A\|_{p, q} = \left( \sum_{j=1}^n \left( \sum_{i=1}^m \left| a_{i j} \right|^p
      13             :      * \right)^{\frac{q}{p}} \right)^{\frac{1}{q}}
      14             :      * @f]
      15             :      *
      16             :      * The smooth mixed L21 functional evaluates to
      17             :      * @f[
      18             :      * \|A\|_{2,1} = \left( \sum_{j=1}^n \left( \sum_{i=1}^m \left| a_{ij} \right|^2 +
      19             :      * e^2\right)^{\frac{1}{2}} \right)
      20             :      * @f]
      21             :      *
      22             :      */
      23             :     template <typename data_t = real_t>
      24             :     class SmoothMixedL21Norm : public Functional<data_t>
      25             :     {
      26             :     public:
      27             :         explicit SmoothMixedL21Norm(const DataDescriptor& domainDescriptor, data_t epsilon);
      28             : 
      29             :         SmoothMixedL21Norm(const SmoothMixedL21Norm<data_t>&) = delete;
      30             : 
      31           8 :         ~SmoothMixedL21Norm() override = default;
      32             : 
      33             :     protected:
      34             :         data_t evaluateImpl(const DataContainer<data_t>& Rx) const override;
      35             : 
      36             :         void getGradientImpl(const DataContainer<data_t>& Rx,
      37             :                              DataContainer<data_t>& out) const override;
      38             : 
      39             :         LinearOperator<data_t> getHessianImpl(const DataContainer<data_t>& Rx) const override;
      40             : 
      41             :         SmoothMixedL21Norm<data_t>* cloneImpl() const override;
      42             : 
      43             :         bool isEqual(const Functional<data_t>& other) const override;
      44             : 
      45             :     private:
      46             :         data_t epsilon;
      47             :     };
      48             : 
      49             : } // namespace elsa

Generated by: LCOV version 1.14