00001 /* @HEADER@ */ 00002 // 00003 /* @HEADER@ */ 00004 00005 #ifndef PLAYA_SIMPLE_DIAGONAL_OP_DECL_HPP 00006 #define PLAYA_SIMPLE_DIAGONAL_OP_DECL_HPP 00007 00008 00009 00010 #include "PlayaDefs.hpp" 00011 #include "PlayaLinearOpWithSpacesDecl.hpp" 00012 #include "PlayaLinearOperatorDecl.hpp" 00013 00014 00015 namespace Playa 00016 { 00017 using namespace Teuchos; 00018 00019 00020 00021 00022 00023 /** */ 00024 template <class Scalar> 00025 class SimpleDiagonalOp : public LinearOpWithSpaces<Scalar>, 00026 public Printable 00027 { 00028 public: 00029 /** */ 00030 SimpleDiagonalOp(const Vector<Scalar>& diag); 00031 00032 00033 /** */ 00034 void apply(Teuchos::ETransp transApplyType, 00035 const Vector<Scalar>& in, 00036 Vector<Scalar> out) const ; 00037 00038 /** */ 00039 std::string description() const ; 00040 00041 /** */ 00042 void print(std::ostream& os) const ; 00043 00044 private: 00045 Vector<Scalar> diag_; 00046 }; 00047 00048 /** \relates SimpleDiagonalOp */ 00049 template <class Scalar> 00050 LinearOperator<Scalar> diagonalOperator( 00051 const Vector<Scalar>& diag); 00052 00053 } 00054 00055 #endif