{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

linesearch2

# linesearch2 - Bracketing phase Given 1 and 0 0 for i = 1 2...

This preview shows pages 1–2. Sign up to view the full content.

Bracketing phase Given: α 1 and φ , φ 0 α 0 0 for i = 1 , 2 ,... evaluate φ ( α i ) if φ ( α i ) > φ (0) + c 1 α i φ 0 (0) or ( i > 1 and φ ( α i ) φ ( α i - 1 ) ) then return zoom ( α i - 1 i ) evaluate φ 0 ( α i ) if | φ 0 ( α i ) | ≤ c 2 | φ 0 (0) | then return α i if φ 0 ( α i ) 0 then return zoom ( α i i - 1 ) choose α i +1 > α i end for Zoom phase function zoom ( α lo hi ) repeat interpolate to find α between α lo and α hi evaluate φ ( α ) if φ ( α ) > φ (0) + c 1 αφ 0 (0) /* (W1) fails */ or φ ( α ) φ ( α lo ) then α hi α else evaluate φ 0 ( α ) if | φ 0 ( α ) | ≤ c 2 | φ 0 (0) | /* (W2b) */ then return α if φ 0 ( α )( α hi - α lo ) 0 then

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
α hi α lo ; α lo α else α lo α end repeat end function Loop invariants for start of zoom
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

linesearch2 - Bracketing phase Given 1 and 0 0 for i = 1 2...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online