Thyra_LinearOperatorDecl.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_LINEAROPERATOR_DECL_HPP
00030 #define THYRA_LINEAROPERATOR_DECL_HPP
00031 
00032 #include "Teuchos_Handle.hpp"
00033 #include "Thyra_VectorSpaceDecl.hpp"
00034 #include "Thyra_ConfigDefs.hpp"
00035 #include "Thyra_LinearOpBaseDecl.hpp"
00036 
00037 namespace Thyra
00038 {
00039 
00045   template <class RangeScalar, class DomainScalar=RangeScalar>
00046   class ConstLinearOperator 
00047     : public virtual Teuchos::ConstHandle<LinearOpBase<RangeScalar, DomainScalar> >
00048   {
00049   public:
00050 
00052     ConstLinearOperator() : Teuchos::ConstHandle<LinearOpBase<RangeScalar, DomainScalar> >(){;}
00053 
00055     ConstLinearOperator(Teuchos::ConstHandleable<LinearOpBase<RangeScalar, DomainScalar> >* rawPtr) 
00056       : Teuchos::ConstHandle<LinearOpBase<RangeScalar, DomainScalar> >(rawPtr){;}
00057 
00059     ConstLinearOperator(const Teuchos::RefCountPtr<const LinearOpBase<RangeScalar, DomainScalar> >& smartPtr) 
00060       : Teuchos::ConstHandle<LinearOpBase<RangeScalar, DomainScalar> >(smartPtr){;}
00061 
00063     const VectorSpace<DomainScalar> domain() const ;
00064 
00066     const VectorSpace<RangeScalar> range() const ;
00067 
00075     void apply(const ConstVector<DomainScalar>& in,
00076                Vector<RangeScalar>& out,
00077                const RangeScalar& alpha = 1.0,
00078                const RangeScalar& beta = 0.0) const ;
00079 
00087     void applyTranspose(const ConstVector<RangeScalar>& in,
00088                         Vector<DomainScalar>& out,
00089                         const DomainScalar& alpha = 1.0,
00090                         const DomainScalar& beta = 0.0) const ;
00091 
00092 
00094     int numBlockRows() const ;
00095 
00097     int numBlockCols() const ;
00098 
00100     ConstLinearOperator<RangeScalar, DomainScalar> getBlock(int blockRow, int blockCol) const ;
00101 
00102   };
00103 
00109   template <class RangeScalar, class DomainScalar=RangeScalar>
00110   class LinearOperator 
00111     : public Teuchos::Handle<LinearOpBase<RangeScalar, DomainScalar> >,
00112       public ConstLinearOperator<RangeScalar, DomainScalar>
00113   {
00114   public:
00115 
00117     LinearOperator() : Teuchos::Handle<LinearOpBase<RangeScalar, DomainScalar> >(){;}
00118 
00120     LinearOperator(Teuchos::Handleable<LinearOpBase<RangeScalar, DomainScalar> >* rawPtr) 
00121       : Teuchos::Handle<LinearOpBase<RangeScalar, DomainScalar> >(rawPtr){;}
00122 
00124     LinearOperator(const Teuchos::RefCountPtr<LinearOpBase<RangeScalar, DomainScalar> >& smartPtr) 
00125       : Teuchos::Handle<LinearOpBase<RangeScalar, DomainScalar> >(smartPtr){;}
00126 
00128     LinearOperator<RangeScalar, DomainScalar> getBlock(int blockRow, int blockCol) ;
00129 
00130   };
00131 
00136   template <class Scalar>
00137   ConstLinearOperator<Scalar>
00138   operator*(const Scalar& a, 
00139             const ConstLinearOperator<Scalar>& A);
00140 
00145   template <class Scalar>
00146   LinearOperator<Scalar>
00147   operator*(const Scalar& a, 
00148             const LinearOperator<Scalar>& A);
00149 
00154   template <class Scalar>
00155   ConstLinearOperator<Scalar>
00156   operator*(const ConstLinearOperator<Scalar>& A,
00157             const Scalar& a);
00158 
00163   template <class Scalar>
00164   LinearOperator<Scalar>
00165   operator*(const LinearOperator<Scalar>& A,
00166             const Scalar& a);
00167 
00172   template <class Scalar>
00173   ConstLinearOperator<Scalar>
00174   operator*(const ConstLinearOperator<Scalar>& A,
00175             const ConstLinearOperator<Scalar>& B);
00176 
00181   template <class Scalar>
00182   LinearOperator<Scalar>
00183   operator*(const LinearOperator<Scalar>& A,
00184             const LinearOperator<Scalar>& B);
00185 
00190   template <class Scalar>
00191   ConstLinearOperator<Scalar>
00192   operator+(const ConstLinearOperator<Scalar>& A,
00193             const ConstLinearOperator<Scalar>& B);
00194 
00199   template <class Scalar>
00200   LinearOperator<Scalar>
00201   operator+(const LinearOperator<Scalar>& A,
00202             const LinearOperator<Scalar>& B);
00203     
00209   template<class Scalar>
00210   ConstLinearOperator<Scalar>
00211   block2x2(
00212            const ConstLinearOperator<Scalar>&   A00,
00213            const ConstLinearOperator<Scalar>&   A01,
00214            const ConstLinearOperator<Scalar>&   A10,
00215            const ConstLinearOperator<Scalar>&   A11
00216            );
00217 
00222   template<class Scalar>
00223   ConstLinearOperator<Scalar>
00224   block2x1(
00225            const ConstLinearOperator<Scalar>&    A00,
00226            const ConstLinearOperator<Scalar>&   A10
00227            );
00228 
00233   template<class Scalar>
00234   ConstLinearOperator<Scalar>
00235   block1x2(
00236            const ConstLinearOperator<Scalar>&    A00,
00237            const ConstLinearOperator<Scalar>&   A01
00238            );
00239   
00245   template<class Scalar>
00246   LinearOperator<Scalar>
00247   block2x2(
00248            const LinearOperator<Scalar>&    A00,
00249            const LinearOperator<Scalar>&   A01,
00250            const LinearOperator<Scalar>&   A10,
00251            const LinearOperator<Scalar>&   A11
00252            );
00253 
00258   template<class Scalar>
00259   LinearOperator<Scalar>
00260   block2x1(
00261            const LinearOperator<Scalar>&    A00,
00262            const LinearOperator<Scalar>&   A10
00263            );
00264 
00269   template<class Scalar>
00270   LinearOperator<Scalar>
00271   block1x2(
00272            const LinearOperator<Scalar>&    A00,
00273            const LinearOperator<Scalar>&   A01
00274            );
00275 
00276 }
00277 
00278 #endif

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