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 0 : LInfNorm<data_t>::LInfNorm(const DataDescriptor& domainDescriptor) 10 0 : : Functional<data_t>(domainDescriptor) 11 : { 12 0 : } 13 : 14 : template <typename data_t> 15 0 : LInfNorm<data_t>::LInfNorm(const Residual<data_t>& residual) : Functional<data_t>(residual) 16 : { 17 0 : } 18 : 19 : template <typename data_t> 20 0 : data_t LInfNorm<data_t>::evaluateImpl(const DataContainer<data_t>& Rx) 21 : { 22 0 : return Rx.lInfNorm(); 23 : } 24 : 25 : template <typename data_t> 26 0 : void LInfNorm<data_t>::getGradientInPlaceImpl([[maybe_unused]] DataContainer<data_t>& Rx) 27 : { 28 0 : throw LogicError("LInfNorm: not differentiable, so no gradient! (busted!)"); 29 : } 30 : 31 : template <typename data_t> 32 : LinearOperator<data_t> 33 0 : LInfNorm<data_t>::getHessianImpl([[maybe_unused]] const DataContainer<data_t>& Rx) 34 : { 35 0 : throw LogicError("LInfNorm: not differentiable, so no Hessian! (busted!)"); 36 : } 37 : 38 : template <typename data_t> 39 0 : LInfNorm<data_t>* LInfNorm<data_t>::cloneImpl() const 40 : { 41 0 : return new LInfNorm(this->getResidual()); 42 : } 43 : 44 : template <typename data_t> 45 0 : bool LInfNorm<data_t>::isEqual(const Functional<data_t>& other) const 46 : { 47 0 : if (!Functional<data_t>::isEqual(other)) 48 0 : return false; 49 : 50 0 : return is<LInfNorm>(other); 51 : } 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