pub struct Codeword<F: GaloisField> { /* private fields */ }
Expand description

Codeword in a Galois field.

Implementations

Construct a new Codeword αi from the given bit pattern. Panic if the pattern is invalid in the field.

Construct a new Codeword αm ≡ αi (modulo the field) for the given power i.

Retrieve the bit pattern of the codeword.

Check if the codeword is zero.

Retrieve the power i of the current codeword αi. Return Some(i) if the power is defined and None if the codeword is zero.

Find 1/αi for the current codeword αi. Panic if the codeword is zero.

Compute (αi)p for the current codeword αi and given power p.

Trait Implementations

Add codewords using Galois addition.

The resulting type after applying the + operator.

Performs the + operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Construct the additive identity codeword α0 = 1.

Divide codewords using Galois division. Panic if the divisor is zero.

The resulting type after applying the / operator.

Performs the / operation. Read more

Mutiply codewords using Galois multiplication.

The resulting type after applying the * operator.

Performs the * operation. Read more

Scale polynomial by a codeword.

The resulting type after applying the * operator.

Performs the * operation. Read more

Check equality of two codewords.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Check equality of the codeword’s bit pattern with raw bits.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

“Subtract” codewords, which is equivalent to addition.

The resulting type after applying the - operator.

Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.