mathhook_core/functions/
polynomials.rs1pub mod chebyshev;
7pub mod evaluation;
8pub mod hermite;
9pub mod laguerre;
10pub mod legendre;
11pub mod polynomial_eval;
12pub mod symbolic;
13
14pub use polynomial_eval::{degree, expand, factor, roots};
15
16use crate::functions::properties::FunctionProperties;
17use std::collections::HashMap;
18
19pub struct PolynomialIntelligence {
24 legendre: legendre::LegendreIntelligence,
26
27 hermite: hermite::HermiteIntelligence,
29
30 laguerre: laguerre::LaguerreIntelligence,
32
33 chebyshev: chebyshev::ChebyshevIntelligence,
35}
36
37impl Default for PolynomialIntelligence {
38 fn default() -> Self {
39 Self::new()
40 }
41}
42
43impl PolynomialIntelligence {
44 pub fn new() -> Self {
46 Self {
47 legendre: legendre::LegendreIntelligence::new(),
48 hermite: hermite::HermiteIntelligence::new(),
49 laguerre: laguerre::LaguerreIntelligence::new(),
50 chebyshev: chebyshev::ChebyshevIntelligence::new(),
51 }
52 }
53
54 pub fn get_all_properties(&self) -> HashMap<String, FunctionProperties> {
59 let mut properties = HashMap::with_capacity(64);
60
61 properties.extend(self.legendre.get_properties());
62 properties.extend(self.hermite.get_properties());
63 properties.extend(self.laguerre.get_properties());
64 properties.extend(self.chebyshev.get_properties());
65
66 properties
67 }
68
69 pub fn is_polynomial_function(&self, name: &str) -> bool {
71 self.legendre.has_function(name)
72 || self.hermite.has_function(name)
73 || self.laguerre.has_function(name)
74 || self.chebyshev.has_function(name)
75 }
76}