LCOV - code coverage report
Current view: top level - elsa/functionals - Constraint.cpp (source / functions) Hit Total Coverage
Test: coverage-all.lcov Lines: 20 26 76.9 %
Date: 2024-05-16 04:22:26 Functions: 24 24 100.0 %

          Line data    Source code
       1             : #include "Constraint.h"
       2             : 
       3             : namespace elsa
       4             : {
       5             :     template <typename data_t>
       6             :     Constraint<data_t>::Constraint(const LinearOperator<data_t>& A, const LinearOperator<data_t>& B,
       7             :                                    const DataContainer<data_t>& c)
       8             :         : _A{A.clone()}, _B{B.clone()}, _c{c}
       9          12 :     {
      10          12 :     }
      11             : 
      12             :     template <typename data_t>
      13             :     auto Constraint<data_t>::getOperatorA() const -> const LinearOperator<data_t>&
      14           8 :     {
      15           8 :         return *_A;
      16           8 :     }
      17             : 
      18             :     template <typename data_t>
      19             :     auto Constraint<data_t>::getOperatorB() const -> const LinearOperator<data_t>&
      20           8 :     {
      21           8 :         return *_B;
      22           8 :     }
      23             : 
      24             :     template <typename data_t>
      25             :     auto Constraint<data_t>::getDataVectorC() const -> const DataContainer<data_t>&
      26           8 :     {
      27           8 :         return _c;
      28           8 :     }
      29             : 
      30             :     template <typename data_t>
      31             :     auto Constraint<data_t>::cloneImpl() const -> Constraint<data_t>*
      32           4 :     {
      33           4 :         return new Constraint<data_t>(*_A, *_B, _c);
      34           4 :     }
      35             : 
      36             :     template <typename data_t>
      37             :     auto Constraint<data_t>::isEqual(const Constraint<data_t>& other) const -> bool
      38           4 :     {
      39           4 :         if (other.getOperatorA() != *_A) {
      40           0 :             return false;
      41           0 :         }
      42             : 
      43           4 :         if (other.getOperatorB() != *_B) {
      44           0 :             return false;
      45           0 :         }
      46             : 
      47           4 :         if (other.getDataVectorC() != _c) {
      48           0 :             return false;
      49           0 :         }
      50             : 
      51           4 :         return true;
      52           4 :     }
      53             : 
      54             :     // ------------------------------------------
      55             :     // explicit template instantiation
      56             :     template class Constraint<float>;
      57             :     template class Constraint<complex<float>>;
      58             :     template class Constraint<double>;
      59             :     template class Constraint<complex<double>>;
      60             : } // namespace elsa

Generated by: LCOV version 1.14