Aerobus v1.2
Loading...
Searching...
No Matches
Classes | Namespaces | Concepts | Macros | Typedefs | Enumerations | Functions | Variables
aerobus.h File Reference
#include <cstdint>
#include <cstddef>
#include <cstring>
#include <type_traits>
#include <utility>
#include <algorithm>
#include <functional>
#include <string>
#include <concepts>
#include <array>
#include <cmath>
#include <limits>
#include <cfenv>
Include dependency graph for aerobus.h:

Go to the source code of this file.

Classes

struct  aerobus::double_double
 
struct  aerobus::arithmetic_helpers< double >
 
struct  aerobus::arithmetic_helpers< float >
 
struct  aerobus::meta_libm< T >
 
struct  aerobus::is_prime< n >
 checks if n is prime More...
 
struct  aerobus::Quotient< Ring, X >
 Quotient ring by the principal ideal generated by 'X' With i32 as Ring and i32::val<2> as X, Quotient is Z/2Z. More...
 
struct  aerobus::Quotient< Ring, X >::val< V >
 projection values in the quotient ring More...
 
struct  aerobus::Embed< Quotient< Ring, X >, Ring >
 embeds Quotient<Ring, X> into Ring More...
 
struct  aerobus::type_list< Ts >
 Empty pure template struct to handle type list. More...
 
struct  aerobus::type_list< Ts >::pop_front
 removes types from head of the list More...
 
struct  aerobus::type_list< Ts >::split< index >
 splits list at index More...
 
struct  aerobus::type_list<>
 specialization for empty type list More...
 
struct  aerobus::i32
 32 bits signed integers, seen as a algebraic ring with related operations More...
 
struct  aerobus::i32::val< x >
 values in i32, again represented as types More...
 
struct  aerobus::i64
 64 bits signed integers, seen as a algebraic ring with related operations More...
 
struct  aerobus::i64::val< x >
 values in i64 More...
 
struct  aerobus::Embed< i32, i64 >
 embeds i32 into i64 More...
 
struct  aerobus::zpz< p >
 congruence classes of integers modulo p (32 bits) More...
 
struct  aerobus::zpz< p >::val< x >
 values in zpz More...
 
struct  aerobus::Embed< zpz< x >, i32 >
 embeds zpz values into i32 More...
 
struct  aerobus::polynomial< Ring >
 
struct  aerobus::polynomial< Ring >::horner_reduction_t< P >
 Used to evaluate polynomials over a value in Ring. More...
 
struct  aerobus::polynomial< Ring >::horner_reduction_t< P >::inner< index, stop >
 
struct  aerobus::polynomial< Ring >::horner_reduction_t< P >::inner< stop, stop >
 
struct  aerobus::polynomial< Ring >::val< coeffN, coeffs >
 values (seen as types) in polynomial ring More...
 
struct  aerobus::polynomial< Ring >::val< coeffN >
 specialization for constants More...
 
struct  aerobus::polynomial< Ring >::val< coeffN >::coeff_at< index, E >
 
struct  aerobus::polynomial< Ring >::val< coeffN >::coeff_at< index, std::enable_if_t<(index==0)> >
 
struct  aerobus::polynomial< Ring >::val< coeffN >::coeff_at< index, std::enable_if_t<(index< 0||index > 0)> >
 
struct  aerobus::polynomial< Ring >::compensated_horner< arithmeticType, P >::EFTHorner< index, ghost >
 
struct  aerobus::polynomial< Ring >::compensated_horner< arithmeticType, P >::EFTHorner<-1, ghost >
 
struct  aerobus::Embed< Ring, FractionField< Ring > >
 embeds values from Ring to its field of fractions More...
 
struct  aerobus::Embed< q32, q64 >
 embeds q32 into q64 More...
 
struct  aerobus::Embed< polynomial< Small >, polynomial< Large > >
 embeds polynomial<Small> into polynomial<Large> More...
 
struct  aerobus::ContinuedFraction< values >
 represents a continued fraction a0 + \(\frac{1}{a_1+\frac{1}{a_2 + \ldots}}\) More...
 
