% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qn_updates.R
\name{update_hybrid}
\alias{update_hybrid}
\title{Hybrid BFGS/SR1 Update with Automatic Routing}
\usage{
update_hybrid(
  b,
  s,
  y,
  bfgs_tol = 1e-10,
  sr1_skip_tol = 1e-08,
  skip_count = 0L,
  restart_threshold = 5L
)
}
\arguments{
\item{b}{Current Hessian approximation (n x n symmetric matrix).}

\item{s}{Step vector: s = x_new - x_old.}

\item{y}{Gradient difference: y = g_new - g_old.}

\item{bfgs_tol}{Tolerance for BFGS curvature condition (default: 1e-10).}

\item{sr1_skip_tol}{Tolerance for SR1 skip test (default: 1e-8).}

\item{skip_count}{Current count of consecutive skipped updates.}

\item{restart_threshold}{Number of consecutive skips before restart
(default: 5).}
}
\value{
A list with components:
\item{b}{Updated Hessian approximation (n x n matrix).}
\item{update_type}{Character: "bfgs", "sr1", "powell", or "skipped".}
\item{skipped}{Logical indicating if no update was applied.}
\item{skip_count}{Updated skip counter (reset on successful update).}
\item{restarted}{Logical indicating if b was reset to scaled identity.}
\item{theta}{Powell damping parameter (only if update_type = "powell").}
}
\description{
Attempts BFGS first, falls back to SR1, then to Powell-damped BFGS.
Provides robust quasi-Newton updates for both convex and nonconvex regions.
}
\details{
Routing priority:
\enumerate{
\item BFGS if y's > bfgs_tol (stable, positive definite)
\item SR1 if |r's| >= sr1_skip_tol * ||r|| * ||s|| (allows indefiniteness)
\item Powell-damped BFGS otherwise (guaranteed update)
}

The hybrid approach is ideal for problems that transition between
convex and nonconvex regions.
}
\references{
Algorithm 4a-hybrid in design/pseudocode.qmd
}
\keyword{internal}
