LCOV - code coverage report
Current view: top level - elsa/operators - Identity.cpp (source / functions) Hit Total Coverage
Test: coverage-all.lcov Lines: 17 18 94.4 %
Date: 2024-05-15 03:55:36 Functions: 20 20 100.0 %

          Line data    Source code
       1             : #include "Identity.h"
       2             : #include "Timer.h"
       3             : #include "TypeCasts.hpp"
       4             : 
       5             : namespace elsa
       6             : {
       7             :     template <typename data_t>
       8             :     Identity<data_t>::Identity(const DataDescriptor& descriptor)
       9             :         : LinearOperator<data_t>(descriptor, descriptor)
      10        1834 :     {
      11        1834 :     }
      12             : 
      13             :     template <typename data_t>
      14             :     void Identity<data_t>::applyImpl(const DataContainer<data_t>& x,
      15             :                                      DataContainer<data_t>& Ax) const
      16        2530 :     {
      17        2530 :         Timer timeguard("Identity", "apply");
      18        2530 :         Ax = x;
      19        2530 :     }
      20             : 
      21             :     template <typename data_t>
      22             :     void Identity<data_t>::applyAdjointImpl(const DataContainer<data_t>& y,
      23             :                                             DataContainer<data_t>& Aty) const
      24        1782 :     {
      25        1782 :         Timer timeguard("Identity", "applyAdjoint");
      26        1782 :         Aty = y;
      27        1782 :     }
      28             : 
      29             :     template <typename data_t>
      30             :     Identity<data_t>* Identity<data_t>::cloneImpl() const
      31        1586 :     {
      32        1586 :         return new Identity(this->getDomainDescriptor());
      33        1586 :     }
      34             : 
      35             :     template <typename data_t>
      36             :     bool Identity<data_t>::isEqual(const LinearOperator<data_t>& other) const
      37         136 :     {
      38         136 :         if (!LinearOperator<data_t>::isEqual(other))
      39           0 :             return false;
      40             : 
      41         136 :         return is<Identity>(other);
      42         136 :     }
      43             : 
      44             :     // ------------------------------------------
      45             :     // explicit template instantiation
      46             :     template class Identity<float>;
      47             :     template class Identity<complex<float>>;
      48             :     template class Identity<double>;
      49             :     template class Identity<complex<double>>;
      50             : 
      51             : } // namespace elsa

Generated by: LCOV version 1.14