pub struct Codeword<F: GaloisField> { /* private fields */ }
Expand description
Codeword in a Galois field.
Implementations§
Source§impl<F: GaloisField> Codeword<F>
impl<F: GaloisField> Codeword<F>
Sourcepub fn new(bits: u8) -> Codeword<F>
pub fn new(bits: u8) -> Codeword<F>
Construct a new Codeword
αi from the given bit pattern. Panic if the
pattern is invalid in the field.
Sourcepub fn for_power(power: usize) -> Codeword<F>
pub fn for_power(power: usize) -> Codeword<F>
Construct a new Codeword
αm ≡ αi (modulo the field) for
the given power i.
Sourcepub fn power(&self) -> Option<usize>
pub fn power(&self) -> Option<usize>
Retrieve the power i of the current codeword αi. Return Some(i)
if
the power is defined and None
if the codeword is zero.
Trait Implementations§
Source§impl<F: GaloisField> Add for Codeword<F>
Add codewords using Galois addition.
impl<F: GaloisField> Add for Codeword<F>
Add codewords using Galois addition.
Source§impl<F: GaloisField> Debug for Codeword<F>
impl<F: GaloisField> Debug for Codeword<F>
Source§impl<F: GaloisField> Default for Codeword<F>
impl<F: GaloisField> Default for Codeword<F>
Source§impl<F: GaloisField> Div for Codeword<F>
Divide codewords using Galois division. Panic if the divisor is zero.
impl<F: GaloisField> Div for Codeword<F>
Divide codewords using Galois division. Panic if the divisor is zero.
Source§impl<P: PolynomialCoefs> Mul<Codeword<P25Field>> for Polynomial<P>
Scale polynomial by a codeword.
impl<P: PolynomialCoefs> Mul<Codeword<P25Field>> for Polynomial<P>
Scale polynomial by a codeword.
Source§type Output = Polynomial<P>
type Output = Polynomial<P>
The resulting type after applying the
*
operator.Source§impl<F: GaloisField> Mul for Codeword<F>
Mutiply codewords using Galois multiplication.
impl<F: GaloisField> Mul for Codeword<F>
Mutiply codewords using Galois multiplication.
Source§impl<F: GaloisField> PartialEq<u8> for Codeword<F>
Check equality of the codeword’s bit pattern with raw bits.
impl<F: GaloisField> PartialEq<u8> for Codeword<F>
Check equality of the codeword’s bit pattern with raw bits.
Source§impl<F: GaloisField> PartialEq for Codeword<F>
Check equality of two codewords.
impl<F: GaloisField> PartialEq for Codeword<F>
Check equality of two codewords.
Source§impl<F: GaloisField> Sub for Codeword<F>
“Subtract” codewords, which is equivalent to addition.
impl<F: GaloisField> Sub for Codeword<F>
“Subtract” codewords, which is equivalent to addition.
impl<F: Copy + GaloisField> Copy for Codeword<F>
impl<F: GaloisField> Eq for Codeword<F>
Auto Trait Implementations§
impl<F> Freeze for Codeword<F>
impl<F> RefUnwindSafe for Codeword<F>where
F: RefUnwindSafe,
impl<F> Send for Codeword<F>where
F: Send,
impl<F> Sync for Codeword<F>where
F: Sync,
impl<F> Unpin for Codeword<F>where
F: Unpin,
impl<F> UnwindSafe for Codeword<F>where
F: UnwindSafe,
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