Polynomial traits should be implemented for all polynomial structs. As part of that, an integration function needs to be implemented for the Polynomial struct that takes in a Polynomial struct and returns a Polynomial struct.
This function should be able to handle both univariate and multivariate polynomials.
pub trait PolynomialTraits {
/*
fn parse(input: &str) -> Result<Self, PolynomialError>
where
Self: std::marker::Sized;
fn eval_univariate<F>(&self, point: F) -> Result<f64, PolynomialError>
where
F: Into<f64> + std::clone::Clone + std::fmt::Debug;
fn eval_multivariate<V, S, F>(&self, vars: &V) -> Result<f64, PolynomialError>
where
V: IntoIterator<Item = (S, F)> + std::fmt::Debug + Clone,
S: AsRef<str>,
F: Into<f64>;
fn derivate_univariate(&self) -> Result<Self, PolynomialError>
where
Self: std::marker::Sized;
fn derivate_multivariate<S>(&self, var: S) -> Self
where
S: AsRef<str>;
*/
fn indefinite_integral_univariate(&self) -> Result<Self, PolynomialError>
where
Self: std::marker::Sized;
fn indefinite_integral_multivariate<S>(&self, var: S) -> Self
where
S: AsRef<str>;
}
Polynomial traits should be implemented for all polynomial structs. As part of that, an integration function needs to be implemented for the
Polynomialstruct that takes in aPolynomial structand returns aPolynomial struct.This function should be able to handle both univariate and multivariate polynomials.