Skip to content

Create integration function for Polynomial struct #93

@dawnandrew100

Description

@dawnandrew100

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>;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions