Expand description
The utilies module provides general capabilities, that may span the input modeling, models, output analysis, and simulator modules. The utilities are centered around debugging/traceability and common arithmetic.
Modules§
Functions§
- evaluate_
polynomial - The function evaluates a polynomial at a single value, with coefficients defined as a slice, from the highest polynomial order to the zero order. Horner’s method is used for this polynomial evaluation For example for the polynomial:
- horner_
fold - Horner Algorithm for polynomial evaluation It is expected that the coefficients are ordered from least significant to most significant. For example for the polynomial:
- set_
panic_ hook - When the
console_error_panic_hook
feature is enabled, we can call theset_panic_hook
function at least once during initialization, and then we will get better error messages if our code ever panics. - usize_
sqrt - Integer square root calculation, using the Babylonian square-root algorithm.