use crate::integer_polynomial::arithmetic::coefficient::PolynomialCoefficient;
use crate::integer_polynomial::arithmetic::mul::mul_greater_to_out;
use crate::integer_polynomial::arithmetic::square::square_to_out;
use alloc::vec;
crate_test_fn! {pow_to_out_small<C: PolynomialCoefficient>(out: &mut [C], xs: &[C], e: u64) {
match e {
0 => out[0] = C::ONE,
1 => out.clone_from_slice(xs),
2 => square_to_out(out, xs),
3 => {
let alloc = (xs.len() << 1) - 1;
let mut t = vec![C::ZERO; alloc];
square_to_out(&mut t, xs);
mul_greater_to_out(out, &t, xs);
}
4 => {
let alloc = (xs.len() << 1) - 1;
let mut t = vec![C::ZERO; alloc];
square_to_out(&mut t, xs);
square_to_out(out, &t);
}
_ => panic!("e must be less than 5, but is {e}"),
}
}}