Nvidia cuopt numerical optimization api c
Skill autohandai/community-skills/nvidia-cuopt-numerical-optimization-api-c
A collection of curated, useful, and safe skills for Autohand Code CLI Agent
npx -y skills add autohandai/community-skills --skill nvidia-cuopt-numerical-optimization-api-cAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
LP, MILP, and QP (beta) with cuOpt — C API only. Use when the user is embedding LP, MILP, or QP in C/C++.
The file declares its own license as Apache-2.0 AND CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
3.0 KB, 756 tokens by cl100k_base, as published. Nobody here has run it
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
#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 maximizef(x), negate objective coefficients and Q entries. - Continuous variables only — set
CUOPT_CONTINUOUSfor 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 — LP/MILP with build instructions
- assets/README.md — Build commands for all reference code below
- lp_basic — Simple LP: create problem, solve, get solution
- lp_duals — Dual values and reduced costs
- lp_warmstart — PDLP warmstart (see README)
- milp_basic — Simple MILP with integer variable
- milp_production_planning — Production planning with resource constraints
- 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.
What ships with it: 17 files
53.2 KB alongside SKILL.md
assets/
- lp_basic/lp_simple.c3.6 KB
- lp_basic/README.md464 B
- lp_duals/lp_duals.c4.0 KB
- lp_duals/README.md498 B
- lp_warmstart/README.md289 B
- milp_basic/milp_simple.c3.4 KB
- milp_basic/README.md403 B
- milp_production_planning/milp_production.c3.4 KB
- milp_production_planning/README.md457 B
- mps_solver/data/sample.mps490 B
- mps_solver/mps_solver.c3.4 KB
- mps_solver/README.md588 B
- README.md1.7 KB
resources/
- examples.md9.5 KB
- LICENSE11.9 KB
- skill-card.md2.0 KB
- skill.oms.sig7.4 KB