GlobiPack Version of the Day
GlobiPack_ArmijoPolyInterpLineSearch_decl.hpp
00001 /*
00002 // @HEADER
00003 // ***********************************************************************
00004 // 
00005 //    GlobiPack: Collection of Scalar 1D globalizaton utilities
00006 //                 Copyright (2009) Sandia Corporation
00007 // 
00008 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00009 // license for use of this work by or on behalf of the U.S. Government.
00010 // 
00011 // This library is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Lesser General Public License as
00013 // published by the Free Software Foundation; either version 2.1 of the
00014 // License, or (at your option) any later version.
00015 // 
00016 // This library is distributed in the hope that it will be useful, but
00017 // WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 // 
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 // USA
00025 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00026 // 
00027 // ***********************************************************************
00028 // @HEADER
00029 */
00030 
00031 #ifndef GLOBIPACK_POLY_INTERP_LINE_SEARCH_DECL_HPP
00032 #define GLOBIPACK_POLY_INTERP_LINE_SEARCH_DECL_HPP
00033 
00034 
00035 #include "GlobiPack_LineSearchBase.hpp"
00036 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
00037 
00038 
00039 namespace GlobiPack {
00040 
00041 
00050 template<typename Scalar>
00051 class ArmijoPolyInterpLineSearch
00052   : public LineSearchBase<Scalar>,
00053     protected Teuchos::ParameterListAcceptorDefaultBase
00054 {
00055 public:
00056 
00059 
00061   ArmijoPolyInterpLineSearch();
00062 
00064   Scalar eta() const;
00066   Scalar minFrac() const;
00068   Scalar maxFrac() const;
00070   int minIters() const;
00072   int maxIters() const;
00074   bool doMaxIters() const;
00075 
00077 
00080 
00082   void setParameterList(RCP<ParameterList> const& paramList);
00084   RCP<const ParameterList> getValidParameters() const;
00085 
00087 
00090 
00092   virtual bool requiresBaseDeriv() const;
00093 
00095   virtual bool requiresDerivEvals() const;
00096 
00098   virtual bool doLineSearch(
00099     const MeritFunc1DBase<Scalar> &phi,
00100     const PointEval1D<Scalar> &point_k,
00101     const Ptr<PointEval1D<Scalar> > &point_kp1,
00102     const Ptr<int> &numIters
00103     ) const;
00104 
00106 
00107 private:
00108 
00109   // //////////////////////
00110   // Private data members
00111 
00112   Scalar eta_;
00113   Scalar minFrac_;
00114   Scalar maxFrac_;
00115   int minIters_;
00116   int maxIters_;
00117   bool doMaxIters_;
00118 
00119 };
00120 
00121 
00126 template<typename Scalar>
00127 const RCP<ArmijoPolyInterpLineSearch<Scalar> > armijoQuadraticLineSearch()
00128 {
00129   return Teuchos::rcp(new ArmijoPolyInterpLineSearch<Scalar>());
00130 }
00131 
00132 
00133 // Default values are exposed here for unit testing purposes
00134 
00135 
00136 namespace ArmijoPolyInterpLineSearchUtils {
00137 
00138 
00139 const std::string eta_name = "Armijo Slope Fraction";
00140 const double eta_default = 1.0e-4;
00141 
00142 const std::string minFrac_name = "Min Backtrack Fraction";
00143 const double minFrac_default = 0.1;
00144 
00145 const std::string maxFrac_name = "Max Backtrack Fraction";
00146 const double maxFrac_default = 0.5;
00147 
00148 const std::string minIters_name = "Min Num Iterations";
00149 const int minIters_default = 0;
00150 
00151 const std::string maxIters_name = "Max Num Iterations";
00152 const int maxIters_default = 20;
00153 
00154 const std::string doMaxIters_name = "Do Max Iterations";
00155 const bool doMaxIters_default = false;
00156 
00157 
00158 } // namespace ArmijoPolyInterpLineSearchUtils
00159 
00160 
00161 
00162 } // namespace GlobiPack
00163 
00164 
00165 #endif // GLOBIPACK_POLY_INTERP_LINE_SEARCH_DECL_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends