TMtxOptimization.VariableParameters Property

TVec VariableParameters { get; set; }

Set/read the variables in minimized function.

Result: stored in self (calling object), returns self for chaining

Remarks:

Access the VariableParameters vector to set/read the variables in minimized function. To define number of variables and their initial values, set the VariableParameters vector Length and Values properties. Read the VariableParameters Values property to get the function minimum position.

Examples
using Dew.Math;
using Dew.Math.Units;
using Dew.Math.Editors;

double Banana(TVec Pars, TVec Consts, object[] objs)
{
    return 100*Math387.IntPower(Pars[1]-Math387.IntPower(Pars[0],2),2) + Math387.IntPower(1-Pars[0],1);
}

void Example(TMtxOptim opt1)
{
    // function with two variables
    // initial values for variables => Pars[0] := 2, Pars[1] := -1;
    opt1.VariableParameters.SetIt(false,new double[] {2,-1});
    opt1.RealFunction = Banana;
    opt1.OptimizationMethod = optMarquardt;
    // numeric approximation
    opt1.GradProcedure = null;
    opt1.GradHessProcedure = null;
    opt1.Recalculate();
    // now VariableParameters holds minimum position
    MtxVecEdit.ViewValues(opt1.VariableParameters,"Minimum position");
}
See Also: TMtxOptimization.ConstantParameters, TMtxOptimization.SetObjects, TMtxOptimization.RealFunction