Class BinarySolverUtil
Utility class providing binary solving methods for one-dimensional functions.
public static class BinarySolverUtil
- Inheritance
-
BinarySolverUtil
- Inherited Members
Methods
CenterSplitionSolve(Func<double, double>, double, double, double, double, double, Func<double, bool>, int)
Solves for a target y-value using the center splitting method.
public static IEnumerable<BinarySolvingStatus> CenterSplitionSolve(Func<double, double> func, double x0, double y0, double x1, double yTarget, double convergenceLimit, Func<double, bool> isYAcceptableFunc, int maxIteration = 12)
Parameters
funcFunc<double, double>The function to solve
x0doubleInitial x value
y0doubleInitial y value (func(x0))
x1doubleSecond x value
yTargetdoubleTarget y value to solve for
convergenceLimitdoubleConvergence limit (acceptable error)
isYAcceptableFuncFunc<double, bool>Function to determine if a y value is acceptable
maxIterationintMaximum number of iterations
Returns
- IEnumerable<BinarySolvingStatus>
A sequence of solving status objects showing the progress of the solution
CenterSplitionSolveWithY1(Func<double, double>, double, double, double, double, double, double, Func<double, bool>, int)
Solves for a target y-value using the center splitting method with a pre-calculated y1 value.
public static IEnumerable<BinarySolvingStatus> CenterSplitionSolveWithY1(Func<double, double> func, double x0, double y0, double x1, double y1, double yTarget, double convergenceLimit, Func<double, bool> isYAcceptableFunc, int maxIteration = 12)
Parameters
funcFunc<double, double>The function to solve
x0doubleInitial x value
y0doubleInitial y value (func(x0))
x1doubleSecond x value
y1doubleSecond y value (func(x1))
yTargetdoubleTarget y value to solve for
convergenceLimitdoubleConvergence limit (acceptable error)
isYAcceptableFuncFunc<double, bool>Function to determine if a y value is acceptable
maxIterationintMaximum number of iterations
Returns
- IEnumerable<BinarySolvingStatus>
A sequence of solving status objects showing the progress of the solution
SlopeSolve(Func<double, double>, double, double, double, double, double, int)
Solves for a target y-value using the slope method.
public static IEnumerable<BinarySolvingStatus> SlopeSolve(Func<double, double> func, double x0, double y0, double x1, double yTarget, double convergenceLimit, int maxIteration = 12)
Parameters
funcFunc<double, double>The function to solve
x0doubleInitial x value
y0doubleInitial y value (func(x0))
x1doubleSecond x value
yTargetdoubleTarget y value to solve for
convergenceLimitdoubleConvergence limit (acceptable error)
maxIterationintMaximum number of iterations
Returns
- IEnumerable<BinarySolvingStatus>
A sequence of solving status objects showing the progress of the solution
SlopeSolveWithY1(Func<double, double>, double, double, double, double, double, double, int)
Solves for a target y-value using the slope method with a pre-calculated y1 value.
public static IEnumerable<BinarySolvingStatus> SlopeSolveWithY1(Func<double, double> func, double x0, double y0, double x1, double y1, double yTarget, double convergenceLimit, int maxIteration = 12)
Parameters
funcFunc<double, double>The function to solve
x0doubleInitial x value
y0doubleInitial y value (func(x0))
x1doubleSecond x value
y1doubleSecond y value (func(x1))
yTargetdoubleTarget y value to solve for
convergenceLimitdoubleConvergence limit (acceptable error)
maxIterationintMaximum number of iterations
Returns
- IEnumerable<BinarySolvingStatus>
A sequence of solving status objects showing the progress of the solution