struct  aerobus::ContinuedFraction< a0 >
 Specialization for only one coefficient, technically just 'a0'. More...
 
struct  aerobus::ContinuedFraction< a0, rest... >
 specialization for multiple coefficients (strictly more than one) More...
 
struct  aerobus::libm::sin_reduction< T >
 
struct  aerobus::libm::sin_reduction< T >::behavior
 
struct  aerobus::ConwayPolynomial
 

Namespaces

namespace  aerobus
 main namespace for all publicly exposed types or functions
 
namespace  aerobus::known_polynomials
 families of well known polynomials such as Hermite or Bernstein
 
namespace  aerobus::internal
 internal implementations, subject to breaking changes without notice
 
namespace  aerobus::libm
 holds mathematical functions (such as cosine or sin), correct to epsilon
 
namespace  aerobus::libm::internal
 internal implementation of libm, containins fpminimax polynomials given by Sollya
 

Concepts

concept  aerobus::IsRing
 Concept to express R is a Ring.
 
concept  aerobus::IsEuclideanDomain
 Concept to express R is an euclidean domain.
 
concept  aerobus::IsField
 Concept to express R is a field.
 

Macros

#define ALIGNED(x)   __attribute__((aligned(x)))
 
#define INLINED   __attribute__((always_inline)) inline
 
#define DEVICE
 

Typedefs

template<size_t i, typename... Ts>
using aerobus::internal::type_at_t = typename type_at< i, Ts... >::type
 
template<std::size_t N>
using aerobus::internal::make_index_sequence_reverse = decltype(index_sequence_reverse(std::make_index_sequence< N >{}))
 
template<typename T , typename A , typename B >
using aerobus::gcd_t = typename internal::gcd< T >::template type< A, B >
 computes the greatest common divisor or A and B
 
template<typename... vals>
using aerobus::vadd_t = typename internal::vadd< vals... >::type
 adds multiple values (v1 + v2 + ... + vn) vals must have same "enclosing_type" and "enclosing_type" must have an add_t binary operator
 
template<typename... vals>
using aerobus::vmul_t = typename internal::vmul< vals... >::type
 multiplies multiple values (v1 + v2 + ... + vn) vals must have same "enclosing_type" and "enclosing_type" must have an mul_t binary operator
 
template<typename val >
using aerobus::abs_t = std::conditional_t< val::enclosing_type::template pos_v< val >, val, typename val::enclosing_type::template sub_t< typename val::enclosing_type::zero, val > >
 computes absolute value of 'val' val must be a 'value' in a Ring satisfying 'IsEuclideanDomain' concept
 
template<typename Ring >
using aerobus::FractionField = typename internal::FractionFieldImpl< Ring >::type
 Fraction field of an euclidean domain, such as Q for Z.
 
template<typename X , typename Y >
using aerobus::add_t = typename X::enclosing_type::template add_t< X, Y >
 generic addition
 
template<typename X , typename Y >
using aerobus::sub_t = typename X::enclosing_type::template sub_t< X, Y >
 generic subtraction
 
template<typename X , typename Y >
using aerobus::mul_t = typename X::enclosing_type::template mul_t< X, Y >
 generic multiplication
 
template<typename X , typename Y >
using aerobus::div_t = typename X::enclosing_type::template div_t< X, Y >
 generic division
 
using aerobus::q32 = FractionField< i32 >
 32 bits rationals rationals with 32 bits numerator and denominator
 
using aerobus::fpq32 = FractionField< polynomial< q32 > >
 rational fractions with 32 bits rational coefficients rational fractions with rationals coefficients (32 bits numerator and denominator)
 
using aerobus::q64 = FractionField< i64 >
 64 bits rationals rationals with 64 bits numerator and denominator
 
using aerobus::pi64 = polynomial< i64 >
 polynomial with 64 bits integers coefficients
 
using aerobus::pq64 = polynomial< q64 >
 polynomial with 64 bits rationals coefficients
 
using aerobus::fpq64 = FractionField< polynomial< q64 > >
 polynomial with 64 bits rational coefficients
 
