the objective function to be minimized
the constraint function to be satisfied, if any
whether the constraint function must satisfy inequality or equality
whether to use exact (e.g., GoldenLS) or inexact (e.g., WolfeLS) Line Search
Compute the beta function using the Polak-Ribiere (PR) technique.
Compute the beta function using the Polak-Ribiere (PR) technique. The function determines how much of the prior direction is mixed in with -gradient.
the gradient at the current point
the gradient at the next point
The objective function f plus a weighted penalty based on the constraint function g.
The objective function f plus a weighted penalty based on the constraint function g.
the coordinate values of the current point
Show the flaw by printing the error message.
Show the flaw by printing the error message.
the method where the error occurred
the error message
Perform an exact (GoldenSectionLS) or inexact (WolfeLS) line search.
Perform an exact (GoldenSectionLS) or inexact (WolfeLS) line search. Search in direction 'dir', returning the distance 'z' to move in that direction.
the current point
the direction to move in
the initial step size
Set the partial derivative functions.
Set the partial derivative functions. If these functions are available, they are more efficient and more accurate than estimating the values using difference quotients (the default approach).
the array of partial derivative functions
Solve the Non-Linear Programming (NLP) problem using the PR-CG algorithm.
Solve the Non-Linear Programming (NLP) problem using the PR-CG algorithm. To use explicit functions for gradient, replace 'gradient (fg, x)' with 'gradientD (df, x)'.
the starting point
the initial step size
the tolerence
Polak-Ribiere Conjugate Gradient (PR-CG) Algorithm for solving Non-Linear Programming (NLP) problems. PR-CG determines a search direction as a weighted combination of the steepest descent direction (-gradient) and the previous direction. The weighting is set by the beta function, which for this implementation used the Polak-Ribiere technique.
dir_k = -gradient (x) + beta * dir_k-1
minimize f(x) subject to g(x) <= 0 [ optionally g(x) == 0 ]