mlpack  2.0.1
aug_lagrangian_function.hpp
Go to the documentation of this file.
1 
14 #ifndef __MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
15 #define __MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
16 
17 #include <mlpack/core.hpp>
18 
19 namespace mlpack {
20 namespace optimization {
21 
39 template<typename LagrangianFunction>
41 {
42  public:
50  AugLagrangianFunction(LagrangianFunction& function);
51 
60  AugLagrangianFunction(LagrangianFunction& function,
61  const arma::vec& lambda,
62  const double sigma);
71  double Evaluate(const arma::mat& coordinates) const;
72 
79  void Gradient(const arma::mat& coordinates, arma::mat& gradient) const;
80 
87  const arma::mat& GetInitialPoint() const;
88 
90  const arma::vec& Lambda() const { return lambda; }
92  arma::vec& Lambda() { return lambda; }
93 
95  double Sigma() const { return sigma; }
97  double& Sigma() { return sigma; }
98 
100  const LagrangianFunction& Function() const { return function; }
102  LagrangianFunction& Function() { return function; }
103 
104  private:
106  LagrangianFunction& function;
107 
109  arma::vec lambda;
111  double sigma;
112 };
113 
114 } // namespace optimization
115 } // namespace mlpack
116 
117 // Include basic implementation.
118 #include "aug_lagrangian_function_impl.hpp"
119 
120 #endif // __MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
121 
double & Sigma()
Modify sigma (the penalty parameter).
double Evaluate(const arma::mat &coordinates) const
Evaluate the objective function of the Augmented Lagrangian function, which is the standard Lagrangia...
const LagrangianFunction & Function() const
Get the Lagrangian function.
Linear algebra utility functions, generally performed on matrices or vectors.
const arma::vec & Lambda() const
Get the Lagrange multipliers.
void Gradient(const arma::mat &coordinates, arma::mat &gradient) const
Evaluate the gradient of the Augmented Lagrangian function.
double Sigma() const
Get sigma (the penalty parameter).
AugLagrangianFunction(LagrangianFunction &function)
Initialize the AugLagrangianFunction, but don&#39;t set the Lagrange multipliers or penalty parameters ye...
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
arma::vec & Lambda()
Modify the Lagrange multipliers.
This is a utility class used by AugLagrangian, meant to wrap a LagrangianFunction into a function usa...
const arma::mat & GetInitialPoint() const
Get the initial point of the optimization (supplied by the LagrangianFunction).
LagrangianFunction & Function()
Modify the Lagrangian function.