A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://accord-framework.net/docs/html/T_Accord_Math_Optimization_AugmentedLagrangian.htm below:

AugmentedLagrangian Class

Augmented Lagrangian method for constrained non-linear optimization.

Inheritance Hierarchy Namespace:  Accord.Math.Optimization
Assembly:

Accord.Math (in Accord.Math.dll) Version: 3.8.0

Syntax
public 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 Equals

Determines whether the specified object is equal to the current object.

(Inherited from Object.) Finalize

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

(Inherited from Object.) GetHashCode

Serves as the default hash function.

(Inherited from Object.) GetType

Gets the Type of the current instance.

(Inherited from Object.) Maximize

Finds the maximum value of a function. The solution vector will be made available at the

Solution

property.

(Inherited from BaseGradientOptimizationMethod.) Maximize(Double)

Finds the maximum value of a function. The solution vector will be made available at the

Solution

property.

(Inherited from BaseOptimizationMethod.) MemberwiseClone

Creates a shallow copy of the current Object.

(Inherited from Object.) Minimize

Finds the minimum value of a function. The solution vector will be made available at the

Solution

property.

(Inherited from BaseGradientOptimizationMethod.) Minimize(Double)

Finds the minimum value of a function. The solution vector will be made available at the

Solution

property.

(Inherited from BaseOptimizationMethod.) OnNumberOfVariablesChanged

Called when the

NumberOfVariables

property has changed.

(Inherited from BaseOptimizationMethod.) Optimize

Implements the actual optimization algorithm. This method should try to minimize the objective function.

(Overrides BaseOptimizationMethodOptimize.) ToString

Returns a string that represents the current object.

(Inherited from Object.) Top Extension Methods   Name Description HasMethod

Checks whether an object implements a method with the given name.

(Defined by ExtensionMethods.) IsEqual

Compares 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 Examples

In 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