template<typename Ring , typename v1 , typename v2 >
using aerobus::makefraction_t = typename FractionField< Ring >::template val< v1, v2 >
 helper type : the rational V1/V2 in the field of fractions of Ring
 
template<typename v >
using aerobus::embed_int_poly_in_fractions_t = typename Embed< polynomial< typename v::ring_type >, polynomial< FractionField< typename v::ring_type > > >::template type< v >
 embed a polynomial with integers coefficients into rational coefficients polynomials
 
template<int64_t p, int64_t q>
using aerobus::make_q64_t = typename q64::template simplify_t< typename q64::val< i64::inject_constant_t< p >, i64::inject_constant_t< q > > >
 helper type : make a fraction from numerator and denominator
 
template<int32_t p, int32_t q>
using aerobus::make_q32_t = typename q32::template simplify_t< typename q32::val< i32::inject_constant_t< p >, i32::inject_constant_t< q > > >
 helper type : make a fraction from numerator and denominator
 
template<typename Ring , typename v1 , typename v2 >
using aerobus::addfractions_t = typename FractionField< Ring >::template add_t< v1, v2 >
 helper type : adds two fractions
 
template<typename Ring , typename v1 , typename v2 >
using aerobus::mulfractions_t = typename FractionField< Ring >::template mul_t< v1, v2 >
 helper type : multiplies two fractions
 
template<typename Ring , auto... xs>
using aerobus::make_int_polynomial_t = typename polynomial< Ring >::template val< typename Ring::template inject_constant_t< xs >... >
 make a polynomial with coefficients in Ring
 
template<typename Ring , auto... xs>
using aerobus::make_frac_polynomial_t = typename polynomial< FractionField< Ring > >::template val< typename FractionField< Ring >::template inject_constant_t< xs >... >
 make a polynomial with coefficients in FractionField<Ring>
 
template<typename T , size_t i>
using aerobus::factorial_t = typename internal::factorial< T, i >::type
 computes factorial(i), as type
 
template<typename T , size_t k, size_t n>
using aerobus::combination_t = typename internal::combination< T, k, n >::type
 computes binomial coefficient (k among n) as type
 
template<typename T , size_t n>
using aerobus::bernoulli_t = typename internal::bernoulli< T, n >::type
 nth bernoulli number as type in T
 
template<typename T , size_t n>
using aerobus::bell_t = typename internal::bell_helper< T, n >::type
 Bell numbers.
 
template<typename T , int k>
using aerobus::alternate_t = typename internal::alternate< T, k >::type
 (-1)^k as type in T
 
template<typename T , int n, int k>
using aerobus::stirling_1_signed_t = typename internal::stirling_1_helper< T, n, k >::type
 Stirling number of first king (signed) – as types.
 
template<typename T , int n, int k>
using aerobus::stirling_1_unsigned_t = abs_t< typename internal::stirling_1_helper< T, n, k >::type >
 Stirling number of first king (unsigned) – as types.
 
template<typename T , int n, int k>
using aerobus::stirling_2_t = typename internal::stirling_2_helper< T, n, k >::type
 Stirling number of second king – as types.
 
template<typename T , typename p , size_t n>
using aerobus::pow_t = typename internal::pow< T, p, n >::type
 p^n (as 'val' type in T)
 
template<typename T , template< typename, size_t index > typename coeff_at, size_t deg>
using aerobus::taylor = typename internal::make_taylor_impl< T, coeff_at, internal::make_index_sequence_reverse< deg+1 > >::type
 
template<typename Integers , size_t deg>
using aerobus::exp = taylor< Integers, internal::exp_coeff, deg >
 \(e^x\)
 
template<typename Integers , size_t deg>
using aerobus::expm1 = typename polynomial< FractionField< Integers > >::template sub_t< exp< Integers, deg >, typename polynomial< FractionField< Integers > >::one >
 \(e^x - 1\)
 
template<typename Integers , size_t deg>
using aerobus::lnp1 = taylor< Integers, internal::lnp1_coeff, deg >
 \(\ln(1+x)\)
 
