Line data Source code
1 : #include "Identity.h" 2 : #include "Timer.h" 3 : #include "TypeCasts.hpp" 4 : 5 : namespace elsa 6 : { 7 : template <typename data_t> 8 0 : Identity<data_t>::Identity(const DataDescriptor& descriptor) 9 0 : : LinearOperator<data_t>(descriptor, descriptor) 10 : { 11 0 : } 12 : 13 : template <typename data_t> 14 0 : void Identity<data_t>::applyImpl(const DataContainer<data_t>& x, 15 : DataContainer<data_t>& Ax) const 16 : { 17 0 : Timer timeguard("Identity", "apply"); 18 0 : Ax = x; 19 0 : } 20 : 21 : template <typename data_t> 22 0 : void Identity<data_t>::applyAdjointImpl(const DataContainer<data_t>& y, 23 : DataContainer<data_t>& Aty) const 24 : { 25 0 : Timer timeguard("Identity", "applyAdjoint"); 26 0 : Aty = y; 27 0 : } 28 : 29 : template <typename data_t> 30 0 : Identity<data_t>* Identity<data_t>::cloneImpl() const 31 : { 32 0 : return new Identity(this->getDomainDescriptor()); 33 : } 34 : 35 : template <typename data_t> 36 0 : bool Identity<data_t>::isEqual(const LinearOperator<data_t>& other) const 37 : { 38 0 : if (!LinearOperator<data_t>::isEqual(other)) 39 0 : return false; 40 : 41 0 : return is<Identity>(other); 42 : } 43 : 44 : // ------------------------------------------ 45 : // explicit template instantiation 46 : template class Identity<float>; 47 : template class Identity<complex<float>>; 48 : template class Identity<double>; 49 : template class Identity<complex<double>>; 50 : 51 : } // namespace elsa