bit::polynomial
— Power Polynomial
Factory method to construct the polynomial \(p(x) = x^n\).
static bit::polynomial power(std::size_t n);
This polynomial will have \(n+1\) coefficients.
Example
#include <bit/bit.h>
int main()
{
auto p0 = bit::polynomial<>::power(0);
std::cout << std::format("p0(x) = {} has coefficients {:p}.\n", p0, p0.coefficients());
auto p1 = bit::polynomial<>::power(7);
std::cout << std::format("p1(x) = {} has coefficients {:p}.\n", p1, p1.coefficients());
}
Output
p0(x) = 1 has coefficients [1].
p1(x) = x^7 has coefficients [0 0 0 0 0 0 0 1].