% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_B.R
\name{.check_kkt_partitionwise}
\alias{.check_kkt_partitionwise}
\title{Check KKT Conditions for Partition-Wise Active-Set Method}
\usage{
.check_kkt_partitionwise(
  result,
  Ghalf,
  GhalfInv,
  Xy_or_uncon,
  is_path3,
  A_aug,
  n_eq_orig,
  qp_Amat,
  qp_bvec,
  active_ineq,
  K,
  p_expansions,
  family,
  parallel_matmult,
  parallel_aga,
  cl,
  chunk_size,
  num_chunks,
  rem_chunks,
  tol
)
}
\arguments{
\item{result}{List of \eqn{K+1} coefficient column vectors.}

\item{Ghalf}{List of \eqn{\mathbf{G}^{1/2}_k} matrices.}

\item{GhalfInv}{List of \eqn{\mathbf{G}^{-1/2}_k} matrices.}

\item{Xy_or_uncon}{Either the list of cross-products
\eqn{\mathbf{X}_k^{\top}\mathbf{y}_k} (Path 2) or unconstrained
estimates (Path 3).}

\item{is_path3}{Logical; if TRUE, \code{Xy_or_uncon} contains
unconstrained estimates and GhalfInv is used for transformation.}

\item{A_aug}{Augmented constraint matrix (original A plus active
inequality columns).}

\item{n_eq_orig}{Integer; number of original equality constraints
(columns of A before augmentation).}

\item{qp_Amat}{Full inequality constraint matrix.}

\item{qp_bvec}{Full inequality constraint RHS.}

\item{active_ineq}{Integer vector; indices into columns of
\code{qp_Amat} that are currently active.}

\item{K, p_expansions}{Integer dimensions.}

\item{family}{GLM family object.}

\item{parallel_matmult, parallel_aga}{Logical flags.}

\item{cl, chunk_size, num_chunks, rem_chunks}{Parallel parameters.}

\item{tol}{Numeric tolerance for feasibility and multiplier checks.}
}
\value{
A list with components:
\describe{
  \item{feasible}{Logical; TRUE if all inactive inequality constraints
    are satisfied within tolerance.}
  \item{dual_feasible}{Logical; TRUE if all active inequality
    multipliers are non-negative within tolerance.}
  \item{violated}{Integer vector; indices of violated inactive
    constraints (into \code{qp_Amat} columns).}
  \item{drop}{Integer vector; indices of active constraints with
    negative multipliers that should be dropped.}
  \item{multipliers}{Numeric vector of Lagrangian multipliers for
    the active inequality constraints.}
}
}
\description{
Given current constrained coefficient estimates and a set of active
inequality constraints (treated as equalities in the last Lagrangian
projection), checks primal feasibility of inactive constraints and
dual feasibility (non-negative multipliers) of active constraints.
}
\details{
Multipliers for active inequality constraints are recovered from the
OLS fit used in the Lagrangian projection: the fitted coefficients
on \eqn{\mathbf{X}^* = \mathbf{G}^{1/2}\mathbf{A}_{\mathrm{aug}}}
give the Lagrangian multipliers (up to sign and scaling).
}
\keyword{internal}
