Line data Source code
1 : #include "LInfNorm.h" 2 : #include "TypeCasts.hpp" 3 : 4 : #include <stdexcept> 5 : 6 : namespace elsa 7 : { 8 : template <typename data_t> 9 : LInfNorm<data_t>::LInfNorm(const DataDescriptor& domainDescriptor) 10 : : Functional<data_t>(domainDescriptor) 11 12 : { 12 12 : } 13 : 14 : template <typename data_t> 15 : LInfNorm<data_t>::LInfNorm(const Residual<data_t>& residual) : Functional<data_t>(residual) 16 20 : { 17 20 : } 18 : 19 : template <typename data_t> 20 : data_t LInfNorm<data_t>::evaluateImpl(const DataContainer<data_t>& Rx) 21 8 : { 22 8 : return Rx.lInfNorm(); 23 8 : } 24 : 25 : template <typename data_t> 26 : void LInfNorm<data_t>::getGradientInPlaceImpl([[maybe_unused]] DataContainer<data_t>& Rx) 27 8 : { 28 8 : throw LogicError("LInfNorm: not differentiable, so no gradient! (busted!)"); 29 8 : } 30 : 31 : template <typename data_t> 32 : LinearOperator<data_t> 33 : LInfNorm<data_t>::getHessianImpl([[maybe_unused]] const DataContainer<data_t>& Rx) 34 8 : { 35 8 : throw LogicError("LInfNorm: not differentiable, so no Hessian! (busted!)"); 36 8 : } 37 : 38 : template <typename data_t> 39 : LInfNorm<data_t>* LInfNorm<data_t>::cloneImpl() const 40 8 : { 41 8 : return new LInfNorm(this->getResidual()); 42 8 : } 43 : 44 : template <typename data_t> 45 : bool LInfNorm<data_t>::isEqual(const Functional<data_t>& other) const 46 8 : { 47 8 : if (!Functional<data_t>::isEqual(other)) 48 0 : return false; 49 : 50 8 : return is<LInfNorm>(other); 51 8 : } 52 : 53 : // ------------------------------------------ 54 : // explicit template instantiation 55 : template class LInfNorm<float>; 56 : template class LInfNorm<double>; 57 : template class LInfNorm<complex<float>>; 58 : template class LInfNorm<complex<double>>; 59 : 60 : } // namespace elsa