% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cone_program.R
\name{solve_and_derivative}
\alias{solve_and_derivative}
\title{Solve a cone program and return forward / adjoint derivative operators}
\usage{
solve_and_derivative(
  A,
  b,
  c,
  cone_dict,
  P = NULL,
  solve_method = "Clarabel",
  mode = "lsqr",
  warm_start = NULL,
  ...
)
}
\arguments{
\item{A}{A sparse \code{dgCMatrix} constraint matrix.}

\item{b}{A numeric offset vector.}

\item{c}{A numeric objective coefficient vector.}

\item{cone_dict}{A named list with cone sizes (keys among
\code{"z"}, \code{"l"}, \code{"q"}, \code{"s"}, \code{"ep"}, \code{"ed"}).}

\item{P}{Optional sparse \code{dgCMatrix} for QP objective.}

\item{solve_method}{One of \code{"Clarabel"} (default) or \code{"SCS"}.}

\item{mode}{Differentiation mode: \code{"lsqr"} (default), \code{"dense"},
or \code{"lpgd"}.}

\item{warm_start}{Optional warm-start \code{list(x, y, s)}.}

\item{...}{Additional control parameters forwarded to the solver.}
}
\value{
A list with elements \code{x}, \code{y}, \code{s}, \code{info}, \code{D}, \code{DT}.
\code{info} is the solver-status block returned by the underlying
solver (\code{status}, \code{iter}, \code{solveTime}, \code{pobj}, ...); see
\code{solve_only} for the same shape.
}
\description{
Mirrors \code{diffcp.cone_program.solve_and_derivative}. Solves
minimize  c^T x        s.t.  A x + s = b,  s in K
(with optional QP \verb{0.5 x^T P x} term) and returns the optimal
\verb{(x, y, s)} together with closures \code{D} (forward) and \code{DT} (adjoint)
that map perturbations of \verb{(A, b, c, [P])} to perturbations of
\verb{(x, y, s)} and vice versa.
}
