|
GlobiPack Version of the Day
|
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_BRENTS_1D_MINIMIZATION_DECL_HPP 00032 #define GLOBIPACK_BRENTS_1D_MINIMIZATION_DECL_HPP 00033 00034 00035 #include "GlobiPack_MeritFunc1DBase.hpp" 00036 #include "Teuchos_Describable.hpp" 00037 #include "Teuchos_VerboseObject.hpp" 00038 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp" 00039 00040 00041 namespace GlobiPack { 00042 00043 00049 template<typename Scalar> 00050 class Brents1DMinimization 00051 : public Teuchos::Describable, 00052 public Teuchos::VerboseObject<Brents1DMinimization<Scalar> >, 00053 public Teuchos::ParameterListAcceptorDefaultBase 00054 { 00055 public: 00056 00059 00061 Brents1DMinimization(); 00062 00064 00067 00069 void setParameterList(RCP<ParameterList> const& paramList); 00071 RCP<const ParameterList> getValidParameters() const; 00072 00074 00077 00111 bool approxMinimize( 00112 const MeritFunc1DBase<Scalar> &phi, 00113 const PointEval1D<Scalar> &pointLower, 00114 const Ptr<PointEval1D<Scalar> > &pointMiddle, 00115 const PointEval1D<Scalar> &pointUpper, 00116 const Ptr<int> &numIters = Teuchos::null 00117 ) const; 00118 00120 00121 private: 00122 00123 // ////////////////////// 00124 // Private data members 00125 00126 Scalar rel_tol_; 00127 Scalar bracket_tol_; 00128 int max_iters_; 00129 00130 }; 00131 00132 00137 template<typename Scalar> 00138 inline 00139 const RCP<Brents1DMinimization<Scalar> > brents1DMinimization() 00140 { 00141 return Teuchos::rcp(new Brents1DMinimization<Scalar>()); 00142 } 00143 00144 00145 // Default values are exposed here for unit testing purposes 00146 00147 00148 namespace Brents1DMinimizationUtils { 00149 00150 00151 const std::string rel_tol_name = "Relative Tol"; 00152 const double rel_tol_default = 1.0e-5; 00153 00154 const std::string bracket_tol_name = "Bracket Tol"; 00155 const double bracket_tol_default = 1.0e-5; 00156 00157 const std::string max_iters_name = "Max Iterations"; 00158 const int max_iters_default = 10; 00159 00160 00161 } // namespace Brents1DMinimizationUtils 00162 00163 00164 00165 } // namespace GlobiPack 00166 00167 00168 #endif // GLOBIPACK_BRENTS_1D_MINIMIZATION_DECL_HPP
1.7.4