This is a ground-up rewrite of CVXR using R's S7 object system, designed to be isomorphic with CVXPY 1.8.1 for long-term maintainability. ~4-5x faster than CVXR 1.0-15 on typical problems.
- S7 class system replaces S4 for all expression, constraint, and problem classes. Significantly faster construction and method dispatch.
- 13 solvers: Clarabel (default), SCS, OSQP, HiGHS, MOSEK, Gurobi, GLPK, GLPK_MI, ECOS, ECOS_BB, CPLEX, CVXOPT, PIQP.
- Mixed-integer programming via GLPK_MI, ECOS_BB, Gurobi, or HiGHS
(
boolean = TRUEorinteger = TRUEinVariable()). - Parameter support via
Parameter()class with DPP (Disciplined Parameterized Programming) for efficient re-solves when only parameter values change. - 50+ atom classes covering LP, QP, SOCP, SDP, exponential cone, and power cone problems.
psolve()as the primary solve interface, returning the optimal value directly.solve()backward-compatibility wrapper returning acvxr_resultlist with$value,$status,$solver,$getValue(), and$getDualValue().verbose = TRUEoption inpsolve()for structured solve output with timing information.- Standard solver parameters (
feastol,reltol,abstol,num_iter) inpsolve()with automatic translation to solver-native names viasolver_default_param(). Solver-native parameters in...take priority. - Automatic solver selection based on problem type.
- Warm-start support for 7 solvers (OSQP, SCS, Clarabel, Gurobi, MOSEK, PIQP; HiGHS blocked by R package limitation).
- Decomposed solve API:
problem_data(),solve_via_data(),problem_unpack_results()for compile-once/solve-many workflows. visualize()for problem introspection: text display with Smith form annotations, interactive HTML output (D3 tree + KaTeX), on-demand DCP violation analysis for non-compliant problems, curvature coloring on constraint nodes, and matrix stuffing visualization (Stages 4-5: Standard Form + Solver Data) via the newsolverparameter.
- S7 classes replace S4. Use
Variable(n)instead ofnew("Variable", n). - Requires R >= 4.3.0 (for
chooseOpsMethod()and S7@support). solve()now returns acvxr_resultS3 list, not an S4 object. Usepsolve()for a direct numeric return value.getValue(x)andgetDualValue(con)are deprecated. Usevalue(x)anddual_value(con)after solving instead.problem_status(),problem_solution(), andget_problem_data()are deprecated. Usestatus(),solution(), andproblem_data()instead.- The
axisparameter uses 1-based indexing matching R'sapply()MARGIN convention:axis = 1for row-wise (reduce columns),axis = 2for column-wise (reduce rows),axis = NULLfor all entries. - Internal class structure completely changed (S7 instead of S4). Code that accessed slots directly will need updating.
- S4 class checks like
is(x, "Variable")no longer work. UseS7_inherits(x, Variable).
ptp(x, axis, keepdims)-- peak-to-peak (range):max(x) - min(x).cvxr_mean(x, axis, keepdims)-- arithmetic mean along an axis.cvxr_std(x, axis, keepdims, ddof)-- standard deviation.cvxr_var(x, axis, keepdims, ddof)-- variance.vdot(x, y)-- vector dot product (inner product).scalar_product(x, y)-- alias forvdot.cvxr_outer(x, y)-- outer product of two vectors.inv_prod(x)-- reciprocal of product of entries.loggamma(x)-- elementwise log of gamma function (piecewise linear approximation).log_normcdf(x)-- elementwise log of standard normal CDF (quadratic approximation).cummax_expr(x, axis)-- cumulative maximum along an axis.dotsort(X, W)-- weighted sorted dot product (generalization ofsum_largest/sum_smallest).diff_pos(),resolvent()-- DGP convenience functions.
status(prob)-- returns the solution status (replacesproblem_status()).solution(prob)-- returns the raw Solution object (replacesproblem_solution()).problem_data(prob, solver)-- returns solver-ready data (replacesget_problem_data()).- Old names still work but emit once-per-session deprecation warnings.
tv()is a deprecated alias fortotal_variation().norm2(x)is a deprecated alias forp_norm(x, 2).multiply(x, y)is a deprecated alias forx * y.installed_solvers()lists available solver packages.
- DPP (Disciplined Parameterized Programming) for efficient parameter re-solve with compilation caching.
- DGP (Disciplined Geometric Programming) via
psolve(prob, gp = TRUE). New atoms:prod_entries(),cumprod(),one_minus_pos(),eye_minus_inv(),pf_eigenvalue(),gmatmul(). - DQCP (Disciplined Quasiconvex Programming) via
psolve(prob, qcp = TRUE). New atoms:ceil_expr(),floor_expr(),condition_number(),gen_lambda_max(),dist_ratio(). - Complex variable support via
Variable(n, complex = TRUE)andComplex2Realreduction. Atoms:Conj_(),Real_(),Imag_(),expr_H()for conjugate transpose. perspective(f, s)atom for perspective functions.FiniteSet(expr, values)constraint for discrete optimization.- Boolean logic atoms:
Not(),And(),Or(),Xor(),implies(),iff(). %>>%and%<<%operators for PSD and NSD constraints.as_cvxr_expr()helper for wrapping R objects as CVXR constants.
- Fixed
kron()KRON_L coefficient matrix construction. - Fixed
CvxAttr2Constrindex type and matrix variable handling. - Fixed Clarabel PowConeND bridge for uniquely-named cones.
- Fixed C++
diagoffset for super/sub-diagonals (k != 0). - Fixed DQCP bisection: infinity check, stale bounds for Maximize, conditional high-endpoint seeding.
- Fixed MOSEK dual extraction (
suc - slcreconstruction). - Fixed OSQP/HiGHS inequality dual sign convention.
- Warm-start for HiGHS is blocked (R
highspackage lackssetSolution()API). - Derivative/sensitivity API deferred (requires
diffcp, no R equivalent). - Deferred to a future release: RelEntrConeQuad, quantum atoms, MOSEK MIP.
- Revert
clarabelrequirement and use enhance rather than import until really necessary (Issue 142). - Update return codes for
user_limitetc to beinfeasible_inaccurateto matchCVXPYfor gurobi - Add an S3 print method for result from
solve(). - Move
upper_tri_to_fullto C++ - Drop use of R6 classes
- Address bug in copying
Powerobject (Issue 145).
- Address further inefficiency in use of diagonal matrices in
qp2quad_form.R - Add initial interface to clarabel solver
- Address inefficient processing of cones for MOSEK (Issue 137 reported by aszekMosek)
- Fix
extract_quadratic_coeffsto use sparse matrix and sweep in place for better memory use (reported by Marissa Reitsma)
Rmosekto be removed from CRAN, so moved to drat repo- Cleaned up some problematic Rd files shown in CRAN results
- Being more careful about coercing to
dgCMatrixvia(as(as(<matrix>, "CsparseMatrix"), "generalMatrix")) - Modify all class inheritance checks to use
inherits()
- Now requiring the updated scs 3.0 as an import
- Now importing ECOSolveR version 0.5.4 and higher
- Added fixes for Matrix 1.3 update
- Somewhat better typesetting for Power class documentation (Issue #86)
- Conforming to CRAN suggestions on non-CRAN packages, but no actual changes.
- Added exponential cone support for
MOSEKand uncommented associated test. - Added JSS publication DOI.
- Many small fixes to solver interfaces
- Reference semantics for
Parameter - Warm start for
OSQPand updates to solver cache - Solver parameter defaults explicit now
- New tests added for solver combinations
- Major release implementing reductions, many new solvers.
- Bug fix: duplicated integer and boolean indices.
- Bug fix: correct typo in constraint specification to GLPK.
- Added tutorial articles based on v0.99 to CVXR website on using other solvers, integer programming, MOSEK and GUROBI examples.
- Minor typographical fixes.
-
Dropped
delay_loadparameter dropped inreticulate::import_from_path, per changes inreticulate. -
Cleaned up hooks into reticulate for commercial solvers.
- Minor typo and documentation fixes.
- Added
LPSOLVEvialpSolveAPI - Added
GLPKviaRglpk - Added
MOSEK - Added
GUROBI - Bug fix: issue #25.
All CVXR expressions retain dimensions. Culprit was
drop = FALSE(in functionIndex.get_special_slice) as suspected.
-
Added a note that CVXR can probably be compiled from source for earlier versions of R. This is issue #24
-
Bug fix: issue #28 Function
intf_sign(interface.R) was unnecessarily using a tolerance parameter, now eliminated.
-
Updated Solver.solve to adapt to new ECOSolveR. Require version 0.4 of ECOSolveR now.
-
Updated
unpack_resultsto behave exactly like in CVXPY. Added documentation and testthat tests. Documented in Getting Faster Results article.
- First CRAN release 2017-11-20.