Пример #1
0
        /// Evaluate the _result of the current interation.
        /// @return the estimated precision of the _result.
        public override double EvaluateIteration()
        {
            double delta = _f.Value(_result) / _df.Value(_result);

            _result -= delta;
            return(RelativePrecision(Math.Abs(delta)));
        }
Пример #2
0
        /// Returns the value of the function's derivative
        /// for the specified variable value.
        public double Value(double x)
        {
            double x1 = x == 0 ? _relativePrecision
                               : x * (1 + _relativePrecision);
            double x2 = 2 * x - x1;

            return((_f.Value(x1) - _f.Value(x2)) / (x1 - x2));
        }
Пример #3
0
 /// @return double	contribution to chi^2 sum against
 ///												a theoretical function
 /// @param f DhbInterfaces.OneVariableFunction
 public double Chi2Contribution(IOneVariableFunction f)
 {
     double residue = _yValue - f.Value(_xValue);
     return residue * residue * _weight;
 }
Пример #4
0
 /// Constructor method
 /// @param x double	position at which the goal function is evaluated.
 /// @param f IOneVariableFunction	function to optimize.
 public OptimizingPoint(double x, IOneVariableFunction f)
 {
     _position = x;
     _value    = f.Value(x);
 }
Пример #5
0
        /// @return double	contribution to chi^2 sum against
        ///												a theoretical function
        /// @param f DhbInterfaces.OneVariableFunction
        public double Chi2Contribution(IOneVariableFunction f)
        {
            double residue = _yValue - f.Value(_xValue);

            return(residue * residue * _weight);
        }