Line data Source code
1 : #include "RegularizationTerm.h" 2 : #include "L1Norm.h" 3 : 4 : namespace elsa 5 : { 6 : template <typename data_t> 7 0 : RegularizationTerm<data_t>::RegularizationTerm(data_t weight, 8 : const Functional<data_t>& functional) 9 0 : : _weight{weight}, _functional{functional.clone()} 10 : { 11 0 : } 12 : 13 : template <typename data_t> 14 0 : RegularizationTerm<data_t>::RegularizationTerm(const RegularizationTerm<data_t>& other) 15 0 : : _weight{other._weight}, _functional{other._functional->clone()} 16 : { 17 0 : } 18 : 19 : template <typename data_t> 20 : RegularizationTerm<data_t>& 21 0 : RegularizationTerm<data_t>::operator=(const RegularizationTerm<data_t>& other) 22 : { 23 0 : if (this != &other) { 24 0 : _weight = other._weight; 25 0 : _functional = other._functional->clone(); 26 : } 27 : 28 0 : return *this; 29 : } 30 : 31 : template <typename data_t> 32 0 : RegularizationTerm<data_t>::RegularizationTerm(RegularizationTerm<data_t>&& other) noexcept 33 0 : : _weight{std::move(other._weight)}, _functional{std::move(other._functional)} 34 : { 35 0 : } 36 : 37 : template <typename data_t> 38 : RegularizationTerm<data_t>& 39 0 : RegularizationTerm<data_t>::operator=(RegularizationTerm<data_t>&& other) noexcept 40 : { 41 0 : _weight = std::move(other._weight); 42 0 : _functional = std::move(other._functional); 43 : 44 0 : return *this; 45 : } 46 : 47 : template <typename data_t> 48 0 : data_t RegularizationTerm<data_t>::getWeight() const 49 : { 50 0 : return _weight; 51 : } 52 : 53 : template <typename data_t> 54 0 : Functional<data_t>& RegularizationTerm<data_t>::getFunctional() const 55 : { 56 0 : return *_functional; 57 : } 58 : 59 : template <typename data_t> 60 0 : bool RegularizationTerm<data_t>::operator==(const RegularizationTerm<data_t>& other) const 61 : { 62 0 : return (_weight == other._weight && *_functional == *other._functional); 63 : } 64 : 65 : template <typename data_t> 66 0 : bool RegularizationTerm<data_t>::operator!=(const RegularizationTerm<data_t>& other) const 67 : { 68 0 : return !operator==(other); 69 : } 70 : 71 : // ------------------------------------------ 72 : // explicit template instantiation 73 : template class RegularizationTerm<float>; 74 : template class RegularizationTerm<double>; 75 : template class RegularizationTerm<complex<float>>; 76 : template class RegularizationTerm<complex<double>>; 77 : 78 : } // namespace elsa