PlayaSimpleIdentityOpImpl.hpp

00001 /* @HEADER@ */
00002 //   
00003  /* @HEADER@ */
00004 
00005 #ifndef PLAYA_SIMPLE_IDENTITY_OP_IMPL_HPP
00006 #define PLAYA_SIMPLE_IDENTITY_OP_IMPL_HPP
00007 
00008 
00009 
00010 #include "PlayaSimpleIdentityOpDecl.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 /* ---- Identity op ------- */
00026 
00027 template <class Scalar> inline
00028 SimpleIdentityOp<Scalar>::SimpleIdentityOp(const VectorSpace<Scalar>& space)
00029   : LinearOpWithSpaces<Scalar>(space, space) {}
00030 
00031 
00032 template <class Scalar> inline
00033 void SimpleIdentityOp<Scalar>::apply(Teuchos::ETransp transApplyType,
00034   const Vector<Scalar>& in,
00035   Vector<Scalar> out) const
00036 {
00037   Tabs tab(0);
00038   PLAYA_MSG2(this->verb(), tab << "SimpleIdentityOp::apply()");
00039   out.acceptCopyOf(in);
00040   PLAYA_MSG2(this->verb(), tab << "done SimpleIdentityOp::apply()");
00041 }
00042 
00043 template <class Scalar> inline
00044 std::string SimpleIdentityOp<Scalar>::description() const 
00045 {return "I(" + this->domain()->description() + ")";}
00046 
00047 
00048 
00049 template <class Scalar> inline
00050 LinearOperator<Scalar> identityOperator(
00051   const VectorSpace<Scalar>& space)
00052 {
00053   RCP<LinearOperatorBase<Scalar> > op 
00054     = rcp(new SimpleIdentityOp<Scalar>(space));
00055 
00056   return op;
00057 }
00058 
00059 
00060 
00061 }
00062 
00063 #endif

doxygen