Augmented Lagrangian method for constrained non-linear optimization.
Inheritance Hierarchy Namespace: Accord.Math.OptimizationAccord.Math (in Accord.Math.dll) Version: 3.8.0
Syntaxpublic class AugmentedLagrangian : BaseGradientOptimizationMethod, IGradientOptimizationMethod, IOptimizationMethod, IOptimizationMethod<double[], double>, IGradientOptimizationMethod<double[], double>, IFunctionOptimizationMethod<double[], double>, IOptimizationMethod<AugmentedLagrangianStatus>, IOptimizationMethod<double[], double, AugmentedLagrangianStatus>
Public Class AugmentedLagrangian Inherits BaseGradientOptimizationMethod Implements IGradientOptimizationMethod, IOptimizationMethod, IOptimizationMethod(Of Double(), Double), IGradientOptimizationMethod(Of Double(), Double), IFunctionOptimizationMethod(Of Double(), Double), IOptimizationMethod(Of AugmentedLagrangianStatus), IOptimizationMethod(Of Double(), Double, AugmentedLagrangianStatus)Request Example View Source
The AugmentedLagrangian type exposes the following members.
Constructors Properties Methods Name Description EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object.) FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.) GetHashCodeServes as the default hash function.
(Inherited from Object.) GetTypeGets the Type of the current instance.
(Inherited from Object.) MaximizeFinds the maximum value of a function. The solution vector will be made available at the
Solutionproperty.
(Inherited from BaseGradientOptimizationMethod.) Maximize(Double)Finds the maximum value of a function. The solution vector will be made available at the
Solutionproperty.
(Inherited from BaseOptimizationMethod.) MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object.) MinimizeFinds the minimum value of a function. The solution vector will be made available at the
Solutionproperty.
(Inherited from BaseGradientOptimizationMethod.) Minimize(Double)Finds the minimum value of a function. The solution vector will be made available at the
Solutionproperty.
(Inherited from BaseOptimizationMethod.) OnNumberOfVariablesChangedCalled when the
NumberOfVariablesproperty has changed.
(Inherited from BaseOptimizationMethod.) OptimizeImplements the actual optimization algorithm. This method should try to minimize the objective function.
(Overrides BaseOptimizationMethodOptimize.) ToStringReturns a string that represents the current object.
(Inherited from Object.) Top Extension Methods Name Description HasMethodChecks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) IsEqualCompares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.) To(Type) Overloaded.Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) ToT Overloaded.Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) Top Remarks ExamplesIn this framework, it is possible to state a non-linear programming problem using either symbolic processing or vector-valued functions. The following example demonstrates the symbolic processing case:
double x = 0, y = 0; var f = new NonlinearObjectiveFunction( function: () => 100 * Math.Pow(y - x * x, 2) + Math.Pow(1 - x, 2), gradient: () => new[] { 2 * (200 * Math.Pow(x, 3) - 200 * x * y + x - 1), 200 * (y - x*x) } ); var constraints = new List<NonlinearConstraint>() { new NonlinearConstraint(f, function: () => x, shouldBe: ConstraintType.GreaterThanOrEqualTo, value: 0, gradient: () => new[] { 1.0, 0.0 } ), new NonlinearConstraint(f, function: () => y, shouldBe: ConstraintType.GreaterThanOrEqualTo, value: 0, gradient: () => new[] { 0.0, 1.0 } ) }; var solver = new AugmentedLagrangian(f, constraints); bool success = solver.Minimize(); double[] solution = solver.Solution; double minValue = solver.Value;
And this is the same example as before, but using standard vectors instead.
var f = new NonlinearObjectiveFunction(numberOfVariables: 2, function: (x) => 100 * Math.Pow(x[1] - x[0] * x[0], 2) + Math.Pow(1 - x[0], 2), gradient: (x) => new[] { 2 * (200 * Math.Pow(x[0], 3) - 200 * x[0] * x[1] + x[0] - 1), 200 * (x[1] - x[0]*x[0]) } ); double[,] a = Matrix.Identity(2); double[] b = Vector.Zeros(2); int numberOfEqualities = 0; var linearConstraints = LinearConstraintCollection.Create(a, b, numberOfEqualities); var solver = new AugmentedLagrangian(f, linearConstraints); bool success = solver.Minimize(); double[] solution = solver.Solution; double minValue = solver.Value;See Also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4