Thyra_EuclideanLinearOpBaseDecl.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_DECL_HPP
00030 #define THYRA_EUCLIDEAN_LINEAR_OP_DECL_HPP
00031 
00032 #include "Thyra_OperatorVectorAdapterSupportTypes.hpp"
00033 #include "Thyra_LinearOpDefaultBaseDecl.hpp"
00034 
00035 namespace Thyra {
00036 
00048 template<class RangeScalar, class DomainScalar>
00049 class EuclideanLinearOpBase : virtual public LinearOpDefaultBase<RangeScalar,DomainScalar> {
00050 public:
00051 
00054 
00056   virtual Teuchos::RefCountPtr<const ScalarProdVectorSpaceBase<RangeScalar> > rangeScalarProdVecSpc() const = 0;
00057 
00059   virtual Teuchos::RefCountPtr<const ScalarProdVectorSpaceBase<DomainScalar> > domainScalarProdVecSpc() const = 0;
00060 
00069   virtual void euclideanApply(
00070     const EConj                            conj
00071     ,const MultiVectorBase<DomainScalar>   &X
00072     ,MultiVectorBase<RangeScalar>          *Y
00073     ,const RangeScalar                     alpha
00074     ,const RangeScalar                     beta
00075     ) const = 0;
00076 
00078 
00081 
00093   virtual void euclideanApplyTranspose(
00094     const EConj                            conj
00095     ,const MultiVectorBase<RangeScalar>    &X
00096     ,MultiVectorBase<DomainScalar>         *Y
00097     ,const DomainScalar                    alpha
00098     ,const DomainScalar                    beta
00099     ) const;
00100 
00102 
00105 
00106   Teuchos::RefCountPtr<const VectorSpaceBase<RangeScalar> > range() const;
00108   Teuchos::RefCountPtr<const VectorSpaceBase<DomainScalar> > domain() const;
00110 
00113 
00119   void apply(
00120     const EConj                            conj
00121     ,const MultiVectorBase<DomainScalar>   &X
00122     ,MultiVectorBase<RangeScalar>          *Y
00123     ,const RangeScalar                     alpha
00124     ,const RangeScalar                     beta
00125     ) const;
00126 
00132   void applyTranspose(
00133     const EConj                            conj
00134     ,const MultiVectorBase<RangeScalar>    &X
00135     ,MultiVectorBase<DomainScalar>         *Y
00136     ,const DomainScalar                    alpha
00137     ,const DomainScalar                    beta
00138     ) const;
00139 
00141 
00142 protected:
00143   
00144   void euclidean_apply_impl(
00145     const EConj                            conj
00146     ,const MultiVectorBase<DomainScalar>   &X
00147     ,MultiVectorBase<RangeScalar>          *Y
00148     ,const RangeScalar                     alpha
00149     ,const RangeScalar                     beta
00150     ) const;
00151   
00152   void euclidean_applyTranspose_impl(
00153     const EConj                            conj
00154     ,const MultiVectorBase<RangeScalar>    &X
00155     ,MultiVectorBase<DomainScalar>         *Y
00156     ,const DomainScalar                    alpha
00157     ,const DomainScalar                    beta
00158     ) const;
00159 
00160 }; // end class EuclideanLinearOpBase<Scalar>
00161 
00170 template<class Scalar>
00171 inline void euclideanApply(
00172   const EuclideanLinearOpBase<Scalar>        &M
00173   ,const ETransp                             M_trans
00174   ,const MultiVectorBase<Scalar>             &X
00175   ,MultiVectorBase<Scalar>                   *Y
00176   ,const Scalar                              alpha
00177   ,const Scalar                              beta
00178   )
00179 {
00180   if(real_trans(M_trans)==NOTRANS) {
00181     M.euclideanApply(transToConj(M_trans),X,Y,alpha,beta);
00182   }
00183   else {
00184     M.euclideanApplyTranspose(transToConj(M_trans),X,Y,alpha,beta);
00185   }
00186 }
00187 
00188 } // namespace Thyra
00189 
00190 #endif // THYRA_EUCLIDEAN_LINEAR_OP_DECL_HPP

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