pub struct Polynomial {
pub num: Vec<i32>,
}Expand description
Polynomial with coefficients in GF(256) Coefficients are stored in descending order (num[0] = highest degree)
Fields§
§num: Vec<i32>Implementations§
Source§impl Polynomial
impl Polynomial
pub fn get(&self, index: usize) -> i32
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn multiply(&self, e: &Polynomial) -> Polynomial
pub fn multiply(&self, e: &Polynomial) -> Polynomial
Multiply two polynomials in GF(256)
Sourcepub fn generate_rs_poly(ec_count: i32) -> Polynomial
pub fn generate_rs_poly(ec_count: i32) -> Polynomial
Generate Reed-Solomon error correction polynomial g(x) = (x + α^0)(x + α^1)…(x + α^(ec_count-1))
Sourcepub fn mod(&self, e: &Polynomial) -> Polynomial
pub fn mod(&self, e: &Polynomial) -> Polynomial
Polynomial modulo operation (descending order)
Sourcepub fn mod_with_shift(&self, e: &Polynomial, shift: i32) -> Polynomial
pub fn mod_with_shift(&self, e: &Polynomial, shift: i32) -> Polynomial
Modulo with shift (for RS error correction calculation)
Auto Trait Implementations§
impl Freeze for Polynomial
impl RefUnwindSafe for Polynomial
impl Send for Polynomial
impl Sync for Polynomial
impl Unpin for Polynomial
impl UnsafeUnpin for Polynomial
impl UnwindSafe for Polynomial
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more