values (seen as types) in polynomial ring
More...
#include <aerobus.h>
|
using | ring_type = Ring |
| ring coefficients live in
|
|
using | enclosing_type = polynomial< Ring > |
| enclosing ring type
|
|
using | aN = coeffN |
| heavy weight coefficient (non zero)
|
|
using | strip = val< coeffs... > |
| remove largest coefficient
|
|
using | is_zero_t = std::bool_constant<(degree==0) &&(aN::is_zero_t::value)> |
| true_type if polynomial is constant zero
|
|
template<size_t index> |
using | coeff_at_t = typename coeff_at< index >::type |
| type of coefficient at index
|
|
template<typename x > |
using | value_at_t = horner_reduction_t< val > ::template inner< 0, degree+1 > ::template type< typename Ring::zero, x > |
|
|
static std::string | to_string () |
| get a string representation of polynomial
|
|
template<typename arithmeticType > |
static constexpr DEVICE INLINED arithmeticType | eval (const arithmeticType &x) |
| evaluates polynomial seen as a function operating on arithmeticType
|
|
template<typename arithmeticType > |
static DEVICE INLINED arithmeticType | compensated_eval (const arithmeticType &x) |
| Evaluate polynomial on x using compensated horner scheme.
|
|
|
static constexpr size_t | degree = sizeof...(coeffs) |
| degree of the polynomial
|
|
static constexpr bool | is_zero_v = is_zero_t::value |
| true if polynomial is constant zero
|
|
template<typename Ring>
template<typename coeffN, typename... coeffs>
struct aerobus::polynomial< Ring >::val< coeffN, coeffs >
values (seen as types) in polynomial ring
- Template Parameters
-
coeffN | high degree coefficient |
...coeffs | lower degree coefficients |
- Examples
- examples/compensated_horner.cpp.
◆ aN
template<typename Ring >
template<typename coeffN , typename... coeffs>
heavy weight coefficient (non zero)
◆ coeff_at_t
template<typename Ring >
template<typename coeffN , typename... coeffs>
template<size_t index>
using aerobus::polynomial< Ring >::val< coeffN, coeffs >::coeff_at_t = typename coeff_at<index>::type |
type of coefficient at index
- Template Parameters
-
◆ enclosing_type
template<typename Ring >
template<typename coeffN , typename... coeffs>
◆ is_zero_t
template<typename Ring >
template<typename coeffN , typename... coeffs>
using aerobus::polynomial< Ring >::val< coeffN, coeffs >::is_zero_t = std::bool_constant<(degree == 0) && (aN::is_zero_t::value)> |
true_type if polynomial is constant zero
◆ ring_type
template<typename Ring >
template<typename coeffN , typename... coeffs>
ring coefficients live in
◆ strip
template<typename Ring >
template<typename coeffN , typename... coeffs>
remove largest coefficient
◆ value_at_t
template<typename Ring >
template<typename coeffN , typename... coeffs>
template<typename x >
◆ compensated_eval()
template<typename Ring >
template<typename coeffN , typename... coeffs>
template<typename arithmeticType >
Evaluate polynomial on x using compensated horner scheme.
This is twice as accurate as simple eval (horner) but cannot be constexpr
Please note this makes no sense on integer types as arithmetic on integers is exact in IEEE
WARNING : this does not work with gcc with -O3 optimization level because gcc does illegal stuff with floating point arithmetic
- Template Parameters
-
arithmeticType | float for example |
- Parameters
-
◆ eval()
template<typename Ring >
template<typename coeffN , typename... coeffs>
template<typename arithmeticType >
evaluates polynomial seen as a function operating on arithmeticType
- Template Parameters
-
arithmeticType | usually float or double |
- Parameters
-
- Returns
- P(x)
◆ to_string()
template<typename Ring >
template<typename coeffN , typename... coeffs>
get a string representation of polynomial
- Returns
- something like a_n X^n + ... + a_1 X + a_0
◆ degree
template<typename Ring >
template<typename coeffN , typename... coeffs>
constexpr size_t aerobus::polynomial< Ring >::val< coeffN, coeffs >::degree = sizeof...(coeffs) |
|
staticconstexpr |
◆ is_zero_v
template<typename Ring >
template<typename coeffN , typename... coeffs>
constexpr bool aerobus::polynomial< Ring >::val< coeffN, coeffs >::is_zero_v = is_zero_t::value |
|
staticconstexpr |
true if polynomial is constant zero
The documentation for this struct was generated from the following file: