157#include <unsupported/Eigen/Polynomials>
166 #define R_TOL std::numeric_limits<double>::epsilon()
180 static void get_divisors(
int n, std::vector<int>& v)
noexcept;
198 Monomial(
const double cf,
const int dgr)
noexcept;
367 double get_value(const
double& x) const noexcept;
407 Polynomial(
const std::initializer_list<Monomial> mns)
noexcept;
560 std::map<
int,
Monomial> get_monomials() const noexcept;
565 bool is_empty() const noexcept;
571 bool push_monomial(const
Monomial& m) noexcept;
577 bool push_monomial(
Monomial&& m) noexcept;
588 double get_value(const
double& x) const noexcept;
603 std::vector<std::complex<
double>> get_roots() const noexcept;
Class with some functions for arithmetic math.
static void get_divisors(int n, std::vector< int > &v) noexcept
Gets the all the positive divisors for an integer.
Class for representing and operating monomials.
friend std::stringstream & operator<<(std::stringstream &ss, const Monomial &m)
A friend operator to insert the Monomial into a std::stringstream.
int get_degree() const noexcept
Getter function for getting the degree of the Monomial.
Monomial & operator/=(const Monomial &ogn) noexcept
Division assigment operator overload.
std::string get_expression() const noexcept
Getter function for getting the expression of the Monomial.
bool operator==(const Monomial &ogn) const noexcept
Equal logic operator overload.
bool operator<(const Monomial &ogn) const noexcept
Less than logic operator overload.
bool operator>=(const Monomial &ogn) const noexcept
Greater or equal than logic operator overload.
Monomial & operator=(const Monomial &ogn) noexcept
Assigment operator overload for when called with an lvalue.
Monomial & operator-=(const Monomial &ogn) noexcept
Substraction assigment operator overload.
double get_value(const double &x) const noexcept
Calculus function for getting the value of the Monomial at a point.
Monomial operator/(const Monomial &ogn) const noexcept
Division operator overload.
Monomial & operator*=(const Monomial &ogn) noexcept
Multiplication assigment operator overload.
Monomial & operator+=(const Monomial &ogn) noexcept
Addition assigment operator overload.
bool operator<=(const Monomial &ogn) const noexcept
Less or equal than logic operator overload.
Monomial operator%(const Monomial &ogn) const noexcept
Modulus operator overload.
Monomial operator*(const Monomial &ogn) const noexcept
Multiplication operator overload.
bool operator>(const Monomial &ogn) const noexcept
Greater than logic operator overload.
Monomial operator+(const Monomial &ogn) const noexcept
Addition operator overload.
Monomial & operator%=(const Monomial &ogn) noexcept
Modulus assigment operator overload.
void set_degree(int dgr) noexcept
Setter function for setting the degree of the Monomial.
bool operator!=(const Monomial &ogn) const noexcept
Not equal logic operator overload.
double get_coeff() const noexcept
Getter function for getting the coefficient of the Monomial.
friend std::ostream & operator<<(std::ostream &out, const Monomial &m)
A friend operator to insert the Monomial into a std::ostream.
void set_coeff(double cf) noexcept
Setter function for setting the coefficient of the Monomial.
Monomial() noexcept
Default constructor for when initialized with no arguments.
Monomial operator-(const Monomial &ogn) const noexcept
Substraction operator overload.
Class for representing and operating polynomials.
Polynomial(const std::vector< Monomial > mns) noexcept
Vector constructor for initialization with a std::vector<Monomial>
friend std::ostream & operator<<(std::ostream &out, const Polynomial &p) noexcept
A friend operator to insert the Polynomial into a std::ostream.
friend std::stringstream & operator<<(std::stringstream &ss, const Polynomial &p) noexcept
A friend operator to insert the Polynomial into a std::stringstream.
Polynomial(const std::initializer_list< Monomial > mns) noexcept
List constructor for initialization with a std::initializer_list<Monomial>
Polynomial(const std::map< int, Monomial > mns) noexcept
Normal constructor for initialization with a std::map<int, Monomial>
Englobes all the classes and functions of the emath library.