Thyra_DefaultZeroLinearOpDecl.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_DEFAULT_ZERO_LINEAR_OP_DECL_HPP
00030 #define THYRA_DEFAULT_ZERO_LINEAR_OP_DECL_HPP
00031 
00032 #include "Thyra_ZeroLinearOpBase.hpp"
00033 #include "Thyra_SingleScalarLinearOpBase.hpp"
00034 #include "Teuchos_ConstNonconstObjectContainer.hpp"
00035 #include "Teuchos_arrayArg.hpp"
00036 
00037 namespace Thyra {
00038 
00055 template<class Scalar>
00056 class DefaultZeroLinearOp
00057   : virtual public ZeroLinearOpBase<Scalar>              // Public interface
00058   , virtual protected SingleScalarLinearOpBase<Scalar>   // Implementation detail
00059 {
00060 public:
00061 
00063   using SingleScalarLinearOpBase<Scalar>::apply;
00064 
00067 
00074   DefaultZeroLinearOp();
00075 
00078   DefaultZeroLinearOp(
00079     const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> >   &range
00080     ,const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> >  &domain
00081     );
00082 
00098   void initialize(
00099     const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> >   &range
00100     ,const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> >  &domain
00101     );
00102 
00109   void uninitialize();
00110 
00112 
00115   
00117   Teuchos::RefCountPtr< const VectorSpaceBase<Scalar> > range() const;
00118   
00120   Teuchos::RefCountPtr< const VectorSpaceBase<Scalar> > domain() const;
00121   
00123   Teuchos::RefCountPtr<const LinearOpBase<Scalar> > clone() const;
00124   
00126   
00129                                                 
00133   std::string description() const;
00134 
00136 
00137 protected:
00138 
00141 
00143   bool opSupported(ETransp M_trans) const;
00144 
00146   void apply(
00147     const ETransp                     M_trans
00148     ,const MultiVectorBase<Scalar>    &X
00149     ,MultiVectorBase<Scalar>          *Y
00150     ,const Scalar                     alpha
00151     ,const Scalar                     beta
00152     ) const;
00153 
00155 
00156 private:
00157 
00158   Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> >  range_;
00159   Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> >  domain_;
00160 
00161   // Not defined and not to be called
00162   DefaultZeroLinearOp(const DefaultZeroLinearOp&);
00163   DefaultZeroLinearOp& operator=(const DefaultZeroLinearOp&);
00164 
00165 };
00166 
00171 template<class Scalar>
00172 Teuchos::RefCountPtr<const LinearOpBase<Scalar> >
00173 zero(
00174   const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> >   &range
00175   ,const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> >  &domain
00176   );
00177 
00178 } // end namespace Thyra
00179 
00180 #endif  // THYRA_DEFAULT_ZERO_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