Expand description
One error namespace for the whole C API.
Every negative code a POUNCE extension entry point returns is a
POUNCE_ERR_* value from this module, and each value has exactly one
meaning wherever it appears: a wrapper can keep a single code-to-message
table, and a log line that says -3 means “index out of range” whichever
function wrote it. PounceErrorString is that table, so every frontend
reports the same text.
The values are grouped in blocks:
| block | meaning |
|---|---|
-1 … -19 | generic: any function may return these |
-20 … -39 | complementarity pairs (*PounceComplementarityPair*, AddPounceComplementsConstraint) |
-40 … -59 | bound updates (SetPounceBounds, GetPounceBounds) |
-60 … -79 | the QP handle (PounceQp*) |
A new code is appended inside its block, and a number is never reused or
renumbered once released. A new function family gets a new block. A code
from one family’s block may be returned by another family when the
meaning is the same (POUNCE_ERR_ROW_NOT_FREE is returned by both
AddPounceComplementsConstraint and SetPounceBounds).
Every function checks in the same order, so a call with several faults reports the same code whichever function it is:
- the handle (
POUNCE_ERR_NULL); flagsand enum arguments (POUNCE_ERR_FLAGS,POUNCE_ERR_ARGUMENT);- counts (
POUNCE_ERR_COUNT), then the arrays they size (NULL); - per entry, over the whole batch in batch order: range, then duplicate or already paired, then NaN;
- per entry, over the whole batch in batch order: what the entry would
mean (shape, row not free, variable bounds,
Complementsclass, pair changed); - state beyond the batch (the staged working set;
PounceQpSolve’s checks).
An argument fault anywhere in a batch is therefore reported before a
semantic fault anywhere in it. tests/check_order.rs holds the batch
functions to this.
Non-negative returns stay per function: POUNCE_OK (0) for success, and
the QP statuses (POUNCE_QP_STATUS_*) and AddPounceComplementsConstraint
outcomes (POUNCE_COMPLEMENTS_*) are results, not errors.
The header (include/pounce.h) repeats every value; tests/header_abi.rs
holds the two to the same names and values, and checks that
PounceErrorString has a message for each.
Constants§
- POUNCE_
ERROR_ CODES - Every code with its message: the single table
PounceErrorStringreads, and the listtests/header_abi.rschecks the header against. - POUNCE_
ERR_ ARGUMENT - An argument outside its domain: an unknown enum value (a view, a cone kind), a bad cone dimension or exponent, or entries whose sum overflows.
- POUNCE_
ERR_ COMPLEMENTS_ CLASS - A variable used by
AddPounceComplementsConstraintwould move to another row of the MOI table (lower-only, upper-only, boxed, fixed, free). - POUNCE_
ERR_ CONES - The cones do not partition the inequality rows, or PSD is mixed with the exponential or power cone.
- POUNCE_
ERR_ COUNT - A count out of range: negative, larger than the dimension it indexes, or inconsistent with a NULL index array.
- POUNCE_
ERR_ DUPLICATE - The same index given twice where each may appear once.
- POUNCE_
ERR_ FLAGS flagscarries a bit this library does not define. An unknown bit is refused, so an older library never silently ignores one.- POUNCE_
ERR_ INCOMPLETE - The QP is incomplete: no objective, or declared rows never set.
- POUNCE_
ERR_ INDEFINITE method=ipmandPnot certified positive semidefinite.- POUNCE_
ERR_ INTERNAL - A Rust panic caught at the boundary, or a handle whose stored state no longer validates. Not expected; it exists so neither is reported as a diagnosis of the caller’s input. Nothing was changed.
- POUNCE_
ERR_ NAN - A NaN value where a number is required.
- POUNCE_
ERR_ NULL - A NULL handle, or a NULL array the call needed.
- POUNCE_
ERR_ OPTIONS - An option the selected engine would silently drop.
- POUNCE_
ERR_ OUT_ OF_ RANGE - An index outside
[0, n)/[0, m), read in the problem’s index style. - POUNCE_
ERR_ PAIR_ CHANGED - A declared pair would leave its native shapes, or change which variable bound and which row side it pairs.
- POUNCE_
ERR_ ROW_ ALREADY_ PAIRED - The row is already in a pair (declared earlier, or earlier in the same batch or an earlier accepted call).
- POUNCE_
ERR_ ROW_ NOT_ FREE - A row that must stay a free function was given (or has) a finite bound:
MOI’s
FinAddPounceComplementsConstraint, whichSetPounceBoundsthen refuses to bound. - POUNCE_
ERR_ SHAPE - The pair’s bounds are none of the lowered shapes: one-sided, one-sided plus a plain bound, or mixed.
- POUNCE_
ERR_ VAR_ ALREADY_ PAIRED - The variable is already in a pair (declared earlier, or earlier in the same batch or an earlier accepted call).
- POUNCE_
ERR_ VAR_ BOUNDS - The variable’s bounds are NaN or crossed (
l > u): no row of the MOI complements table applies. - POUNCE_
ERR_ WORKING_ SET - The working set staged by
IpoptSetWarmStartWorkingSetwould claim something the new bounds contradict. - POUNCE_
OK - Success.
Functions§
- Pounce
Error ⚠String - The message for a
POUNCE_OK/POUNCE_ERR_*code, as a static NUL-terminated string the caller must not free;"unknown error code"for any other value. Never NULL.