Optimo  0.1.0
A C++ header library for optimization
 All Classes Functions Variables Pages
bfgs_api.h
1 // Copyright (C) 2014 Victor Fragoso <vfragoso@cs.ucsb.edu>
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 //
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following
13 // disclaimer in the documentation and/or other materials provided
14 // with the distribution.
15 //
16 // * Neither the name of the University of California, Santa Barbara nor the
17 // names of its contributors may be used to endorse or promote products
18 // derived from this software without specific prior written permission.
19 //
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 // ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT,
24 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 //
31 
32 #ifndef OPTIMO_SOLVERS_BFGS_API_H_
33 #define OPTIMO_SOLVERS_BFGS_API_H_
34 
35 #include "optimo/core/objects_ls.h"
36 #include <Eigen/Core>
37 #include "optimo/solvers/solver.h"
38 
39 namespace optimo {
40 namespace solvers {
42 
74 template <typename Scalar>
75 class BFGS : public Solver<Scalar> {
76  public:
77  // Constructor for BFGS Solver
78  BFGS(void) { }
79 
80  // Destructor
81  virtual ~BFGS(void) { }
82 
84  TERMINATION_TYPE
85  operator()(const ProblemLS<Scalar>& problem,
86  Eigen::Matrix<Scalar, Eigen::Dynamic, 1>* x,
87  Scalar* min_value);
88 
89  protected:
91  Scalar line_search(const ObjectiveFunctorLS<Scalar>& objective,
92  const Eigen::Matrix<Scalar, Eigen::Dynamic, 1>& x,
93  const Eigen::Matrix<Scalar, Eigen::Dynamic, 1>& p,
94  const Eigen::Matrix<Scalar, Eigen::Dynamic, 1>& g);
95 };
96 } // solvers
97 } // optimo
98 #endif // OPTIMO_SOLVERS_BFGS_API_H_
99 
Abstract class for a Solver algorithm.
Definition: solver.h:53
Objective functor.
Definition: objects_ls.h:51
TERMINATION_TYPE operator()(const ProblemLS< Scalar > &problem, Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > *x, Scalar *min_value)
Solve the problem.
Class defining a convex Problem.
Definition: objects_ls.h:198
Implements the Broyden–Fletcher–Goldfarb–Shanno algorithm.
Definition: bfgs_api.h:75