MLPACK  1.0.10
aug_lagrangian_function.hpp
Go to the documentation of this file.
1 
22 #ifndef __MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
23 #define __MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
24 
25 #include <mlpack/core.hpp>
26 
27 namespace mlpack {
28 namespace optimization {
29 
47 template<typename LagrangianFunction>
49 {
50  public:
58  AugLagrangianFunction(LagrangianFunction& function);
59 
68  AugLagrangianFunction(LagrangianFunction& function,
69  const arma::vec& lambda,
70  const double sigma);
79  double Evaluate(const arma::mat& coordinates) const;
80 
87  void Gradient(const arma::mat& coordinates, arma::mat& gradient) const;
88 
95  const arma::mat& GetInitialPoint() const;
96 
98  const arma::vec& Lambda() const { return lambda; }
100  arma::vec& Lambda() { return lambda; }
101 
103  double Sigma() const { return sigma; }
105  double& Sigma() { return sigma; }
106 
108  const LagrangianFunction& Function() const { return function; }
110  LagrangianFunction& Function() { return function; }
111 
112  // convert the obkect into a string
113  std::string ToString() const;
114 
115  private:
117  LagrangianFunction& function;
118 
120  arma::vec lambda;
122  double sigma;
123 };
124 
125 }; // namespace optimization
126 }; // namespace mlpack
127 
128 // Include basic implementation.
129 #include "aug_lagrangian_function_impl.hpp"
130 
131 #endif // __MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
132 
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.
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'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.