Interior-point-optimisation  1.0-1
Interior-pointoptimisationlibrary
ForwardDifferenceDerivativesEstimates.hpp
Go to the documentation of this file.
1 /*
2  * $Id: ForwardDifferenceDerivativesEstimates.hpp 137 2013-06-29 15:10:31Z jdl3 $
3  * Copyright (C) 2011, 2013 John D Lamb
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or (at
8  * your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 
20 #ifndef IPO_FUNCTION_DETAIL_FORWARDDIFFERENCEDERIVATIVEESTIMATES_HPP
21 #define IPO_FUNCTION_DETAIL_FORWARDDIFFERENCEDERIVATIVEESTIMATES_HPP
22 
23 #include<cmath>
24 #include<limits>
25 #include"../Function.hpp"
26 #include"../DerivativesEstimates.hpp"
28 #include"../../ipo/detail/GSL.hpp"
29 
30 namespace ipo_function {
31  namespace detail {
47  public
49  public:
58  double const h =
59  std::sqrt( std::numeric_limits<double>::
60  epsilon() ),
61  double const h2 =
62  std::
63  sqrt( std::sqrt( std::numeric_limits<double>::
64  epsilon() ) ) );
73  = delete;
94  virtual void setVector( gsl::vector const& vector );
95  protected:
99  double const h2;
100  };
101  }
102 }
103 
104 #endif
virtual void setVector(gsl::vector const &vector)
Set the vector to a new value.
This class estimates a function value, gradient and Hessian at a given vector.
~ForwardDifferenceDerivativesEstimates()=default
Default destructor.
STL namespace.
ForwardDifferenceDerivativesEstimates & operator=(ForwardDifferenceDerivativesEstimates const &)=delete
No copy operator.
Base class for derivative estimates with Hessian.
Namespace for functions that can be used by ipo::Objective and ipo::Constraint.
This class computes a function at a vector.
Definition: Function.hpp:38
This class estimates a function value, gradient and Hessian at a given vector.
double const h2
The quotient size for hessian estimates: default is fourth root of machine epsilon.
ForwardDifferenceDerivativesEstimates(Function &function, double const h=std::sqrt(std::numeric_limits< double >::epsilon()), double const h2=std::sqrt(std::sqrt(std::numeric_limits< double >::epsilon())))
Find forward difference quotient estimates.