Aerobus v1.2
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Attributes | List of all members
aerobus::polynomial< Ring > Struct Template Reference

#include <aerobus.h>

Classes

struct  horner_reduction_t
 Used to evaluate polynomials over a value in Ring. More...
 
struct  val
 values (seen as types) in polynomial ring More...
 
struct  val< coeffN >
 specialization for constants More...
 

Public Types

using zero = val< typename Ring::zero >
 constant zero
 
using one = val< typename Ring::one >
 constant one
 
using X = val< typename Ring::one, typename Ring::zero >
 generator
 
template<typename P >
using simplify_t = typename simplify< P >::type
 simplifies a polynomial (recursively deletes highest degree if zero, do nothing otherwise)
 
template<typename v1 , typename v2 >
using add_t = typename add< v1, v2 >::type
 adds two polynomials
 
template<typename v1 , typename v2 >
using sub_t = typename sub< v1, v2 >::type
 substraction of two polynomials
 
template<typename v1 , typename v2 >
using mul_t = typename mul< v1, v2 >::type
 multiplication of two polynomials
 
template<typename v1 , typename v2 >
using eq_t = typename eq_helper< v1, v2 >::type
 equality operator
 
template<typename v1 , typename v2 >
using lt_t = typename lt_helper< v1, v2 >::type
 strict less operator
 
template<typename v1 , typename v2 >
using gt_t = typename gt_helper< v1, v2 >::type
 strict greater operator
 
template<typename v1 , typename v2 >
using div_t = typename div< v1, v2 >::q_type
 division operator
 
template<typename v1 , typename v2 >
using mod_t = typename div_helper< v1, v2, zero, v1 >::mod_type
 modulo operator
 
template<typename coeff , size_t deg>
using monomial_t = typename monomial< coeff, deg >::type
 monomial : coeff X^deg
 
template<typename v >
using derive_t = typename derive_helper< v >::type
 derivation operator
 
template<typename v >
using pos_t = typename Ring::template pos_t< typename v::aN >
 checks for positivity (an > 0)
 
template<typename v1 , typename v2 >
using gcd_t = std::conditional_t< Ring::is_euclidean_domain, typename make_unit< gcd_t< polynomial< Ring >, v1, v2 > >::type, void >
 greatest common divisor of two polynomials
 
template<auto x>
using inject_constant_t = val< typename Ring::template inject_constant_t< x > >
 makes the constant (native type) polynomial a_0
 
template<typename v >
using inject_ring_t = val< v >
 makes the constant (ring type) polynomial a_0
 

Static Public Attributes

static constexpr bool is_field = false
 
static constexpr bool is_euclidean_domain = Ring::is_euclidean_domain
 
template<typename v >
static constexpr bool pos_v = pos_t<v>::value
 positivity operator
 

Detailed Description

template<typename Ring>
requires IsEuclideanDomain<Ring>
struct aerobus::polynomial< Ring >

polynomial with coefficients in Ring Ring must be an integral domain

Examples
examples/compensated_horner.cpp, examples/make_polynomial.cpp, and examples/modular_arithmetic.cpp.

Member Typedef Documentation

◆ add_t

template<typename Ring >
template<typename v1 , typename v2 >
using aerobus::polynomial< Ring >::add_t = typename add<v1, v2>::type

adds two polynomials

Template Parameters
v1
v2

◆ derive_t

template<typename Ring >
template<typename v >
using aerobus::polynomial< Ring >::derive_t = typename derive_helper<v>::type

derivation operator

Template Parameters
v

◆ div_t

template<typename Ring >
template<typename v1 , typename v2 >
using aerobus::polynomial< Ring >::div_t = typename div<v1, v2>::q_type

division operator

Template Parameters
v1
v2

◆ eq_t

template<typename Ring >
template<typename v1 , typename v2 >
using aerobus::polynomial< Ring >::eq_t = typename eq_helper<v1, v2>::type

equality operator

Template Parameters
v1
v2

◆ gcd_t

template<typename Ring >
template<typename v1 , typename v2 >
using aerobus::polynomial< Ring >::gcd_t = std::conditional_t< Ring::is_euclidean_domain, typename make_unit<gcd_t<polynomial<Ring>, v1, v2> >::type, void>

greatest common divisor of two polynomials

Template Parameters
v1
v2

◆ gt_t

template<typename Ring >
template<typename v1 , typename v2 >
using aerobus::polynomial< Ring >::gt_t = typename gt_helper<v1, v2>::type

strict greater operator

Template Parameters
v1
v2

◆ inject_constant_t

template<typename Ring >
template<auto x>
using aerobus::polynomial< Ring >::inject_constant_t = val<typename Ring::template inject_constant_t<x> >

makes the constant (native type) polynomial a_0

Template Parameters
x

◆ inject_ring_t

template<typename Ring >
template<typename v >
using aerobus::polynomial< Ring >::inject_ring_t = val<v>

makes the constant (ring type) polynomial a_0

Template Parameters
v

◆ lt_t

template<typename Ring >
template<typename v1 , typename v2 >
using aerobus::polynomial< Ring >::lt_t = typename lt_helper<v1, v2>::type

strict less operator

Template Parameters
v1
v2

◆ mod_t

template<typename Ring >
template<typename v1 , typename v2 >
using aerobus::polynomial< Ring >::mod_t = typename div_helper<v1, v2, zero, v1>::mod_type

modulo operator

Template Parameters
v1
v2

◆ monomial_t

template<typename Ring >
template<typename coeff , size_t deg>
using aerobus::polynomial< Ring >::monomial_t = typename monomial<coeff, deg>::type

monomial : coeff X^deg

Template Parameters
coeff
deg

◆ mul_t

template<typename Ring >
template<typename v1 , typename v2 >
using aerobus::polynomial< Ring >::mul_t = typename mul<v1, v2>::type

multiplication of two polynomials

Template Parameters
v1
v2

◆ one

template<typename Ring >
using aerobus::polynomial< Ring >::one = val<typename Ring::one>

constant one

◆ pos_t

template<typename Ring >
template<typename v >
using aerobus::polynomial< Ring >::pos_t = typename Ring::template pos_t<typename v::aN>

checks for positivity (an > 0)

Template Parameters
v

◆ simplify_t

template<typename Ring >
template<typename P >
using aerobus::polynomial< Ring >::simplify_t = typename simplify<P>::type

simplifies a polynomial (recursively deletes highest degree if zero, do nothing otherwise)

Template Parameters
P

◆ sub_t

template<typename Ring >
template<typename v1 , typename v2 >
using aerobus::polynomial< Ring >::sub_t = typename sub<v1, v2>::type

substraction of two polynomials

Template Parameters
v1
v2

◆ X

template<typename Ring >
using aerobus::polynomial< Ring >::X = val<typename Ring::one, typename Ring::zero>

generator

◆ zero

template<typename Ring >
using aerobus::polynomial< Ring >::zero = val<typename Ring::zero>

constant zero

Member Data Documentation

◆ is_euclidean_domain

template<typename Ring >
constexpr bool aerobus::polynomial< Ring >::is_euclidean_domain = Ring::is_euclidean_domain
staticconstexpr

◆ is_field

template<typename Ring >
constexpr bool aerobus::polynomial< Ring >::is_field = false
staticconstexpr

◆ pos_v

template<typename Ring >
template<typename v >
constexpr bool aerobus::polynomial< Ring >::pos_v = pos_t<v>::value
staticconstexpr

positivity operator

Template Parameters
va value in polynomial::val

The documentation for this struct was generated from the following file: