Thyra_EuclideanLinearOpBase.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_EUCLIDEAN_LINEAR_OP_HPP
00030 #define THYRA_EUCLIDEAN_LINEAR_OP_HPP
00031 
00032 #include "Thyra_EuclideanLinearOpBaseDecl.hpp"
00033 #include "Thyra_LinearOpDefaultBase.hpp"
00034 #include "Thyra_ScalarProdVectorSpaceBase.hpp"
00035 #include "Thyra_ScalarProdBase.hpp"
00036 #include "Thyra_AssertOp.hpp"
00037 
00038 namespace Thyra {
00039 
00040 // Virtual functions with default implementations
00041 
00042 template<class RangeScalar, class DomainScalar>
00043 void EuclideanLinearOpBase<RangeScalar,DomainScalar>::euclideanApplyTranspose(
00044   const EConj                            conj
00045   ,const MultiVectorBase<RangeScalar>    &X
00046   ,MultiVectorBase<DomainScalar>         *Y
00047   ,const DomainScalar                    alpha
00048   ,const DomainScalar                    beta
00049   ) const
00050 {
00051   TEST_FOR_EXCEPTION(
00052     true,std::logic_error
00053     ,"EuclideanLinearOpBase<"<<Teuchos::ScalarTraits<RangeScalar>::name()<<","<<Teuchos::ScalarTraits<RangeScalar>::name()<<">::applyTranspose(...): "
00054     "Error, the concrete subclass described as { " << this->description() << " } "
00055     " with this->applyTransposeSupports("<<toString(conj)<<")="<<this->applyTransposeSupports(conj)
00056     << " did not override this function and does not support transposes."
00057     );
00058 }
00059 
00060 // Overridden functions from OpBase */
00061 
00062 template<class RangeScalar, class DomainScalar>
00063 Teuchos::RefCountPtr<const VectorSpaceBase<RangeScalar> >
00064 EuclideanLinearOpBase<RangeScalar,DomainScalar>::range() const
00065 {
00066   return this->rangeScalarProdVecSpc();
00067 }
00068 
00069 template<class RangeScalar, class DomainScalar>
00070 Teuchos::RefCountPtr<const VectorSpaceBase<DomainScalar> >
00071 EuclideanLinearOpBase<RangeScalar,DomainScalar>::domain() const
00072 {
00073   return this->domainScalarProdVecSpc();
00074 }
00075 
00076 // Overridden functions from LinearOpBase
00077 
00078 template<class RangeScalar, class DomainScalar>
00079 void EuclideanLinearOpBase<RangeScalar,DomainScalar>::apply(
00080   const EConj                            conj
00081   ,const MultiVectorBase<DomainScalar>   &X
00082   ,MultiVectorBase<RangeScalar>          *Y
00083   ,const RangeScalar                     alpha
00084   ,const RangeScalar                     beta
00085   ) const
00086 {
00087   euclidean_apply_impl(conj,X,Y,alpha,beta);
00088 }
00089 
00090 template<class RangeScalar, class DomainScalar>
00091 void EuclideanLinearOpBase<RangeScalar,DomainScalar>::applyTranspose(
00092   const EConj                            conj
00093   ,const MultiVectorBase<RangeScalar>    &X
00094   ,MultiVectorBase<DomainScalar>         *Y
00095   ,const DomainScalar                    alpha
00096   ,const DomainScalar                    beta
00097   ) const
00098 {
00099   euclidean_applyTranspose_impl(conj,X,Y,alpha,beta);
00100 }
00101 
00102 // protected
00103 
00104 template<class RangeScalar, class DomainScalar>
00105 void EuclideanLinearOpBase<RangeScalar,DomainScalar>::euclidean_apply_impl(
00106   const EConj                            conj
00107   ,const MultiVectorBase<DomainScalar>   &X
00108   ,MultiVectorBase<RangeScalar>          *Y
00109   ,const RangeScalar                     alpha
00110   ,const RangeScalar                     beta
00111   ) const
00112 {
00113   this->domainScalarProdVecSpc()->getScalarProd()->apply(*this,applyConjToTrans(conj),X,Y,alpha,beta);
00114 }
00115 
00116 template<class RangeScalar, class DomainScalar>
00117 void EuclideanLinearOpBase<RangeScalar,DomainScalar>::euclidean_applyTranspose_impl(
00118   const EConj                            conj
00119   ,const MultiVectorBase<RangeScalar>    &X
00120   ,MultiVectorBase<DomainScalar>         *Y
00121   ,const DomainScalar                    alpha
00122   ,const DomainScalar                    beta
00123   ) const
00124 {
00125   this->rangeScalarProdVecSpc()->getScalarProd()->apply(*this,applyTransposeConjToTrans(conj),X,Y,alpha,beta);
00126 }
00127 
00128 } // namespace Thyra
00129 
00130 #endif // THYRA_EUCLIDEAN_LINEAR_OP_HPP

Generated on Thu Sep 18 12:33:02 2008 for Thyra Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1