use crate::integer::debug_fmpz;
use flint3_sys::fmpq_poly_struct;
use std::fmt;
mod arithmetic;
mod cmp;
mod coefficient_embedding;
mod default;
mod dot_product;
mod evaluate;
mod from;
mod get;
mod norm;
mod ownership;
mod properties;
mod rounding;
mod sample;
mod serialize;
mod set;
mod to_string;
mod unsafe_functions;
pub struct PolyOverQ {
pub(crate) poly: fmpq_poly_struct,
}
impl fmt::Debug for PolyOverQ {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"PolyOverQ {{poly_f64(may be rounded; 5 decimals): {}, poly: {}, \
storage: {{ poly: {}}}}}",
self.to_string_decimal(5),
self,
debug_fmpq_poly_struct(&self.poly)
)
}
}
fn debug_fmpq_poly_struct(value: &fmpq_poly_struct) -> String {
format!(
"fmpq_poly_struct {{ coeffs: {:#x}, den: [{}], alloc: {}, length: {} }}",
value.coeffs.addr(),
debug_fmpz(&value.den[0]),
value.alloc,
value.length
)
}