Struct p25::coding::galois::Codeword
[−]
[src]
pub struct Codeword<F: GaloisField> { /* fields omitted */ }Codeword in a Galois field.
Methods
impl<F: GaloisField> Codeword<F>[src]
pub fn new(bits: u8) -> Codeword<F>[src]
Construct a new Codeword αi from the given bit pattern. Panic if the
pattern is invalid in the field.
pub fn for_power(power: usize) -> Codeword<F>[src]
Construct a new Codeword αm ≡ αi (modulo the field) for
the given power i.
pub fn bits(&self) -> u8[src]
Retrieve the bit pattern of the codeword.
pub fn zero(&self) -> bool[src]
Check if the codeword is zero.
pub fn power(&self) -> Option<usize>[src]
Retrieve the power i of the current codeword αi. Return Some(i) if
the power is defined and None if the codeword is zero.
pub fn invert(self) -> Codeword<F>[src]
Find 1/αi for the current codeword αi. Panic if the codeword is zero.
pub fn pow(&self, pow: usize) -> Codeword<F>[src]
Compute (αi)p for the current codeword αi and given power p.
Trait Implementations
impl<F: Copy + GaloisField> Copy for Codeword<F>[src]
impl<F: Clone + GaloisField> Clone for Codeword<F>[src]
fn clone(&self) -> Codeword<F>[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<F: GaloisField> Default for Codeword<F>[src]
impl<F: GaloisField> Add for Codeword<F>[src]
Add codewords using Galois addition.
type Output = Codeword<F>
The resulting type after applying the + operator.
fn add(self, rhs: Codeword<F>) -> Self::Output[src]
Performs the + operation.
impl<F: GaloisField> Sub for Codeword<F>[src]
"Subtract" codewords, which is equivalent to addition.
type Output = Codeword<F>
The resulting type after applying the - operator.
fn sub(self, rhs: Codeword<F>) -> Self::Output[src]
Performs the - operation.
impl<F: GaloisField> Mul for Codeword<F>[src]
Mutiply codewords using Galois multiplication.
type Output = Codeword<F>
The resulting type after applying the * operator.
fn mul(self, rhs: Codeword<F>) -> Self::Output[src]
Performs the * operation.
impl<F: GaloisField> Div for Codeword<F>[src]
Divide codewords using Galois division. Panic if the divisor is zero.
type Output = Codeword<F>
The resulting type after applying the / operator.
fn div(self, rhs: Codeword<F>) -> Self::Output[src]
Performs the / operation.
impl<F: GaloisField> PartialEq for Codeword<F>[src]
Check equality of two codewords.
fn eq(&self, other: &Self) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<F: GaloisField> Eq for Codeword<F>[src]
impl<F: GaloisField> PartialEq<u8> for Codeword<F>[src]
Check equality of the codeword's bit pattern with raw bits.
fn eq(&self, other: &u8) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.