Line data Source code
1 : #pragma once 2 : 3 : #include "LinearOperator.h" 4 : 5 : namespace elsa 6 : { 7 : /** 8 : * @brief Operator that returns empty container filled with 0. 9 : * 10 : * @tparam data_t data type for the domain and range of the operator, defaulting to real_t 11 : * 12 : */ 13 : template <typename data_t = real_t> 14 : class ZeroOperator : public LinearOperator<data_t> 15 : { 16 : public: 17 : explicit ZeroOperator(const DataDescriptor& domainDescriptor, 18 : const DataDescriptor& rangeDescriptor); 19 : 20 14 : ~ZeroOperator() override = default; 21 : 22 : protected: 23 : /// default copy constructor, hidden from non-derived classes to prevent potential slicing 24 : ZeroOperator(const ZeroOperator<data_t>&) = default; 25 : 26 : void applyImpl(const DataContainer<data_t>& x, DataContainer<data_t>& Ax) const override; 27 : 28 : void applyAdjointImpl(const DataContainer<data_t>& y, 29 : DataContainer<data_t>& Aty) const override; 30 : 31 : /// implement the polymorphic clone operation 32 : ZeroOperator<data_t>* cloneImpl() const override; 33 : 34 : /// implement the polymorphic comparison operation 35 : bool isEqual(const LinearOperator<data_t>& other) const override; 36 : }; 37 : } // namespace elsa