NLPInterfacePack_NLPDirectThyraModelEvaluator.hpp

00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00005 //                  Copyright (2003) 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 Roscoe A. Bartlett (rabartl@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef NLPIP_NLP_DIRECT_THYRA_MODEL_EVALUATOR_HPP
00030 #define NLPIP_NLP_DIRECT_THYRA_MODEL_EVALUATOR_HPP
00031 
00032 #include "NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp"
00033 #include "NLPInterfacePack_NLPDirect.hpp"
00034 #include "Thyra_DirectionalFiniteDiffCalculator.hpp"
00035 #include "Teuchos_StandardCompositionMacros.hpp"
00036 
00037 namespace NLPInterfacePack {
00038 
00044 class NLPDirectThyraModelEvaluator
00045   : virtual public NLPDirect
00046   , virtual public NLPThyraModelEvaluatorBase
00047 {
00048 public:
00049 
00051   STANDARD_COMPOSITION_MEMBERS( Thyra::DirectionalFiniteDiffCalculator<value_type>, direcFiniteDiffCalculator )
00052 
00053   
00054   NLPDirectThyraModelEvaluator();
00055 
00057   NLPDirectThyraModelEvaluator(
00058     const Teuchos::RefCountPtr<Thyra::ModelEvaluator<value_type> >  &model
00059     ,const int                                                      p_idx
00060     ,const int                                                      g_idx
00061     );
00062 
00068   void initialize(
00069     const Teuchos::RefCountPtr<Thyra::ModelEvaluator<value_type> >  &model
00070     ,const int                                                      p_idx
00071     ,const int                                                      g_idx
00072     );
00073 
00076 
00078   void initialize(bool test_setup);
00080   void unset_quantities();
00081 
00083 
00086 
00088   bool supports_Gf() const;
00090   bool supports_Gf_prod() const;
00092   value_type calc_Gf_prod(const Vector& x, const Vector& d, bool newx) const;
00093 
00095 
00098 
00100   Range1D var_dep() const;
00102   Range1D var_indep() const;
00104   const mat_fcty_ptr_t factory_D() const;
00106   const mat_sym_nonsing_fcty_ptr_t factory_S() const;
00108   void calc_point(
00109     const Vector     &x
00110     ,value_type      *f
00111     ,VectorMutable   *c
00112     ,bool            recalc_c
00113     ,VectorMutable   *Gf
00114     ,VectorMutable   *py
00115     ,VectorMutable   *rGf
00116     ,MatrixOp        *GcU
00117     ,MatrixOp        *D
00118     ,MatrixOp        *Uz
00119     ) const;
00121   void calc_semi_newton_step(
00122     const Vector    &x
00123     ,VectorMutable  *c
00124     ,bool           recalc_c
00125     ,VectorMutable  *py
00126     ) const;
00127 
00129 
00130 private:
00131 
00132   mutable Teuchos::RefCountPtr<Thyra::LinearOpWithSolveBase<value_type> >  thyra_C_;
00133   mutable Teuchos::RefCountPtr<Thyra::MultiVectorBase<value_type> >        thyra_N_;
00134   
00135 };  // end class NLPDirectThyraModelEvaluator
00136 
00137 } // end namespace NLPInterfacePack
00138 
00139 #endif  // NLPIP_NLP_DIRECT_THYRA_MODEL_EVALUATOR_HPP

Generated on Thu Sep 18 12:34:37 2008 for MOOCHO/Thyra Adapter Software by doxygen 1.3.9.1