00001 /* @HEADER@ */ 00002 // 00003 /* @HEADER@ */ 00004 00005 #ifndef PLAYA_SIMPLE_ZERO_OP_IMPL_HPP 00006 #define PLAYA_SIMPLE_ZERO_OP_IMPL_HPP 00007 00008 00009 00010 #include "PlayaSimpleZeroOpDecl.hpp" 00011 #include "PlayaOut.hpp" 00012 #include "PlayaTabs.hpp" 00013 00014 #ifndef HAVE_TEUCHOS_EXPLICIT_INSTANTIATION 00015 #include "PlayaLinearOperatorImpl.hpp" 00016 #endif 00017 00018 00019 namespace Playa 00020 { 00021 using namespace Teuchos; 00022 00023 00024 00025 00026 00027 /* ---- Zero op ------- */ 00028 00029 template <class Scalar> inline 00030 SimpleZeroOp<Scalar>::SimpleZeroOp(const VectorSpace<Scalar>& domain, 00031 const VectorSpace<Scalar>& range) 00032 : LinearOpWithSpaces<Scalar>(domain, range) {} 00033 00034 00035 00036 template <class Scalar> inline 00037 void SimpleZeroOp<Scalar>::apply(Teuchos::ETransp transApplyType, 00038 const Vector<Scalar>& in, 00039 Vector<Scalar> out) const 00040 { 00041 Tabs tab(0); 00042 PLAYA_MSG2(this->verb(), tab << "SimpleZeroOp::apply()"); 00043 00044 out.zero(); 00045 00046 PLAYA_MSG2(this->verb(), tab << "done SimpleZeroOp::apply()"); 00047 } 00048 00049 /* */ 00050 template <class Scalar> inline 00051 std::string SimpleZeroOp<Scalar>::description() const 00052 {return "ZeroOp(domain=" 00053 + this->domain()->description() 00054 + ", range=" + this->range()->description() + ")";} 00055 00056 00057 00058 template <class Scalar> inline 00059 LinearOperator<Scalar> zeroOperator( 00060 const VectorSpace<Scalar>& domain, 00061 const VectorSpace<Scalar>& range) 00062 { 00063 RCP<LinearOperatorBase<Scalar> > op 00064 = rcp(new SimpleZeroOp<Scalar>(domain, range)); 00065 00066 return op; 00067 } 00068 00069 00070 } 00071 00072 #endif