mlpack  master
aug_lagrangian_function.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
13 #define MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace optimization {
19 
37 template<typename LagrangianFunction>
39 {
40  public:
48  AugLagrangianFunction(LagrangianFunction& function);
49 
58  AugLagrangianFunction(LagrangianFunction& function,
59  const arma::vec& lambda,
60  const double sigma);
69  double Evaluate(const arma::mat& coordinates) const;
70 
77  void Gradient(const arma::mat& coordinates, arma::mat& gradient) const;
78 
85  const arma::mat& GetInitialPoint() const;
86 
88  const arma::vec& Lambda() const { return lambda; }
90  arma::vec& Lambda() { return lambda; }
91 
93  double Sigma() const { return sigma; }
95  double& Sigma() { return sigma; }
96 
98  const LagrangianFunction& Function() const { return function; }
100  LagrangianFunction& Function() { return function; }
101 
102  private:
104  LagrangianFunction& function;
105 
107  arma::vec lambda;
109  double sigma;
110 };
111 
112 } // namespace optimization
113 } // namespace mlpack
114 
115 // Include basic implementation.
116 #include "aug_lagrangian_function_impl.hpp"
117 
118 #endif // MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
119 
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.
Definition: binarize.hpp:18
const arma::vec & Lambda() const
Get the Lagrange multipliers.
The core includes that mlpack expects; standard C++ includes and Armadillo.
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...
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.