Function treeweave_fit
Defined in File treeweave.h
Function Documentation
-
treeweave_t treeweave_fit(treeweave_func_t f, int input_dim, int output_dim, const double *a, const double *b, double tol, void *context, const treeweave_opts *opts)
Fit a function over a box domain and return an evaluable handle.
Note
The leaf degree is fixed per input_dim (6 in 1D, 7 in 2D and 3D) and is not a parameter.
- Parameters:
f – User callback evaluating the target (see
treeweave_func_t).input_dim – Domain dimension; supported values are 1, 2, 3.
output_dim – Number of output components; supported values are 1, 2, 3.
a – Domain lower corner,
input_dimelements.b – Domain upper corner,
input_dimelements.tol – Target accuracy, interpreted per
opts->tol_kind.context – Opaque pointer forwarded to every
finvocation (may be NULL).opts – Fit knobs, or NULL for defaults.
- Returns:
A handle on success, or NULL with treeweave_last_error() set when the (dtype, input_dim, output_dim) tuple is unsupported, the arguments are invalid, or the fit throws (MaxDepthExceeded / MemoryBudgetExceeded).