pub mod chebyshev;
pub mod evaluation;
pub mod hermite;
pub mod laguerre;
pub mod legendre;
pub mod polynomial_eval;
pub mod symbolic;
pub use polynomial_eval::{degree, expand, factor, roots};
use crate::functions::properties::FunctionProperties;
use std::collections::HashMap;
pub struct PolynomialIntelligence {
legendre: legendre::LegendreIntelligence,
hermite: hermite::HermiteIntelligence,
laguerre: laguerre::LaguerreIntelligence,
chebyshev: chebyshev::ChebyshevIntelligence,
}
impl Default for PolynomialIntelligence {
fn default() -> Self {
Self::new()
}
}
impl PolynomialIntelligence {
pub fn new() -> Self {
Self {
legendre: legendre::LegendreIntelligence::new(),
hermite: hermite::HermiteIntelligence::new(),
laguerre: laguerre::LaguerreIntelligence::new(),
chebyshev: chebyshev::ChebyshevIntelligence::new(),
}
}
pub fn get_all_properties(&self) -> HashMap<String, FunctionProperties> {
let mut properties = HashMap::with_capacity(64);
properties.extend(self.legendre.get_properties());
properties.extend(self.hermite.get_properties());
properties.extend(self.laguerre.get_properties());
properties.extend(self.chebyshev.get_properties());
properties
}
pub fn is_polynomial_function(&self, name: &str) -> bool {
self.legendre.has_function(name)
|| self.hermite.has_function(name)
|| self.laguerre.has_function(name)
|| self.chebyshev.has_function(name)
}
}