Thyra Package Browser (Single Doxygen Collection) Version of the Day
Thyra_LinearOpBase_def.hpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //    Thyra: Interfaces and Support for Abstract Numerical Algorithms
00005 //                 Copyright (2004) 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 Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef THYRA_LINEAR_OP_BASE_DEF_HPP
00030 #define THYRA_LINEAR_OP_BASE_DEF_HPP
00031 
00032 #include "Thyra_LinearOpBase_decl.hpp"
00033 #include "Thyra_MultiVectorBase.hpp"
00034 #include "Thyra_VectorSpaceBase.hpp"
00035 
00036 
00037 namespace Thyra {
00038 
00039 
00040 // Public interface functions
00041 
00042 
00043 template<class Scalar>
00044 RCP<const LinearOpBase<Scalar> > 
00045 LinearOpBase<Scalar>::clone() const
00046 {
00047   return Teuchos::null;
00048 }
00049 
00050 
00051 // Deprecated
00052 
00053 
00054 template<class Scalar>
00055 bool LinearOpBase<Scalar>::applySupports(
00056   const EConj conj
00057   ) const
00058 {
00059   return Thyra::opSupported(*this, applyConjToTrans(conj));
00060 }
00061 
00062 template<class Scalar>
00063 void LinearOpBase<Scalar>::apply(
00064   const EConj conj,
00065   const MultiVectorBase<Scalar> &X,
00066   MultiVectorBase<Scalar> *Y,
00067   const Scalar alpha,
00068   const Scalar beta
00069   ) const
00070 {
00071   Thyra::apply(*this, applyConjToTrans(conj), X, Teuchos::ptr(Y), alpha, beta);
00072 }
00073 
00074 
00075 template<class Scalar>
00076 bool LinearOpBase<Scalar>::applyTransposeSupports(
00077   const EConj conj
00078   ) const
00079 {
00080   return Thyra::opSupported(*this, applyTransposeConjToTrans(conj));
00081 }
00082 
00083 
00084 template<class Scalar>
00085 void LinearOpBase<Scalar>::applyTranspose(
00086   const EConj conj,
00087   const MultiVectorBase<Scalar> &X,
00088   MultiVectorBase<Scalar> *Y,
00089   const Scalar alpha,
00090   const Scalar beta
00091   ) const
00092 {
00093   Thyra::apply(*this, applyTransposeConjToTrans(conj), X, Teuchos::ptr(Y), alpha, beta);
00094 }
00095 
00096 
00097 } // end namespace Thyra
00098 
00099 
00100 // ToDo: You can move this back to the decl file after you have refactored
00101 // apply(...) to not use raw pointers.  Otherwise the Y.ptr() call needs to have
00102 // the definition of MultiVectorBase.
00103 
00104 
00105 template<class Scalar>
00106 void Thyra::apply(
00107   const LinearOpBase<Scalar> &M,
00108   const EOpTransp M_trans,
00109   const MultiVectorBase<Scalar> &X,
00110   const Ptr<MultiVectorBase<Scalar> > &Y,
00111   const Scalar alpha,
00112   const Scalar beta
00113   )
00114 {
00115   M.apply(M_trans, X, Y, alpha, beta);
00116 }
00117 
00118 
00119 //
00120 // Explicit instantiation macro
00121 //
00122 
00123 #define THYRA_LINEAR_OP_BASE_INSTANT(SCALAR) \
00124   \
00125   template class LinearOpBase<SCALAR >; \
00126   \
00127   template void apply(  \
00128     const LinearOpBase<SCALAR > &M,  \
00129     const EOpTransp M_trans,  \
00130     const MultiVectorBase<SCALAR > &X,  \
00131     const Ptr<MultiVectorBase<SCALAR > > &Y,  \
00132     const SCALAR alpha,  \
00133     const SCALAR beta  \
00134     );
00135 
00136 
00137 #endif // THYRA_LINEAR_OP_BASE_DEF_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines