Ejemplo n.º 1
0
 internal static OptBoundVariable[] GetClon(OptBoundVariable[] variables)
 {
     OptBoundVariable[] cloned = new OptBoundVariable[variables.Length];
     for (int i = 0; i < variables.Length; i++)
     {
         cloned[i] = variables[i].GetClon();
     }
     return(cloned);
 }
Ejemplo n.º 2
0
        private OptSimplexBoundVariable[] GetVariables(OptBoundVariable[] variablesArray)
        {
            OptSimplexBoundVariable[] vars = new OptSimplexBoundVariable[variablesArray.Length];

            for (int i = 0; i < variablesArray.Length; i++)
            {
                OptBoundVariable var = variablesArray[i];

                vars[i] = new OptSimplexBoundVariable(var.Name, var.InitialGuess, var.Fixed, var.LowerBound, var.UpperBound);
            }

            return(vars);
        }
Ejemplo n.º 3
0
        private OptSimplexBoundVariable[] GetVariables(OptBoundVariable[] variablesArray)
        {
            OptSimplexBoundVariable[] vars = new OptSimplexBoundVariable[variablesArray.Length];

            for (int i = 0; i < variablesArray.Length; i++)
            {

                OptBoundVariable var = variablesArray[i];

                vars[i] = new OptSimplexBoundVariable(var.Name, var.InitialGuess, var.Fixed, var.LowerBound, var.UpperBound);
            }

            return vars;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Computes the minimum point of a function of several variables.
        /// </summary>
        /// <param name="function">The function to minimize.</param>
        /// <param name="variables">Array of size N containing the varaibles.</param>
        /// <param name="initialStep">The initial change of the variables.</param>
        /// <returns>Array containing the solution.</returns>
        public double[] ComputeMin(OptMultivariateFunction function, OptBoundVariable[] variables, float initialStep)
        {
            if (variables == null) return new double[0];
            if (variables.Length == 0) return new double[0];

            OptSimplexBoundVariable[] simplexVariables = this.GetVariables(variables);
            int maxFunc = this._MaxFunEvaluations;

            return this.GetMinimum(function, simplexVariables, initialStep, this._Tolerance, ref maxFunc);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Computes the minimum point of a function of several variables.
        /// </summary>
        /// <param name="function">The function to minimize.</param>
        /// <param name="gradient">A delegate that computes the gradient.</param>
        /// <param name="variables">Array of size N containing the varaibles.</param>
        /// <returns>Array containing the solution.</returns>
        public double[] ComputeMin(OptMultivariateFunction function, OptMultivariateGradient gradient, OptBoundVariable[] variables)
        {
            if (variables == null) return new double[0];
            if (variables.Length == 0) return new double[0];

            int maxFunc = this._MaxFunEvaluations;

            this._TNDriver.ETA = this._SearchSeverity;
            this._TNDriver.STEPMX = this._MaximunStep;

            double[] minimum = this._TNDriver.ComputeMin(function, gradient, variables, this._Tolerance, this._Accuracy, ref maxFunc);
            this._FunEvaluations = maxFunc;
            return minimum;
        }
Ejemplo n.º 6
0
        internal OptBoundVariable GetClon()
        {
            OptBoundVariable clon = new OptBoundVariable(this._Name, this._InitialGuess, this._Fixed, this._LowerBound, this._UpperBound);

            return(clon);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Computes the minimum point of a function of several variables.
        /// </summary>
        /// <param name="function">The function to minimize.</param>
        /// <param name="gradient">A delegate that computes the gradient.</param>
        /// <param name="variables">Array of size N containing the varaibles.</param>
        /// <returns>Array containing the solution.</returns>
        public double[] ComputeMin(OptMultivariateFunction function, OptMultivariateGradient gradient, OptBoundVariable[] variables)
        {
            if (variables == null) return new double[0];
            if (variables.Length == 0) return new double[0];

            int maxFunc = this._MaxFunEvaluations;

            double[] minimum = this._Driver.ComputeMin(function, gradient, variables, this._Tolerance, this._AccuracyFactor, ref maxFunc);
            this._FunEvaluations = maxFunc;
            return minimum;
        }
Ejemplo n.º 8
0
 internal OptBoundVariable GetClon()
 {
     OptBoundVariable clon = new OptBoundVariable(this._Name, this._InitialGuess, this._Fixed, this._LowerBound, this._UpperBound);
     return clon;
 }
Ejemplo n.º 9
0
 internal static OptBoundVariable[] GetClon(OptBoundVariable[] variables)
 {
     OptBoundVariable[] cloned = new OptBoundVariable[variables.Length];
     for (int i = 0; i < variables.Length; i++)
     {
         cloned[i] = variables[i].GetClon();
     }
     return cloned;
 }