const_poly

Macro const_poly 

Source
macro_rules! const_poly {
    ( [ $coeff:expr $(, $func:expr )* $(,)? ] ) => { ... };
    ({
        [ $coeff_first:expr $(, $func_first:expr )* ]
        $(, [ $coeff_rest:expr $(, $func_rest:expr )* ] )* $(,)?
    }) => { ... };
}
Expand description

Defines a compile-time polynomial with inferred variable count. Supports both single-term and multi-term forms.

ยงExamples

use const_poly::{Polynomial, const_poly, VarFunction::*};

const POLY1: Polynomial<2> = const_poly!([1.0, Sin, Cos]);

const POLY2: Polynomial<2> = const_poly!({
    [1.0, Identity, Identity],
    [2.0, Sin, Pow(2)]
});