Scalar GP and Bayesian quadrature (ABI 1.17)

A gpr_bq_t holds one scalar Gaussian process over dimension inputs and integrates it in closed form over a box or a Gaussian measure.

Ownership. gpr_bq_create returns a handle that the caller owns until it passes it to gpr_bq_destroy. Every pointer argument is read or written during the call and stays with the caller; the library copies what it keeps. Row-major flat arrays hold points, one row per point.

Single writer. A gpr_bq_t has one writer at a time. A call that changes the handle (gpr_bq_reset, the train, append and fit calls, the set_* calls and gpr_bq_destroy) must not overlap any other call on the same handle. The library takes no lock on the handle; the table that tells a live handle from a destroyed one has its own mutex, so calls on distinct handles may run on different threads at once. A destroyed handle is refused: a second gpr_bq_destroy sets GPR_ERR_INVALID_ARG in gpr_last_status(), and any other call returns GPR_ERR_NULL_HANDLE (the query functions return 0).

Failure. Every function that returns int returns GPR_SUCCESS (0) or a negative status and leaves its output buffers unwritten on failure. A _checked function takes the length of each caller buffer in doubles and returns GPR_ERR_INVALID_ARG for a short one. GPR_ERR_NOT_TRAINED means the call needs observations. GPR_ERR_CHOLESKY means that the covariance is singular or not positive definite at the hyperparameters the call uses, as when two observations share a location and the noise is zero; a train, append or set function returns it with the model unchanged. Other BayesianQuadratureInferenceError failures, including an eigensolver failure, return GPR_ERR_OPTIMIZER. GPR_ERR_OPTIMIZER means that hyperparameter inference failed (including the case that every trial point of the optimizer failed) and the model kept its previous state; the library does not substitute another treatment.