template<typename Integers , size_t deg>
using aerobus::atan = taylor< Integers, internal::atan_coeff, deg >
 \(\arctan(x)\)
 
template<typename Integers , size_t deg>
using aerobus::sin = taylor< Integers, internal::sin_coeff, deg >
 \(\sin(x)\)
 
template<typename Integers , size_t deg>
using aerobus::sinh = taylor< Integers, internal::sh_coeff, deg >
 \(\sinh(x)\)
 
template<typename Integers , size_t deg>
using aerobus::cosh = taylor< Integers, internal::cosh_coeff, deg >
 \(\cosh(x)\) hyperbolic cosine
 
template<typename Integers , size_t deg>
using aerobus::cos = taylor< Integers, internal::cos_coeff, deg >
 \(\cos(x)\) cosinus
 
template<typename Integers , size_t deg>
using aerobus::geometric_sum = taylor< Integers, internal::geom_coeff, deg >
 \(\frac{1}{1-x}\) zero development of \(\frac{1}{1-x}\)
 
template<typename Integers , size_t deg>
using aerobus::asin = taylor< Integers, internal::asin_coeff, deg >
 \(\arcsin(x)\) arc sinus
 
template<typename Integers , size_t deg>
using aerobus::asinh = taylor< Integers, internal::asinh_coeff, deg >
 \(\mathrm{arcsinh}(x)\) arc hyperbolic sinus
 
template<typename Integers , size_t deg>
using aerobus::atanh = taylor< Integers, internal::atanh_coeff, deg >
 \(\mathrm{arctanh}(x)\) arc hyperbolic tangent
 
template<typename Integers , size_t deg>
using aerobus::tan = taylor< Integers, internal::tan_coeff, deg >
 \(\tan(x)\) tangent
 
template<typename Integers , size_t deg>
using aerobus::tanh = taylor< Integers, internal::tanh_coeff, deg >
 \(\tanh(x)\) hyperbolic tangent
 
using aerobus::PI_fraction = ContinuedFraction< 3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2, 2, 2, 1 >
 
using aerobus::E_fraction = ContinuedFraction< 2, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, 1, 1, 10, 1, 1, 12, 1, 1, 14, 1, 1 >
 approximation of \(e\)
 
using aerobus::SQRT2_fraction = ContinuedFraction< 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 >
 approximation of \(\sqrt{2}\)
 
using aerobus::SQRT3_fraction = ContinuedFraction< 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 >
 approximation of
 

Enumerations

enum  aerobus::known_polynomials::hermite_kind { aerobus::known_polynomials::probabilist , aerobus::known_polynomials::physicist }
 

Functions

template<typename T >
T * aerobus::aligned_malloc (size_t count, size_t alignment)
 
template<std::size_t... Is>
constexpr auto aerobus::internal::index_sequence_reverse (std::index_sequence< Is... > const &) -> decltype(std::index_sequence< sizeof...(Is) - 1U - Is... >{})
 
brief Conway polynomials tparam p characteristic of the aerobus::field (prime number) @tparam n degree of extension template< int p
 

Variables

template<template< typename... > typename TT, typename T >
constexpr bool aerobus::internal::is_instantiation_of_v = is_instantiation_of<TT, T>::value
 
template<typename T , size_t i>
constexpr T::inner_type aerobus::factorial_v = internal::factorial<T, i>::value
 computes factorial(i) as value in T
 
template<typename T , size_t k, size_t n>
constexpr T::inner_type aerobus::combination_v = internal::combination<T, k, n>::value
 computes binomial coefficients (k among n) as value
 
template<typename FloatType , typename T , size_t n>
constexpr FloatType aerobus::bernoulli_v = internal::bernoulli<T, n>::template value<FloatType>
 nth bernoulli number as value in FloatType
 
template<typename T , size_t k>
constexpr T::inner_type aerobus::alternate_v = internal::alternate<T, k>::value
 (-1)^k as value from T
 

Macro Definition Documentation

◆ ALIGNED

#define ALIGNED (   x)    __attribute__((aligned(x)))

◆ DEVICE

#define DEVICE

◆ INLINED

#define INLINED   __attribute__((always_inline)) inline