GoldenSectionLS

scalation.optimization.GoldenSectionLS
class GoldenSectionLS(f: FunctionS2S, τ: Double) extends LineSearch

The GoldenSectionLS class performs a line search on 'f(x)' to find a minimal value for 'f'. It requires no derivatives and only one functional evaluation per iteration. A search is conducted from 'x1' (often 0) to 'xmax'. A guess for 'xmax' must be given, but can be made larger during the expansion phase, that occurs before the recursive golden section search is called. It works on scalar functions (see goldenSectionLSTest). If starting with a vector function 'f(x)', simply define a new function 'g(y) = x0 + direction * y' (see goldenSectionLSTest2).

Value parameters

f

the scalar objective function to minimize

τ

the tolerance for breaking the iterations

Attributes

Graph
Supertypes
trait LineSearch
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def gsection(left: Boolean, x1: Double, x2: Double, x3: Double, f2: Double): Double

A recursive golden section search requiring only one functional evaluation per call. It works by comparing two center points x2 (given) and x4 computed.

A recursive golden section search requiring only one functional evaluation per call. It works by comparing two center points x2 (given) and x4 computed.

Value parameters

f2

the functional value for the x2 center point

left

whether to search left (true) or right (false) side of last interval

x1

the left-most point

x2

the center point (.618 across for left and .382 across for right)

x3

the right-most point

Attributes

def lsearch(xmax: Double, x1: Double): Double

Perform an exact Line Search (LS) using the Golden Search Algorithm. Two phases are used: an expansion phase (moving the end-point) to find a down-up pattern, followed by a traditional golden section search.

Perform an exact Line Search (LS) using the Golden Search Algorithm. Two phases are used: an expansion phase (moving the end-point) to find a down-up pattern, followed by a traditional golden section search.

Value parameters

x1

the left (smallest) anchor point for the search (usually 0)

xmax

a rough guess for the right end-point of the line search

Attributes

def printGolden(): Unit

Print the golden ratio and the golden section.

Print the golden ratio and the golden section.

Attributes

def search(step: Double): Double

Perform an exact Line Search (LS) using the Golden Search Algorithm with defaults.

Perform an exact Line Search (LS) using the Golden Search Algorithm with defaults.

Value parameters

step

the initial step size

Attributes

Inherited fields

protected val EPSILON: Double

Attributes

Inherited from:
LineSearch