% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/solver_utils.R
\name{.solver_assemble_qp_info}
\alias{.solver_assemble_qp_info}
\title{Assemble qp_info from a solve.QP Solution}
\usage{
.solver_assemble_qp_info(
  last_qp_sol,
  beta_block,
  qp_Amat_combined,
  qp_bvec_combined,
  qp_meq_combined,
  converged,
  final_deviance,
  info_matrix = NULL
)
}
\arguments{
\item{last_qp_sol}{Output of \code{quadprog::solve.QP}, or
\code{NULL}.  When \code{NULL} the function returns \code{NULL}.}

\item{beta_block}{Final \eqn{P \times 1} coefficient vector.}

\item{qp_Amat_combined}{Combined equality + inequality constraint
matrix.}

\item{qp_bvec_combined}{Combined constraint right-hand side.}

\item{qp_meq_combined}{Integer; number of leading equality
constraints.}

\item{converged}{Logical; whether the outer loop converged.}

\item{final_deviance}{Scalar deviance at convergence.}

\item{info_matrix}{Optional information matrix; included in the
returned list when non-\code{NULL}.}
}
\value{
A list with elements \code{solution}, \code{lagrangian},
  \code{active_constraints}, \code{iact}, \code{Amat_active},
  \code{bvec_active}, \code{meq_active}, \code{converged}, and
  \code{final_deviance}, plus \code{info_matrix},
  \code{Amat_combined}, \code{bvec_combined}, and
  \code{meq_combined} when \code{info_matrix} is supplied.
  Returns \code{NULL} if \code{last_qp_sol} is \code{NULL}.
}
\description{
Packages the output of \code{quadprog::solve.QP} into the
\code{qp_info} list expected by downstream code (inference,
\code{generate_posterior}, and \code{varcovmat} construction).
}
\details{
Active constraint columns are identified as all equality columns
(\code{1:qp_meq_combined}) plus any inequality column whose
Lagrange multiplier exceeds \code{sqrt(.Machine$double.eps)}.
This matches the convention used in \code{.qp_refine()}.
}
\keyword{internal}
