Interior-point-optimisation  1.0-1
Interior-pointoptimisationlibrary
PhaseIBoundedVariableFunctionAndDerivatives.hpp
Go to the documentation of this file.
1 /*
2  * $Id: PhaseIBoundedVariableFunctionAndDerivatives.hpp 155 2013-06-30 11:24:11Z jdl3 $
3  * Copyright (C) 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_PHASEIBOUNDEDVARIABLEFUNCTIONANDDERIVATIVES_HPP
21 #define IPO_FUNCTION_DETAIL_PHASEIBOUNDEDVARIABLEFUNCTIONANDDERIVATIVES_HPP
22 
23 #include"../Function.hpp"
24 #include"../DerivativesEstimates.hpp"
25 
26 namespace ipo_function {
27  namespace detail {
48  public DerivativesEstimates {
49  public:
59  bool const upperBound );
66  double operator()( gsl::vector const& vector );
72  gsl::vector gradient( gsl::vector const& vector );
78  gsl::matrix hessian( gsl::vector const& vector );
83  void setVector( gsl::vector const& vector );
84  private:
88  Function& function;
92  double const b;
97  bool const upperBound;
98  };
99 
100  }
101 }
102 
103 #endif
void setVector(gsl::vector const &vector)
Set a vector and compute function value, gradient and Hessian efficiently.
double operator()(gsl::vector const &vector)
The function operator: computes or according as is an upper or lower bound.
virtual gsl::matrix hessian() const
virtual gsl::vector gradient() const
Base class for derivative estimates with Hessian.
Function for Phase I (feasibility) of interior-point optimisation.
PhaseIBoundedVariableFunctionAndDerivatives(double const b, bool const upperBound)
Construct from a function and bound.
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
bool const upperBound
A boolean value: true or false according as b is an upper bound or lower.