WebCab Optimization for COM v2.6

EasySolver.SetFunction Method 

Allows you to set the function you wish to optimize.

public void SetFunction(
   Function instanceOfFunction
);

Parameters

instanceOfFunction

Remarks

The type of the function must be either derived from UniDimensionalFunction or MultiDimensionalFunction.

After having set the function, you can set other properties such as the initial point and when you are done, you can make a call to the Solve method in order to find a solution.

Providing the Function

In order to provide a function which is to be used within the algorithms contained within this class you are required to implement one of the following interfaces:

  1. UniDimensionalFunction - In order to provide a uni-dimensional function for which the derivative is not known.
  2. Derivative - In order to provide a uni-dimensional function for which the derivative is known. Note that the Derivative interface inherits the UniDimensionalFunction interface.
  3. MultiDimensionalFunction - In order to provide a multi-dimensional function for which the gradient is not known.
  4. Gradient - In order to provide a multi-dimensional function for which the gradient is known. Note that the Gradient interface inherits from the MultiDimensionalFunction interface.

For further explicit details concerning how these interfaces are implemented (including source code) please see documentation accompanying the relevant interface.

Exceptions

Exception TypeCondition
ReferencedServiceExceptionThrown by one of the optimization classes while attempting to pass on the given function to it.

See Also

EasySolver Class | WebCab.COM.Math.Optimization Namespace | Solve