queso-0.53.0
GslOptimizer.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_GSL_OPTIMIZER_H
26 #define UQ_GSL_OPTIMIZER_H
27 
28 #include <queso/Optimizer.h>
29 
30 namespace QUESO {
31 
42 class Vector;
43 class GslVector;
44 class GslMatrix;
45 class OptimizerMonitor;
46 
47 template <class V, class M>
48 class BaseScalarFunction;
49 
50 class GslOptimizer : public BaseOptimizer {
51 public:
53 
58 
60  virtual ~GslOptimizer();
61 
63 
66  virtual void minimize(OptimizerMonitor* monitor = NULL);
67 
70 
79 
81  void setInitialPoint(const GslVector & intialPoint);
82 
84 
88  const GslVector & minimizer() const;
89 
90  void set_solver_type( SolverType solver );
91 
92  void set_solver_type( std::string& solver );
93 
94  SolverType string_to_enum( std::string& solver );
95 
97 
102  void set_step_size( const GslVector& step_size );
103 
105 
109  void set_step_size( double step_size );
110 
112 
117  void set_line_tol( double tol );
118 
119 private:
121 
124 
126 
129 
132 
134  double m_line_tol;
135 
137  bool solver_needs_gradient(SolverType solver);
138 
139  void minimize_with_gradient( unsigned int dim, OptimizerMonitor* monitor );
140 
141  void minimize_no_gradient( unsigned int dim, OptimizerMonitor* monitor );
142 
143 };
144 
145 } // End namespace QUESO
146 
147 #endif // UQ_GSL_OPTIMIZER_H
GslVector * m_minimizer
Definition: GslOptimizer.h:123
void set_solver_type(SolverType solver)
Definition: GslOptimizer.C:230
void setInitialPoint(const GslVector &intialPoint)
Set the point at which the optimization starts.
Definition: GslOptimizer.C:217
virtual ~GslOptimizer()
Destructor.
Definition: GslOptimizer.C:177
GslOptimizer(const BaseScalarFunction< GslVector, GslMatrix > &objectiveFunction)
Constructs an object that will maximize a scalar function.
Definition: GslOptimizer.C:157
void set_step_size(const GslVector &step_size)
Sets step size used in gradient-free solvers.
Definition: GslOptimizer.C:465
void set_line_tol(double tol)
Set GSL line minimization tolerance.
double m_line_tol
Line minimization tolerance in gradient-based algorithms.
Definition: GslOptimizer.h:134
GslVector m_fstep_size
For use in gradient-free algorithms.
Definition: GslOptimizer.h:128
A templated (base) class for handling scalar functions.
SolverType string_to_enum(std::string &solver)
Definition: GslOptimizer.C:475
A base class for handling optimisation of scalar functions.
Definition: Optimizer.h:44
GslVector * m_initialPoint
Definition: GslOptimizer.h:122
virtual void minimize(OptimizerMonitor *monitor=NULL)
Minimize the objective function, starting at m_initialPoint.
Definition: GslOptimizer.C:182
Class for vector operations using GSL library.
Definition: GslVector.h:48
bool solver_needs_gradient(SolverType solver)
Helper function.
Definition: GslOptimizer.C:235
Object to monitor convergence of optimizers.
const BaseScalarFunction< GslVector, GslMatrix > & m_objectiveFunction
Definition: GslOptimizer.h:120
const BaseScalarFunction< GslVector, GslMatrix > & objectiveFunction() const
Returns the objective function.
Definition: GslOptimizer.C:211
void minimize_no_gradient(unsigned int dim, OptimizerMonitor *monitor)
Definition: GslOptimizer.C:363
SolverType m_solver_type
Definition: GslOptimizer.h:125
double m_fdfstep_size
For use in gradient-based algorithms.
Definition: GslOptimizer.h:131
void minimize_with_gradient(unsigned int dim, OptimizerMonitor *monitor)
Definition: GslOptimizer.C:266
int dim
Definition: ann2fig.cpp:81
A base class for handling optimisation of scalar functions.
Definition: GslOptimizer.h:50
const GslVector & minimizer() const
Return the point that minimizes the objective function.
Definition: GslOptimizer.C:225

Generated on Thu Jun 11 2015 13:52:31 for queso-0.53.0 by  doxygen 1.8.5