% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cubic_eigen.R
\name{solve_cubic_eigen}
\alias{solve_cubic_eigen}
\title{Solve Cubic Subproblem via Eigendecomposition (Algorithm 5a)}
\usage{
solve_cubic_eigen(
  g,
  H,
  sigma,
  max_lambda_iter = 50,
  lambda_tol = 1e-10,
  hard_case_tol = 1e-08
)
}
\arguments{
\item{g}{Gradient vector (length n)}

\item{H}{Hessian matrix (n x n symmetric, may be indefinite)}

\item{sigma}{Regularization parameter (positive scalar)}

\item{max_lambda_iter}{Maximum secular equation iterations (default: 50)}

\item{lambda_tol}{Secular equation convergence tolerance (default: 1e-10)}

\item{hard_case_tol}{Hard case detection threshold (default: 1e-8)}
}
\value{
List with:
\item{s}{Solution vector}
\item{lambda}{Lagrange multiplier}
\item{pred_reduction}{Predicted reduction: -g^T s - 1/2 s^T H s - sigma/3 ||s||^3}
\item{converged}{TRUE if secular equation converged}
\item{case_type}{"easy", "hard", or "zero_gradient"}
\item{eigenvalues}{Eigenvalues of \code{H} sorted increasing, or \code{NULL} for
the zero-gradient early-return path. Exposed so callers can reuse
the spectrum (e.g. for \code{lambda_min} in end-of-iteration detectors)
instead of re-decomposing \code{H}.}
}
\description{
Solves min_s m(s) = g^T s + 1/2 s^T H s + sigma/3 ||s||^3 using full
eigendecomposition with explicit hard-case detection.
}
\details{
Uses eigen() for O(n^3) eigendecomposition. Hard case occurs when gradient
is nearly orthogonal to smallest eigenvector (|g_1| < tol_hard * ||g||).
Recommended for n <= 500 due to cubic computational cost.
}
\keyword{internal}
