Uno Uno logo

CRAN status R-universe version R-CMD-check

We provide R bindings to Uno (Unifying Nonlinear Optimization), a C++ solver for nonlinearly constrained optimization, via Uno’s C API. The interface allows you to describe a nonlinear program with R callbacks for objective, gradient, constraints, Jacobian and Lagrangian Hessian and Uno solves it. This is the R analog of the unopy Python binding, intended as the nonlinear (DNLP) solver backend for CVXR.

Two solver paths are provided:

Installation

Install from CRAN as usual or from the repo via:

# install.packages("remotes")
remotes::install_github("bnaras/Uno")

A C++17 compiler and CMake (>= 3.16) are required for source builds as the package builds the underlying Uno and HiGHS from source. MUMPS comes from the rmumps dependency, so there is no separate MUMPS installation. A source build binds to the rmumps installed at the time: rmumps 5.2.1-44 or later through its versioned C interface (rmumps 5.9.1-1 brings MUMPS 5.9.1), rmumps 5.2.1-43 through the legacy dmumps_c entry point.

Quick example

Hock–Schittkowski problem 15 (x* = (0.5, 2), f* = 306.5), solved with the interior-point preset. Derivatives are supplied in COO form (0-based indices); the Hessian is the lower triangle of the Lagrangian.

library(Uno)

objective   <- function(x) 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2
gradient    <- function(x) c(400 * x[1]^3 - 400 * x[1] * x[2] + 2 * x[1] - 2,
                             200 * (x[2] - x[1]^2))
constraints <- function(x) c(x[1] * x[2], x[1] + x[2]^2)
jacobian    <- function(x) c(x[2], 1, x[1], 2 * x[2])
hessian     <- function(x, sigma, lambda)
  c(sigma * (1200 * x[1]^2 - 400 * x[2] + 2),
    -400 * sigma * x[1] - lambda[1],
    200 * sigma - 2 * lambda[2])

res <- uno_solve(
  n = 2L, lb = c(-Inf, -Inf), ub = c(0.5, Inf), sense = "minimize",
  obj = objective, grad = gradient,
  m = 2L, cl = c(1, 0), cu = c(Inf, Inf), cons = constraints,
  jac_rows = c(0L, 1L, 0L, 1L), jac_cols = c(0L, 0L, 1L, 1L), jac = jacobian,
  hess_rows = c(0L, 1L, 1L), hess_cols = c(0L, 0L, 1L), hess = hessian,
  x0 = c(-2, 1), preset = "ipopt", base_indexing = 0L, verbose = FALSE,
  options = list(logger = "SILENT")
)

res$objective   # 306.5
res$primal      # 0.5 2

Any Uno solver option can be passed through options as a named list (applied after the preset). See vignette("Uno") for the full walk-through.

Citation

To cite the R package, run citation("Uno"), or:

Narasimhan B (2026). Uno: R Interface to the Uno Nonlinear Optimization Solver. R package. https://github.com/bnaras/Uno.

To cite the Uno solver itself, use the references its authors maintain under “Cite Uno”: the theory paper (Vanaret and Leyffer, 2026, Mathematical Programming Computation, https://doi.org/10.1007/s12532-026-00310-9) and the software paper (Vanaret and Montoison, 2026, Journal of Open Source Software, https://doi.org/10.21105/joss.10229).

License

MIT. The bundled Uno solver is Copyright Charlie Vanaret and contributors, and the bundled HiGHS solver Copyright the HiGHS authors, both MIT; see inst/COPYRIGHTS for every copyright holder of bundled code.