Fit options
Every option here has a default that works. Set one only to override it.
This page documents each option once. The language guides show how to pass
them, in each language’s own naming style. C++, Python, Julia and MATLAB spell
it tol_kind, JavaScript spells it tolKind, and C and Fortran use the C
ABI fields.
Common fit options
These apply to every language binding:
Field |
Default |
Meaning |
|---|---|---|
|
|
How treeweave interprets |
|
|
Tree-depth ceiling. |
|
auto |
Cap on accumulated leaf storage (MiB). Tri-state: |
|
|
Keep panels that fail tolerance at |
|
|
Force BFS to refine every panel to at least this depth, driving the
leaf-table fast path (see Performance). |
|
none |
Path of a plain-text fit file. If the file exists and its header
matches the treeweave and polyfit versions, the dtype, dimensions,
domain, |
The leaf polynomial degree is not a runtime option. In C++ it is a template
parameter, treeweave::fit<N>. The default is 6 coefficients per axis in 1D
and 7 in 2D and 3D. The C ABI and the bindings use the same degrees on every
CPU.
Language-specific options
Some bindings add convenience fields around the shared C ABI:
Language |
Field |
Meaning |
|---|---|---|
Python, JavaScript |
|
A probe of the callback infers the input/output dimensions; set them explicitly when the probe is ambiguous or expensive. |
Python, JavaScript |
|
Select |
JavaScript |
|
|
C++ |
degree template parameter |
|
TolKind
Kind |
Meaning |
|---|---|
|
sample-grid max-abs error relative to the largest |
|
sample-grid max-abs absolute error |
|
sample-grid L2 relative error |
|
sample-grid L2 absolute error |
|
sample-grid per-sample relative error: |
|
1-D only, relative coefficient-tail estimate |
|
1-D only, absolute coefficient-tail estimate |
Switch to an Absolute* kind when relative accuracy is not meaningful. In the C ABI these are the treeweave_tol_kind_t enum
values (TREEWEAVE_RELATIVE_MAX …).
Note
RelativeMax measures the error against the largest |f| seen
so far. A function whose large values appear only late in the visit order
can throw MaxDepthExceeded. The throw is correct. The measurements
showed that the failing panels miss the target even against the final max.
Use AbsoluteMax with a known scale of f, or a larger max_depth.