00001 /* @HEADER@ */ 00002 // 00003 /* @HEADER@ */ 00004 00005 #ifndef PLAYA_SIMPLE_ADDED_OP_DECL_HPP 00006 #define PLAYA_SIMPLE_ADDED_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 * Represent a sum of operators A_0 + A_1 + ... + A_n. 00023 */ 00024 template <class Scalar> 00025 class SimpleAddedOp : public LinearOpWithSpaces<Scalar> 00026 { 00027 public: 00028 /** */ 00029 SimpleAddedOp(const Array<LinearOperator<Scalar> >& ops); 00030 00031 /** */ 00032 void apply(Teuchos::ETransp transApplyType, 00033 const Vector<Scalar>& in, 00034 Vector<Scalar> out) const; 00035 00036 /** */ 00037 std::string description() const ; 00038 00039 private: 00040 Array<LinearOperator<Scalar> > ops_; 00041 }; 00042 00043 /** \relates LinearOperator */ 00044 template <class Scalar> 00045 LinearOperator<Scalar> addedOperator( 00046 const Array<LinearOperator<Scalar> >& ops); 00047 00048 00049 /** \relates LinearOperator */ 00050 template <class Scalar> 00051 LinearOperator<Scalar> 00052 operator+(const LinearOperator<Scalar>& A, 00053 const LinearOperator<Scalar>& B); 00054 00055 00056 } 00057 00058 #endif