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 : Identity<data_t>::Identity(const DataDescriptor& descriptor) 9 : : LinearOperator<data_t>(descriptor, descriptor) 10 3279 : { 11 3279 : } 12 : 13 : template <typename data_t> 14 : void Identity<data_t>::applyImpl(const DataContainer<data_t>& x, 15 : DataContainer<data_t>& Ax) const 16 3292 : { 17 3292 : Timer timeguard("Identity", "apply"); 18 3292 : Ax = x; 19 3292 : } 20 : 21 : template <typename data_t> 22 : void Identity<data_t>::applyAdjointImpl(const DataContainer<data_t>& y, 23 : DataContainer<data_t>& Aty) const 24 1804 : { 25 1804 : Timer timeguard("Identity", "applyAdjoint"); 26 1804 : Aty = y; 27 1804 : } 28 : 29 : template <typename data_t> 30 : Identity<data_t>* Identity<data_t>::cloneImpl() const 31 2888 : { 32 2888 : return new Identity(this->getDomainDescriptor()); 33 2888 : } 34 : 35 : template <typename data_t> 36 : bool Identity<data_t>::isEqual(const LinearOperator<data_t>& other) const 37 158 : { 38 158 : if (!LinearOperator<data_t>::isEqual(other)) 39 0 : return false; 40 : 41 158 : return is<Identity>(other); 42 158 : } 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