Skip to main content

init

Function init 

Source
pub fn init(order: u32, nvars: u32) -> Result<(), DaceError>
Expand description

Initialize DACE with computation order order and nvars variables, replacing any previous context.

Values of order/nvars below 1 are clamped to 1 with a warning (C informational messages 167/168). Returns an error if the required lookup tables do not fit in a 32-bit index space (C error 911).

Unlike the C library, re-initializing does not invalidate existing Da values: they keep operating on their original context. After any re-initialization, every thread re-derives its computation settings (epsilon cutoff, truncation order) lazily on next use, as if the thread had never been used; user-set settings therefore do not survive re-initialization on any thread.