How to build your own sequence of known polynomials, here Abel polynomials
#include <iostream>
#include "../src/aerobus.h"
template<typename I = aerobus::i64>
struct AbelHelper {
private:
public:
template<size_t deg, I::inner_type an>
struct Inner {
typename Inner<deg-1, an>::type,
>;
};
template<I::inner_type an>
struct Inner<0, an> {
using type = P::one;
};
template<I::inner_type an>
struct Inner<1, an> {
using type = P::X;
};
};
template<size_t n, auto a, typename I = aerobus::i64>
using AbelPolynomials = typename AbelHelper<I>::template Inner<n, a*n>::type;
using A2_3 = AbelPolynomials<3, 2>;
int main() {
std::cout << "expected = x^3 - 12 x^2 + 36 x" << std::endl;
std::cout << "aerobus = " << A2_3::to_string() << std::endl;
return 0;
}
typename X::enclosing_type::template mul_t< X, Y > mul_t
generic multiplication
Definition aerobus.h:2914
typename X::enclosing_type::template sub_t< X, Y > sub_t
generic subtraction
Definition aerobus.h:2906
Definition aerobus.h:1807