---
name: "mlpack_optimization_AugLagrangianFunction"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_optimization_AugLagrangianFunction"
---

# mlpack\_optimization\_AugLagrangianFunction(3)

This is a utility class used by AugLagrangian, meant to wrap a LagrangianFunction into a function usable by a simple optimizer like L-BFGS.

## NAME

mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \> -

This is a utility class used by **AugLagrangian**, meant to wrap a LagrangianFunction into a function usable by a simple optimizer like L-BFGS.

## SYNOPSIS

### Public Member Functions

**AugLagrangianFunction** (LagrangianFunction &**function**)\
 *Initialize the* **AugLagrangianFunction***, but don't set the Lagrange multipliers or penalty parameters yet.*  **AugLagrangianFunction** (LagrangianFunction &**function**, const arma::vec &**lambda**, const double **sigma**)\
 *Initialize the* **AugLagrangianFunction** *with the given LagrangianFunction, Lagrange multipliers, and initial penalty parameter.*  double **Evaluate** (const arma::mat &coordinates) const \
 *Evaluate the objective function of the Augmented Lagrangian function, which is the standard Lagrangian function evaluation plus a penalty term, which penalizes unsatisfied constraints.*  const LagrangianFunction & **Function** () const \
 *Get the Lagrangian function.*  LagrangianFunction & **Function** ()\
 *Modify the Lagrangian function.*  const arma::mat & **GetInitialPoint** () const \
 *Get the initial point of the optimization (supplied by the LagrangianFunction).*  void **Gradient** (const arma::mat &coordinates, arma::mat &gradient) const \
 *Evaluate the gradient of the Augmented Lagrangian function.*  const arma::vec & **Lambda** () const \
 *Get the Lagrange multipliers.*  arma::vec & **Lambda** ()\
 *Modify the Lagrange multipliers.*  double **Sigma** () const \
 *Get sigma (the penalty parameter).*  double & **Sigma** ()\
 *Modify sigma (the penalty parameter).*  std::string **ToString** () const \

### Private Attributes

LagrangianFunction & **function**\
 *Instantiation of the function to be optimized.*  arma::vec **lambda**\
 *The Lagrange multipliers.*  double **sigma**\
 *The penalty parameter.*

## Detailed Description

### template\<typename LagrangianFunction\>class mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>

This is a utility class used by **AugLagrangian**, meant to wrap a LagrangianFunction into a function usable by a simple optimizer like L-BFGS.

Given a LagrangianFunction which follows the format outlined in the documentation for **AugLagrangian**, this class provides **Evaluate()**, **Gradient()**, and **GetInitialPoint()** functions which allow this class to be used with a simple optimizer like L-BFGS.

This class can be specialized for your particular implementation -- commonly, a faster method for computing the overall objective and gradient of the augmented Lagrangian function can be implemented than the naive, default implementation given. Use class template specialization and re-implement all of the methods (unfortunately, C++ specialization rules mean you have to re-implement everything).

**Template Parameters:**

*LagrangianFunction* Lagrangian function to be used.

Definition at line 48 of file aug\_lagrangian\_function.hpp.

## Constructor & Destructor Documentation

### template\<typename LagrangianFunction\> mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::AugLagrangianFunction (LagrangianFunction &function)

Initialize the **AugLagrangianFunction**, but don't set the Lagrange multipliers or penalty parameters yet. Make sure you set the Lagrange multipliers before you use this...

**Parameters:**

*function* Lagrangian function.

### template\<typename LagrangianFunction\> mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::AugLagrangianFunction (LagrangianFunction &function, const arma::vec &lambda, const doublesigma)

Initialize the **AugLagrangianFunction** with the given LagrangianFunction, Lagrange multipliers, and initial penalty parameter.

**Parameters:**

*function* Lagrangian function. \
 *lambda* Initial Lagrange multipliers. \
 *sigma* Initial penalty parameter.

## Member Function Documentation

### template\<typename LagrangianFunction\> double mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::Evaluate (const arma::mat &coordinates) const

Evaluate the objective function of the Augmented Lagrangian function, which is the standard Lagrangian function evaluation plus a penalty term, which penalizes unsatisfied constraints.

**Parameters:**

*coordinates* Coordinates to evaluate function at.

**Returns:**

Objective function.

### template\<typename LagrangianFunction\> const LagrangianFunction& mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::Function () const` [inline]`

Get the Lagrangian function.

Definition at line 108 of file aug\_lagrangian\_function.hpp.

### template\<typename LagrangianFunction\> LagrangianFunction& mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::Function ()` [inline]`

Modify the Lagrangian function.

Definition at line 110 of file aug\_lagrangian\_function.hpp.

### template\<typename LagrangianFunction\> const arma::mat& mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::GetInitialPoint () const

Get the initial point of the optimization (supplied by the LagrangianFunction).

**Returns:**

Initial point.

### template\<typename LagrangianFunction\> void mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::Gradient (const arma::mat &coordinates, arma::mat &gradient) const

Evaluate the gradient of the Augmented Lagrangian function.

**Parameters:**

*coordinates* Coordinates to evaluate gradient at. \
 *gradient* Matrix to store gradient into.

### template\<typename LagrangianFunction\> const arma::vec& mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::Lambda () const` [inline]`

Get the Lagrange multipliers.

Definition at line 98 of file aug\_lagrangian\_function.hpp.

### template\<typename LagrangianFunction\> arma::vec& mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::Lambda ()` [inline]`

Modify the Lagrange multipliers.

Definition at line 100 of file aug\_lagrangian\_function.hpp.

### template\<typename LagrangianFunction\> double mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::Sigma () const` [inline]`

Get sigma (the penalty parameter).

Definition at line 103 of file aug\_lagrangian\_function.hpp.

### template\<typename LagrangianFunction\> double& mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::Sigma ()` [inline]`

Modify sigma (the penalty parameter).

Definition at line 105 of file aug\_lagrangian\_function.hpp.

### template\<typename LagrangianFunction\> std::string mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::ToString () const

## Member Data Documentation

### template\<typename LagrangianFunction\> LagrangianFunction& mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::function` [private]`

Instantiation of the function to be optimized.

Definition at line 117 of file aug\_lagrangian\_function.hpp.

### template\<typename LagrangianFunction\> arma::vec mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::lambda` [private]`

The Lagrange multipliers.

Definition at line 120 of file aug\_lagrangian\_function.hpp.

Referenced by mlpack::optimization::AugLagrangianFunction\< mlpack::optimization::LRSDPFunction \>::Lambda().

### template\<typename LagrangianFunction\> double mlpack::optimization::AugLagrangianFunction\< LagrangianFunction \>::sigma` [private]`

The penalty parameter.

Definition at line 122 of file aug\_lagrangian\_function.hpp.

Referenced by mlpack::optimization::AugLagrangianFunction\< mlpack::optimization::LRSDPFunction \>::Sigma().

## Author

Generated automatically by Doxygen for MLPACK from the source code.
