Expand description
Unified polynomial dispatch layer
Auto-routes Expression to optimal Poly<T> implementation based on coefficient type.
Converts ONCE at entry → stays numeric → converts ONCE at exit.
§Architecture
- Analyze coefficient types in Expression
- Route to optimal implementation:
- All integers → IntPoly (fastest path)
- Any rationals → RationalPoly (field operations)
- Multivariate → symbolic fallback
- Convert result back to Expression ONCE
§Example
use mathhook_core::{expr, symbol};
use mathhook_core::core::polynomial::dispatch::polynomial_gcd;
let x = symbol!(x);
let p1 = expr!((x^2) - 1);
let p2 = expr!(x - 1);
let gcd = polynomial_gcd(&p1, &p2, &x);Functions§
- polynomial_
div - Unified polynomial division with automatic type routing
- polynomial_
gcd - Unified polynomial GCD with automatic type routing
- polynomial_
quo - Unified polynomial quotient with automatic type routing
- polynomial_
rem - Unified polynomial remainder with automatic type routing