% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tr_eigen.R
\name{solve_tr_eigen}
\alias{solve_tr_eigen}
\title{Solve Trust-Region Subproblem via Eigendecomposition (Algorithm 5c)}
\usage{
solve_tr_eigen(
  g,
  H,
  radius,
  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{radius}{Trust-region radius (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 (0 if interior Newton step)}
\item{pred_reduction}{Predicted reduction: -g^T s - 1/2 s^T H s}
\item{converged}{TRUE if solver returned a valid step}
\item{case_type}{"interior", "easy", "hard", or "zero_gradient"}
\item{on_boundary}{TRUE if ||s|| == radius (active constraint)}
}
\description{
Solves min_s m(s) = g^T s + 1/2 s^T H s  subject to  ||s|| <= radius
using full eigendecomposition with explicit hard-case detection.
}
\details{
This is the trust-region counterpart to \code{solve_cubic_eigen}. The only
structural difference is the constraint: the cubic solver enforces
\code{lambda = sigma * ||s||}, while the trust-region solver enforces
\code{||s|| <= radius}. Both reduce to \code{(H + lambda*I) s = -g} with
\code{lambda >= max(0, -lambda_min(H))}.

Three cases are handled:
\itemize{
\item \strong{Interior}: H is positive definite and the unconstrained
Newton step \code{-H^{-1} g} lies inside the trust region. Returned
with \code{lambda = 0} and \code{on_boundary = FALSE}.
\item \strong{Easy boundary}: A unique \code{lambda > max(0, -lambda_min)}
places \code{||s(lambda)|| = radius}. Found by Newton on the secular
equation.
\item \strong{Hard case}: Hessian is indefinite and the gradient is
nearly orthogonal to the smallest-eigenvalue eigenvector. Resolved
per More-Sorensen by setting \code{lambda = -lambda_min(H)} and adding
a component along the smallest eigenvector to reach the boundary.
}

Recommended for \code{n <= 500} due to O(n^3) eigendecomposition cost.
}
\keyword{internal}
