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++.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-08
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- cuopt-numerical-optimization-api-c
- license
- Apache-2.0
- version
- 26.08.00
- metadata
- { "tags": [ "cuopt", "linear-programming", "milp", "qp", "c-api" ], "author": "NVIDIA cuOpt Team" }
- description
- LP, MILP, and QP (beta) with cuOpt — C API only. Use when the user is embedding LP, MILP, or QP in C/C++.
02 资源文件 18
- 资产文件assets/lp_basic/lp_simple.c3.6 KB
- 资产文件assets/lp_basic/README.md466 B
- 资产文件assets/lp_duals/lp_duals.c4.0 KB
- 资产文件assets/lp_duals/README.md500 B
- 资产文件assets/lp_warmstart/README.md289 B
- 资产文件assets/milp_basic/milp_simple.c3.4 KB
- 资产文件assets/milp_basic/README.md405 B
- 资产文件assets/milp_production_planning/milp_production.c3.4 KB
- 资产文件assets/milp_production_planning/README.md459 B
- 资产文件assets/mps_solver/data/sample.mps490 B
- 资产文件assets/mps_solver/mps_solver.c3.4 KB
- 资产文件assets/mps_solver/README.md590 B
- 资产文件assets/README.md1.7 KB
- 参考文档BENCHMARK.md4.2 KB
- 参考文档evals/evals.json5.2 KB
- 参考文档references/examples.md9.6 KB
- 参考文档skill-card.md3.6 KB
- 其他skill.oms.sig7.8 KB
03 SKILL.md 正文
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.
API Call Sequence
For LP/MILP, the ordered C entry points are: cuOptCreateRangedProblem (sense CUOPT_MINIMIZE / CUOPT_MAXIMIZE, CSR constraint matrix as row_offsets / col_indices / values, var_types char array using CUOPT_CONTINUOUS / CUOPT_INTEGER macros) → cuOptSolve(problem, settings, &solution) → cuOptGetObjectiveValue(solution, &obj_value) → matching cuOptDestroy* calls. Include <cuopt/linear_programming/cuopt_c.h>. Full ordered code with build instructions in references/examples.md.
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.
Dual values (LP / QP)
cuOptGetDualSolution and cuOptGetReducedCosts return duals and reduced costs for LP and QP. They are not returned for a problem with quadratic constraints (the arrays are filled with NaN), so read them only when all constraints are linear. See assets/lp_duals for the call sequence.
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.
04 同仓库更多 Skills
vss-summarize-video
Use to summarize a recorded video via the LVS summarization microservice (HITL-gated) with a VLM fallback. Not for report generation or live RTSP captioning.
vss-setup-video-analytics-api
Use to deploy the vss-video-analytics-api REST service standalone (config-source, data-log bind, Elasticsearch, optional Kafka). Not for full warehouse deploy.
vss-setup-behavior-analytics
Use to deploy the vss-behavior-analytics service standalone (entrypoint, config-source, optional calibration). Not for the full warehouse deploy.
vss-search-archive
Use this skill to run top-level VSS fusion search on archived video, or to ingest video files / RTSP streams for search. Do NOT use for ad-hoc visual Q&A (use vss-ask-video), live captioning (use vss-deploy-dense-captioning), or video summarization and reports (use vss-summarize-video).
vss-query-analytics
Use this skill when reading video-analytics metrics, incidents, alerts, and sensor data via the VA-MCP server (port 9901). Not for live VLM or incident-range narrative reports.
vss-manage-video-io-storage
Use to call the VIOS REST API (sensor list, timelines, clip extraction, snapshots, add/delete sensors and streams). Not for VLM inference or search.