Thyra_EuclideanLinearOpBaseDecl.hpp

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_LinearOpBaseDecl.hpp"
00033 
00034 namespace Thyra {
00035 
00047 template<class RangeScalar, class DomainScalar>
00048 class EuclideanLinearOpBase : virtual public LinearOpBase<RangeScalar,DomainScalar> {
00049 public:
00050 
00053 
00055   virtual Teuchos::RefCountPtr<const ScalarProdVectorSpaceBase<RangeScalar> > rangeScalarProdVecSpc() const = 0;
00056 
00058   virtual Teuchos::RefCountPtr<const ScalarProdVectorSpaceBase<DomainScalar> > domainScalarProdVecSpc() const = 0;
00059 
00068   virtual void euclideanApply(
00069     const EConj                            conj
00070     ,const MultiVectorBase<DomainScalar>   &X
00071     ,MultiVectorBase<RangeScalar>          *Y
00072     ,const RangeScalar                     alpha
00073     ,const RangeScalar                     beta
00074     ) const = 0;
00075 
00077 
00080 
00092   virtual void euclideanApplyTranspose(
00093     const EConj                            conj
00094     ,const MultiVectorBase<RangeScalar>    &X
00095     ,MultiVectorBase<DomainScalar>         *Y
00096     ,const DomainScalar                    alpha
00097     ,const DomainScalar                    beta
00098     ) const;
00099 
00101 
00104 
00105   Teuchos::RefCountPtr<const VectorSpaceBase<RangeScalar> > range() const;
00107   Teuchos::RefCountPtr<const VectorSpaceBase<DomainScalar> > domain() const;
00109 
00112 
00118   void apply(
00119     const EConj                            conj
00120     ,const MultiVectorBase<DomainScalar>   &X
00121     ,MultiVectorBase<RangeScalar>          *Y
00122     ,const RangeScalar                     alpha
00123     ,const RangeScalar                     beta
00124     ) const;
00125 
00131   void applyTranspose(
00132     const EConj                            conj
00133     ,const MultiVectorBase<RangeScalar>    &X
00134     ,MultiVectorBase<DomainScalar>         *Y
00135     ,const DomainScalar                    alpha
00136     ,const DomainScalar                    beta
00137     ) const;
00138 
00140 
00141 protected:
00142   
00143   void euclidean_apply_impl(
00144     const EConj                            conj
00145     ,const MultiVectorBase<DomainScalar>   &X
00146     ,MultiVectorBase<RangeScalar>          *Y
00147     ,const RangeScalar                     alpha
00148     ,const RangeScalar                     beta
00149     ) const;
00150   
00151   void euclidean_applyTranspose_impl(
00152     const EConj                            conj
00153     ,const MultiVectorBase<RangeScalar>    &X
00154     ,MultiVectorBase<DomainScalar>         *Y
00155     ,const DomainScalar                    alpha
00156     ,const DomainScalar                    beta
00157     ) const;
00158 
00159 }; // end class EuclideanLinearOpBase<Scalar>
00160 
00169 template<class Scalar>
00170 inline void euclideanApply(
00171   const EuclideanLinearOpBase<Scalar>        &M
00172   ,const ETransp                             M_trans
00173   ,const MultiVectorBase<Scalar>             &X
00174   ,MultiVectorBase<Scalar>                   *Y
00175   ,const Scalar                              alpha
00176   ,const Scalar                              beta
00177   )
00178 {
00179   if(real_trans(M_trans)==NOTRANS) {
00180     M.euclideanApply(transToConj(M_trans),X,Y,alpha,beta);
00181   }
00182   else {
00183     M.euclideanApplyTranspose(transToConj(M_trans),X,Y,alpha,beta);
00184   }
00185 }
00186 
00187 } // namespace Thyra
00188 
00189 #endif // THYRA_EUCLIDEAN_LINEAR_OP_DECL_HPP

Generated on Thu Sep 18 12:39:52 2008 for Thyra ANA Operator/VectorBase Interfaces and Related Software by doxygen 1.3.9.1