Thyra_DelayedLinearOpWithSolveDecl.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 
00030 #ifndef THYRA_DELAYED_LINEAR_OP_WITH_SOLVE_DECL_HPP
00031 #define THYRA_DELAYED_LINEAR_OP_WITH_SOLVE_DECL_HPP
00032 
00033 
00034 #include "Thyra_SingleScalarLinearOpWithSolveBase.hpp"
00035 
00036 
00037 namespace Thyra {
00038 
00039 
00051 template <class Scalar>
00052 class DelayedLinearOpWithSolve
00053   : virtual public LinearOpWithSolveBase<Scalar> // Interface
00054   , virtual protected SingleScalarLinearOpWithSolveBase<Scalar> // Implementation
00055 {
00056 public:
00057 
00060 
00062   DelayedLinearOpWithSolve();
00063 
00065   void initialize(
00066     const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
00067     const RCP<const PreconditionerBase<Scalar> > &prec,
00068     const RCP<const LinearOpSourceBase<Scalar> > &approxFwdOpSrc,
00069     const ESupportSolveUse supportSolveUse,
00070     const RCP<LinearOpWithSolveFactoryBase<Scalar> > &lowsf
00071     );
00072 
00074   RCP<const LinearOpSourceBase<Scalar> > getFwdOpSrc() const;
00075 
00077   RCP<const PreconditionerBase<Scalar> > getPrec() const;
00078  
00080   RCP<const LinearOpSourceBase<Scalar> > getApproxFwdOpSrc() const;
00081 
00083   ESupportSolveUse getSupportSolveUse() const;
00084 
00086 
00089 
00091   std::string description() const;
00092 
00094 
00097 
00099   RCP< const VectorSpaceBase<Scalar> > range() const;
00101   RCP< const VectorSpaceBase<Scalar> > domain() const;
00103   RCP<const LinearOpBase<Scalar> > clone() const;
00104 
00106 
00107 protected:
00108 
00111 
00113   void informUpdatedVerbosityState() const;
00114 
00116 
00119 
00121   virtual bool opSupported(ETransp M_trans) const;
00123   virtual void apply(
00124     const ETransp M_trans,
00125     const MultiVectorBase<Scalar> &X,
00126     MultiVectorBase<Scalar> *Y,
00127     const Scalar alpha,
00128     const Scalar beta
00129     ) const;
00130 
00132 
00135 
00137   virtual bool solveSupportsTrans(ETransp M_trans) const;
00139   virtual bool solveSupportsSolveMeasureType(
00140     ETransp M_trans, const SolveMeasureType& solveMeasureType
00141     ) const;
00143   virtual void solve(
00144     const ETransp M_trans,
00145     const MultiVectorBase<Scalar> &B,
00146     MultiVectorBase<Scalar> *X,
00147     const int numBlocks,
00148     const BlockSolveCriteria<Scalar> blockSolveCriteria[],
00149     SolveStatus<Scalar> blockSolveStatus[]
00150     ) const;
00151   
00153 
00154 private:
00155 
00156   // //////////////////////
00157   // Private data members
00158 
00159   RCP<const LinearOpSourceBase<Scalar> > fwdOpSrc_;
00160   RCP<const PreconditionerBase<Scalar> > prec_;
00161   RCP<const LinearOpSourceBase<Scalar> > approxFwdOpSrc_;
00162   ESupportSolveUse supportSolveUse_;
00163   RCP<LinearOpWithSolveFactoryBase<Scalar> > lowsf_;
00164 
00165   RCP<const LinearOpBase<Scalar> > fwdOp_;
00166 
00167   mutable bool lows_is_valid_;
00168   mutable RCP<LinearOpWithSolveBase<Scalar> > lows_;
00169 
00170   // ///////////////////////////
00171   // Private member functions
00172 
00173   void updateSolver() const;
00174 
00175 };
00176 
00177 
00178 } // namespace Thyra
00179 
00180 
00181 #endif // THYRA_DELAYED_LINEAR_OP_WITH_SOLVE_DECL_HPP

Generated on Tue Oct 20 12:47:11 2009 for Thyra Operator Solve Support by doxygen 1.4.7