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( const Teuchos::ENull _null = Teuchos::null )
00053       : Teuchos::ConstHandle<LinearOpBase<RangeScalar, DomainScalar> >(){;}
00054 
00056     ConstLinearOperator(Teuchos::ConstHandleable<LinearOpBase<RangeScalar, DomainScalar> >* rawPtr) 
00057       : Teuchos::ConstHandle<LinearOpBase<RangeScalar, DomainScalar> >(rawPtr){;}
00058 
00060     ConstLinearOperator(const Teuchos::RCP<const LinearOpBase<RangeScalar, DomainScalar> >& smartPtr) 
00061       : Teuchos::ConstHandle<LinearOpBase<RangeScalar, DomainScalar> >(smartPtr){;}
00062 
00064     const VectorSpace<DomainScalar> domain() const ;
00065 
00067     const VectorSpace<RangeScalar> range() const ;
00068 
00076     void apply(const ConstVector<DomainScalar>& in,
00077                Vector<RangeScalar>& out,
00078                const RangeScalar& alpha = 1.0,
00079                const RangeScalar& beta = 0.0) const ;
00080 
00088     void applyTranspose(const ConstVector<RangeScalar>& in,
00089                         Vector<DomainScalar>& out,
00090                         const DomainScalar& alpha = 1.0,
00091                         const DomainScalar& beta = 0.0) const ;
00092 
00093 
00095     int numBlockRows() const ;
00096 
00098     int numBlockCols() const ;
00099 
00101     ConstLinearOperator<RangeScalar, DomainScalar> getBlock(int blockRow, int blockCol) const ;
00102 
00103   };
00104 
00110   template <class RangeScalar, class DomainScalar=RangeScalar>
00111   class LinearOperator 
00112     : public Teuchos::Handle<LinearOpBase<RangeScalar, DomainScalar> >,
00113       public ConstLinearOperator<RangeScalar, DomainScalar>
00114   {
00115   public:
00116 
00118     LinearOperator( const Teuchos::ENull _null = Teuchos::null )
00119       : Teuchos::Handle<LinearOpBase<RangeScalar, DomainScalar> >(){;}
00120 
00122     LinearOperator(Teuchos::Handleable<LinearOpBase<RangeScalar, DomainScalar> >* rawPtr) 
00123       : Teuchos::Handle<LinearOpBase<RangeScalar, DomainScalar> >(rawPtr){;}
00124 
00126     LinearOperator(const Teuchos::RCP<LinearOpBase<RangeScalar, DomainScalar> >& smartPtr) 
00127       : Teuchos::Handle<LinearOpBase<RangeScalar, DomainScalar> >(smartPtr){;}
00128 
00130     LinearOperator<RangeScalar, DomainScalar> getBlock(int blockRow, int blockCol) ;
00131 
00132   };
00133 
00138   template <class Scalar>
00139   ConstLinearOperator<Scalar>
00140   operator*(const Scalar& a, 
00141             const ConstLinearOperator<Scalar>& A);
00142 
00147   template <class Scalar>
00148   LinearOperator<Scalar>
00149   operator*(const Scalar& a, 
00150             const LinearOperator<Scalar>& A);
00151 
00156   template <class Scalar>
00157   ConstLinearOperator<Scalar>
00158   operator*(const ConstLinearOperator<Scalar>& A,
00159             const Scalar& a);
00160 
00165   template <class Scalar>
00166   LinearOperator<Scalar>
00167   operator*(const LinearOperator<Scalar>& A,
00168             const Scalar& a);
00169 
00174   template <class Scalar>
00175   ConstLinearOperator<Scalar>
00176   operator*(const ConstLinearOperator<Scalar>& A,
00177             const ConstLinearOperator<Scalar>& B);
00178 
00183   template <class Scalar>
00184   LinearOperator<Scalar>
00185   operator*(const LinearOperator<Scalar>& A,
00186             const LinearOperator<Scalar>& B);
00187 
00192   template <class Scalar>
00193   ConstLinearOperator<Scalar>
00194   operator+(const ConstLinearOperator<Scalar>& A,
00195             const ConstLinearOperator<Scalar>& B);
00196 
00201   template <class Scalar>
00202   LinearOperator<Scalar>
00203   operator+(const LinearOperator<Scalar>& A,
00204             const LinearOperator<Scalar>& B);
00205     
00211   template<class Scalar>
00212   ConstLinearOperator<Scalar>
00213   block2x2(
00214            const ConstLinearOperator<Scalar>&   A00,
00215            const ConstLinearOperator<Scalar>&   A01,
00216            const ConstLinearOperator<Scalar>&   A10,
00217            const ConstLinearOperator<Scalar>&   A11
00218            );
00219 
00224   template<class Scalar>
00225   ConstLinearOperator<Scalar>
00226   block2x1(
00227            const ConstLinearOperator<Scalar>&    A00,
00228            const ConstLinearOperator<Scalar>&   A10
00229            );
00230 
00235   template<class Scalar>
00236   ConstLinearOperator<Scalar>
00237   block1x2(
00238            const ConstLinearOperator<Scalar>&    A00,
00239            const ConstLinearOperator<Scalar>&   A01
00240            );
00241   
00247   template<class Scalar>
00248   LinearOperator<Scalar>
00249   block2x2(
00250            const LinearOperator<Scalar>&    A00,
00251            const LinearOperator<Scalar>&   A01,
00252            const LinearOperator<Scalar>&   A10,
00253            const LinearOperator<Scalar>&   A11
00254            );
00255 
00260   template<class Scalar>
00261   LinearOperator<Scalar>
00262   block2x1(
00263            const LinearOperator<Scalar>&    A00,
00264            const LinearOperator<Scalar>&   A10
00265            );
00266 
00271   template<class Scalar>
00272   LinearOperator<Scalar>
00273   block1x2(
00274            const LinearOperator<Scalar>&    A00,
00275            const LinearOperator<Scalar>&   A01
00276            );
00277 
00279   template<class Scalar>
00280   ConstLinearOperator<Scalar>
00281   identity( const VectorSpace<Scalar> &space );
00282 
00284   template<class Scalar>
00285   ConstLinearOperator<Scalar>
00286   zero( const VectorSpace<Scalar> &range, const VectorSpace<Scalar> &domain );
00287 
00288 } // namespace Thyra
00289 
00290 #endif

Generated on Tue Oct 20 12:47:26 2009 for Thyra Package Browser (Single Doxygen Collection) by doxygen 1.4.7