AbstractLinAlgPack_MatrixOpThyra.hpp

00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00005 //                  Copyright (2003) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef ALAP_MATRIX_OP_Thyra_HPP
00030 #define ALAP_MATRIX_OP_Thyra_HPP
00031 
00032 #include "AbstractLinAlgPack_MatrixOp.hpp"
00033 #include "AbstractLinAlgPack_VectorSpaceThyra.hpp"
00034 #include "Thyra_LinearOpBase.hpp"
00035 
00036 namespace AbstractLinAlgPack {
00037 
00040 class MatrixOpThyra : virtual public MatrixOp {
00041 public:
00042 
00045 
00054   MatrixOpThyra();
00057   MatrixOpThyra(
00058     const Teuchos::RefCountPtr<const Thyra::LinearOpBase<value_type> >   &thyra_linear_op
00059     ,BLAS_Cpp::Transp                                                    thyra_linear_op_trans = BLAS_Cpp::no_trans
00060     );
00078   virtual void initialize(
00079     const Teuchos::RefCountPtr<const Thyra::LinearOpBase<value_type> >   &thyra_linear_op
00080     ,BLAS_Cpp::Transp                                                    thyra_linear_op_trans = BLAS_Cpp::no_trans
00081     );
00088   Teuchos::RefCountPtr<const Thyra::LinearOpBase<value_type> > set_uninitialized();
00094   const Teuchos::RefCountPtr<const Thyra::LinearOpBase<value_type> >& thyra_linear_op() const;
00096   BLAS_Cpp::Transp thyra_linear_op_trans() const;
00097 
00099 
00102 
00104   const VectorSpace& space_cols() const;
00106   const VectorSpace& space_rows() const;
00107 
00109 
00112 
00114   mat_mut_ptr_t clone();
00116   MatrixOp& operator=(const MatrixOp& mwo_rhs);
00118   void Vp_StMtV(
00119     VectorMutable* v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
00120     ,const Vector& v_rhs2, value_type beta
00121     ) const;
00123   bool Mp_StMtM(
00124     MatrixOp* mwo_lhs, value_type alpha
00125     ,BLAS_Cpp::Transp trans_rhs1
00126     ,const MatrixOp& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2
00127     ,value_type beta
00128     ) const;
00129 
00131 
00132 private:
00133   
00134 #ifdef DOXYGEN_COMPILE
00135   Thyra::LinearOpBase<value_type>                                *thyra_linear_op;
00136 #else
00137   Teuchos::RefCountPtr<const Thyra::LinearOpBase<value_type> >   thyra_linear_op_;
00138 #endif
00139   BLAS_Cpp::Transp                                               thyra_linear_op_trans_;
00140   VectorSpaceThyra                                               space_cols_;
00141   VectorSpaceThyra                                               space_rows_;
00142 
00143 }; // end class MatrixOpThyra
00144 
00145 // //////////////////////////////////////////////////
00146 // Inlined functions
00147 
00148 inline
00149 const Teuchos::RefCountPtr<const Thyra::LinearOpBase<value_type> >&
00150 MatrixOpThyra::thyra_linear_op() const
00151 {
00152   return thyra_linear_op_;
00153 }
00154 
00155 inline
00156 BLAS_Cpp::Transp MatrixOpThyra::thyra_linear_op_trans() const
00157 {
00158   return thyra_linear_op_trans_;
00159 }
00160 
00161 } // end namespace AbstractLinAlgPack
00162 
00163 #endif // ALAP_MATRIX_OP_Thyra_HPP

Generated on Thu Sep 18 12:34:37 2008 for MOOCHO/Thyra Adapter Software by doxygen 1.3.9.1