ConjugateGradient

scalation.optimization.ConjugateGradient
class ConjugateGradient(f: FunctionV2S, g: FunctionV2S, ineq: Boolean, exactLS: Boolean) extends Minimizer

The ConjugateGradient class implements the 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 = - grad (x) + beta * dir_k-1

minimize f(x) subject to g(x) <= 0 [ optionally g(x) == 0 ]

Value parameters

exactLS

whether to use exact (e.g., GoldenLS) or inexact (e.g., WolfeLS) Line Search

f

the objective function to be minimized

g

the constraint function to be satisfied, if any

ineq

whether the constraint function must satisfy inequality or equality

Attributes

Graph
Supertypes
trait Minimizer
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def fg(x: VectorD): Double

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.

Value parameters

x

the coordinate values of the current point

Attributes

Definition Classes
def lineSearch(x: VectorD, dir: VectorD, step: Double): Double

Perform an exact GoldenSectionLS or inexact WolfeLS line search. Search in direction dir, returning the distance z to move in that direction.

Perform an exact GoldenSectionLS or inexact WolfeLS line search. Search in direction dir, returning the distance z to move in that direction.

Value parameters

dir

the direction to move in

step

the initial step size

x

the current point

Attributes

def setDerivatives(partials: FunctionV2V): Unit

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).

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).

Value parameters

partials

the array of partial derivative functions

Attributes

def solve(x0: VectorD, step: Double, toler: Double): FuncVec

Solve the Non-Linear Programming (NLP) problem using the PR-CG algorithm. To use explicit functions for gradient, replace ∇(fg, x) with gr(x).

Solve the Non-Linear Programming (NLP) problem using the PR-CG algorithm. To use explicit functions for gradient, replace ∇(fg, x) with gr(x).

Value parameters

step

the initial step size

toler

the tolerance

x0

the starting point

Attributes

Inherited methods

def resolve(n: Int, step_: Double, toler: Double): FuncVec

Solve the following Non-Linear Programming (NLP) problem: min { f(x) | g(x) <= 0 }. To use explicit functions for gradient, replace gradient (fg, x._1 + s) with gradientD (df, x._1 + s). This method uses multiple random restarts.

Solve the following Non-Linear Programming (NLP) problem: min { f(x) | g(x) <= 0 }. To use explicit functions for gradient, replace gradient (fg, x._1 + s) with gradientD (df, x._1 + s). This method uses multiple random restarts.

Value parameters

n

the dimensionality of the search space

step_

the initial step size

toler

the tolerance

Attributes

Inherited from:
Minimizer