1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright © 2023 Marvin Beckmann
//
// This file is part of qFALL-math.
//
// qFALL-math is free software: you can redistribute it and/or modify it under
// the terms of the Mozilla Public License Version 2.0 as published by the
// Mozilla Foundation. See <https://mozilla.org/en-US/MPL/2.0/>.
//! [`PolyOverZ`] is a type of polynomial with arbitrarily many coefficients of type
//! [`Z`](crate::integer::Z)
//! This implementation uses the [FLINT](https://flintlib.org/) library.
use fmpz_poly_struct;
use fmt;
pub
/// [`PolyOverZ`] is a type of polynomial with arbitrarily many coefficients of type
/// [`Z`](crate::integer::Z).
///
// Attributes:
// - `poly`: holds the content of the polynomial
//
/// # Examples
/// ```
/// use qfall_math::integer::{PolyOverZ, Z};
/// use qfall_math::traits::*;
/// use std::str::FromStr;
///
/// // instantiations
/// let poly_1 = PolyOverZ::from_str("4 0 1 2 3").unwrap();
/// let poly_2 = PolyOverZ::default();
///
/// // arithmetic operations
/// let _ = &poly_1 + &poly_2;
/// let _ = &poly_1 * &poly_2;
///
/// // evaluate function
/// let value = Z::from(3);
/// let res: Z = poly_1.evaluate(&value);
///
/// // comparison
/// assert_ne!(poly_1, poly_2);
/// ```