object

barzilai_borwein(Problem)

  • Problem - Problem object implementing local_optimization_problem_protocol and defining gradient/2.

Barzilai-Borwein (BB) gradient method with adaptive step sizes. Requires the problem to define gradient/2. Supports box constraints via projection, minimization and maximization, and BB1 / BB2 / alternating formulas.

Availability:
logtalk_load(local_optimization(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-09-03
Compilation flags:
static, context_switching_calls
Remarks:
  • Step formulas: formula(bb1) uses alpha = (s*s)/(s*y) (long step). formula(bb2) uses alpha = (s*y)/(y*y) (short step). formula(alternate) (default) switches between BB1 and BB2 each iteration.

  • Safeguards: When the denominator is near zero or the computed step is outside [step_min, step_max], the previous accepted step (or step_size on the first iteration) is reused.

  • Line search: Optional non-monotone Armijo acceptance controlled by line_search(none|armijo). The default none accepts the pure BB step.

  • Bounds: When the problem defines position_bounds/1, trial points are projected onto the box after each step.

Public predicates

(no local declarations; see entity ancestors if any)

Protected predicates

(no local declarations; see entity ancestors if any)

Private predicates

(no local declarations; see entity ancestors if any)

Operators

(none)