Module utils

Source
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§

errors

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 the set_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.