c

scalation.minima

ConjugateGradient

class ConjugateGradient extends Minimizer with Error

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 = -gradient (x) + beta * dir_k-1

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

Linear Supertypes
Error, Minimizer, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConjugateGradient
  2. Error
  3. Minimizer
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ConjugateGradient(f: FunctionV2S, g: FunctionV2S = null, ineq: Boolean = true, exactLS: Boolean = true)

    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

    exactLS

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

Type Members

  1. type Pair = (VectorD, VectorD)
    Definition Classes
    Minimizer

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val EPSILON: Double
    Attributes
    protected
    Definition Classes
    Minimizer
  5. val MAX_ITER: Int
    Attributes
    protected
    Definition Classes
    Minimizer
  6. val STEP: Double
    Attributes
    protected
    Definition Classes
    Minimizer
  7. val TOL: Double
    Attributes
    protected
    Definition Classes
    Minimizer
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def beta(gr1: VectorD, gr2: VectorD): Double

    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.

    gr1

    the gradient at the current point

    gr2

    the gradient at the next point

  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. 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.

    x

    the coordinate values of the current point

    Definition Classes
    ConjugateGradientMinimizer
  14. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def lineSearch(x: VectorD, dir: VectorD, step: Double = STEP): Double

    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.

    x

    the current point

    dir

    the direction to move in

    step

    the initial step size

    Definition Classes
    ConjugateGradientMinimizer
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. def setDerivatives(partials: Array[FunctionV2S]): Unit

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

    partials

    the array of partial derivative functions

  23. def solve(x0: VectorD, step: Double = STEP, toler: Double = EPSILON): VectorD

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

    x0

    the starting point

    step

    the initial step size

    toler

    the tolerance

    Definition Classes
    ConjugateGradientMinimizer
  24. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Error

Inherited from Minimizer

Inherited from AnyRef

Inherited from Any

Ungrouped