00001 /* *********************************************************************** 00002 // 00003 // TSFExtended: Trilinos Solver Framework Extended 00004 // Copyright (2004) Sandia Corporation 00005 // 00006 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00007 // license for use of this work by or on behalf of the U.S. Government. 00008 // 00009 // This library is free software; you can redistribute it and/or modify 00010 // it under the terms of the GNU Lesser General Public License as 00011 // published by the Free Software Foundation; either version 2.1 of the 00012 // License, or (at your option) any later version. 00013 // 00014 // This library is distributed in the hope that it will be useful, but 00015 // WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 // Lesser General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU Lesser General Public 00020 // License along with this library; if not, write to the Free Software 00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00022 // USA 00023 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00024 // 00025 // **********************************************************************/ 00026 /* @HEADER@ */ 00027 00028 #ifndef TSF_SIMPLE_TRANSPOSED_OP_DECL_HPP 00029 #define TSF_SIMPLE_TRANSPOSED_OP_DECL_HPP 00030 00031 00032 00033 #include "SundanceDefs.hpp" 00034 #include "TSFSimplifiedLinearOpBaseDecl.hpp" 00035 #include "TSFLinearOperatorDecl.hpp" 00036 00037 00038 namespace TSFExtended 00039 { 00040 using namespace Teuchos; 00041 using namespace Sundance; 00042 00043 00044 00045 /** 00046 * Represent the transpose of an operator 00047 */ 00048 template <class Scalar> 00049 class SimpleTransposedOp : public SimplifiedLinearOpWithSpaces<Scalar> 00050 { 00051 public: 00052 /** */ 00053 SimpleTransposedOp(const LinearOperator<Scalar>& A); 00054 00055 /** */ 00056 void applyOp(const Thyra::EOpTransp M_trans, 00057 const Vector<Scalar>& in, 00058 Vector<Scalar> out) const; 00059 00060 00061 /** */ 00062 std::string description() const ; 00063 00064 /** */ 00065 LinearOperator<Scalar> op() const {return A_;} 00066 00067 private: 00068 LinearOperator<Scalar> A_; 00069 }; 00070 00071 00072 /** \relates SimpleTransposedOp */ 00073 template <class Scalar> 00074 LinearOperator<Scalar> transposedOperator( 00075 const LinearOperator<Scalar>& op); 00076 00077 } 00078 00079 #endif