Xmipp
v3.23.11-Nereus
|
Functions | |
int | RootBracket (int(*Function)(double, void *, double *), void *AuxilliaryData, double *LowerBound, double *UpperBound, double *LowerSample, double *UpperSample, double Tolerance, int *ValidBracket, int *Status) |
int | RootFindBisection (int(*Function)(double, void *, double *), void *AuxilliaryData, double *Root, double LowerBound, double UpperBound, double Tolerance, int *Status) |
int | RootFindBrent (int(*Function)(double, void *, double *), void *AuxilliaryData, double *Root, double LowerBound, double UpperBound, double Tolerance, int *Status) |
int RootBracket | ( | int(*)(double, void *, double *) | Function, |
void * | AuxilliaryData, | ||
double * | LowerBound, | ||
double * | UpperBound, | ||
double * | LowerSample, | ||
double * | UpperSample, | ||
double | Tolerance, | ||
int * | ValidBracket, | ||
int * | Status | ||
) |
Find root by bracketing. Bracketing of a root of (Function) inside the interval [LowerBound, UpperBound]. The purpose is to search for a pair of arguments for which 'Function' differs in sign. The search is conducted within [LowerBound, UpperBound]. At most [(UpperBound - LowerBound) / Tolerance] function evaluations are performed. Even-order roots cannot be bracketed. The evaluation of Function at LowerBound (UpperBound) is returned in LowerSample (UpperSample)
success: return(!ERROR); failure: return(ERROR)
the function 'Function' must be declared as follows:
It must return ERROR upon failure, and !ERROR upon success
It is evaluated for the value of the variable 'myArgument'. The result of the function evaluation must be returned in 'myResult'. The generic pointer 'AuxilliaryData' can be used to pass additional parameters.
What follows is a developed example of the function f(x) = a * x^2 + b * x + c (a, b, and c are free parameters)
int RootFindBisection | ( | int(*)(double, void *, double *) | Function, |
void * | AuxilliaryData, | ||
double * | Root, | ||
double | LowerBound, | ||
double | UpperBound, | ||
double | Tolerance, | ||
int * | Status | ||
) |
Find a root by bisection. Search for a root of (Function) inside the bracketing interval [LowerBound, UpperBound]. The strategy proceeds by iteratively cutting the interval in two equal parts. Even-order roots generally cannot be found. Only one root is returned, even if there are several ones. Tolerance is relative to the size of the bracketing interval
success: return(!ERROR); failure: return(ERROR)
The function 'Function' must be declared as follows:
It must return ERROR upon failure, and !ERROR upon success. It is evaluated for the value of the variable 'myArgument'. The result of the function evaluation must be returned in 'myResult'. The generic pointer 'AuxilliaryData' can be used to pass additional parameters.
What follows is a developed example of the function f(x) = a * x^2 + b * x + c (a, b, and c are free parameters)
int RootFindBrent | ( | int(*)(double, void *, double *) | Function, |
void * | AuxilliaryData, | ||
double * | Root, | ||
double | LowerBound, | ||
double | UpperBound, | ||
double | Tolerance, | ||
int * | Status | ||
) |
Find root using Brent algorithm. Search for a root of (Function) inside the bracketing interval [LowerBound, UpperBound]. The strategy proceeds by fitting an inverse quadratic function and by using the root that belong to the interval. If any even-order roots generally cannot be found. Only one root is returned, even if there are several ones. Tolerance is relative to the size of the bracketing interval.
success: return(!ERROR); failure: return(ERROR)
The function 'Function' must be declared as follows:
It must return ERROR upon failure, and !ERROR upon success. It is evaluated for the value of the variable 'myArgument'. The result of the function evaluation must be returned in 'myResult'. The generic pointer 'AuxilliaryData' can be used to pass additional parameters.
What follows is a developed example of the function f(x) = a * x^2 + b * x + c (a, b, and c are free parameters)