Skip to content
Skills Library
Programming · Building & coding

nvidia-cuopt-numerical-optimization-api-c

/nvidia-cuopt-numerical-optimization-api-c

LP, MILP, and QP (beta) with cuOpt — C API only. Use when the user is embedding LP, MILP, or QP in C/C++.

Licence
Apache-2.0
Last repository change
15.07.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
18
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 15.07.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

LP, MILP, and QP (beta) with cuOpt — C API only. Use when the user is embedding LP, MILP, or QP in C/C++.

Original author description

LP, MILP, and QP (beta) with cuOpt — C API only. Use when the user is embedding LP, MILP, or QP in C/C++.

How it works

  1. Quick Reference: C API
  2. QP via C API (beta)
  3. Debugging (MPS / C)
  4. Examples
  5. Escalate
Original SKILL.md headings · 65 lines, 337 words
SKILL.md preview
---
name: nvidia-cuopt-numerical-optimization-api-c
description: LP, MILP, and QP (beta) with cuOpt — C API only. Use when the user is
  embedding LP, MILP, or QP in C/C++.
license: Apache-2.0 AND CC-BY-4.0
metadata:
  version: 26.08.00
  author: NVIDIA
---


# cuOpt Numerical Optimization — C API

Solve LP, MILP, and QP problems via the cuOpt C API. The same library, headers, build pattern, and core calls (`cuOptCreate*Problem`, `cuOptSolve`, `cuOptGetObjectiveValue`) apply across all three; QP extends the API with quadratic-objective creation calls.

Confirm problem type and formulation (variables, objective, constraints, variable types) before coding.

This skill is **C only**.

## Quick Reference: C API

```c
#include <cuopt/linear_programming/cuopt_c.h>

// CSR format for constraints
cuopt_int_t row_offsets[] = {0, 2, 4};
cuopt_int_t col_indices[] = {0, 1, 0, 1};
cuopt_float_t values[] = {2.0, 3.0, 4.0, 2.0};
char var_types[] = {CUOPT_CONTINUOUS, CUOPT_INTEGER};

cuOptCreateRangedProblem(
    num_constraints, num_variables, CUOPT_MINIMIZE,
    0.0, objective_coefficients,
    row_offsets, col_indices, values,
    constraint_lower, constraint_upper,
    var_lower, var_upper, var_types,
    &problem
);
cuOptSolve(problem, settings, &solution);
cuOptGetObjectiveValue(solution, &obj_value);
```

## QP via C API (beta)

QP uses the same library, include/lib paths, and build pattern as LP/MILP — only the problem-creation call differs (it accepts a quadratic objective). See the cuOpt C headers (`cpp/include/cuopt/linear_programming/`) for the QP-specific creation/solve calls and the repo docs at `docs/cuopt/source/cuopt-c/lp-qp-milp/` for end-to-end QP examples.

**QP rules:**
- **MINIMIZE only** (`CUOPT_MINIMIZE`). To maximize `f(x)`, negate objective coefficients and Q entries.
- **Continuous variables only** — set `CUOPT_CONTINUOUS` for every variable; integer QP is not supported.
- **Q should be PSD** for a convex problem.

## Debugging (MPS / C)

**MPS parsing:** Required sections in order: NAME, ROWS, COLUMNS, RHS, (optional) BOUNDS, ENDATA. Integer markers: `'MARKER'`, `'INTORG'`, `'INTEND'`.

**OOM or slow:** Check problem size (variables, constraints); use sparse matrix; set time limit and gap tolerance.

## Examples

- [examples.md](resources/examples.md) — LP/MILP with build instructions
- [assets/README.md](assets/README.md) — Build commands for all reference code below
- [lp_basic](assets/lp_basic/) — Simple LP: create problem, solve, get solution
- [lp_duals](assets/lp_duals/) — Dual values and reduced costs
- [lp_warmstart](assets/lp_warmstart/) — PDLP warmstart (see README)
- [milp_basic](assets/milp_basic/) — Simple MILP with integer variable
- [milp_production_planning](assets/milp_production_planning/) — Production planning with resource constraints
- [mps_solver](assets/mps_solver/) — Solve from MPS file via `cuOptReadProblem`

For **CLI** (MPS files), use `cuopt_cli` and product docs.

## Escalate

For contribution or build-from-source, use product or repo documentation.
Files in this package (18)
  • LICENSE 12 KB
  • SKILL.md 3 KB
  • skill-card.md 2 KB
  • skill.oms.sig 7 KB
  • assets/README.md 2 KB
  • assets/lp_basic/README.md 1 KB
  • assets/lp_basic/lp_simple.c 4 KB
  • assets/lp_duals/README.md 1 KB
  • assets/lp_duals/lp_duals.c 4 KB
  • assets/lp_warmstart/README.md 1 KB
  • assets/milp_basic/README.md 1 KB
  • assets/milp_basic/milp_simple.c 3 KB
  • assets/milp_production_planning/README.md 1 KB
  • assets/milp_production_planning/milp_production.c 3 KB
  • assets/mps_solver/README.md 1 KB
  • assets/mps_solver/mps_solver.c 3 KB
  • assets/mps_solver/data/sample.mps 1 KB
  • resources/examples.md 9 KB

Versions

The database has no other skills named nvidia-cuopt-numerical-optimization-api-c.

Database snapshot: 13.11.2026 · package version e7dd7e23fe06 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100cuopt-numerical-optimization-api
    LP, MILP, and QP (beta) with cuOpt — Python, C, and CLI. Use when the user is solving LP, MILP, or QP with any cuOpt interface.
  • 100cuopt-numerical-optimization-api-cli
    LP, MILP, and QP (beta) with cuOpt — CLI only (MPS files, cuopt_cli). Use when the user is solving LP, MILP, or QP from MPS via command line.
  • 100nvidia-cuopt-numerical-optimization-api-python
    Solve Linear Programming (LP), Mixed-Integer Linear Programming (MILP), and Quadratic Programming (QP, beta) with the Python API. Use when the user asks about optimization with linear or quadratic objectives, linear constraints, integer variables, scheduling, resource…
  • 100cuopt-debugging
    Troubleshoot cuOpt LP/MILP problems including errors, wrong results, infeasible solutions, performance issues, and status codes. Use when the user says something isn't working, gets unexpected results, or needs help diagnosing issues.
  • 100cuopt-developer
    Modify, build, test, debug, and contribute to NVIDIA cuOpt (C++/CUDA, Python, server, CI). Use for solver internals, PRs, DCO, and code conventions.
  • 100nvidia-cuopt-developer
    Modify, build, test, debug, and contribute to NVIDIA cuOpt (C++/CUDA, Python, server, CI). Use for solver internals, PRs, DCO, and code conventions.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.