pub struct ReedSolomon<F> { /* private fields */ }Expand description
Systematic Reed–Solomon [n, k, n-k+1] encoder
over the additive-FFT subspaces W_k ⊂ W_n:
encode(msg)[..k] == msg (Lin–Chung–Han 2014).
Implementations§
Source§impl<F: BinaryFieldExtras + HardwareField> ReedSolomon<F>
impl<F: BinaryFieldExtras + HardwareField> ReedSolomon<F>
Sourcepub fn new(log_k: u32, log_n: u32) -> Result<Self, RsError>
pub fn new(log_k: u32, log_n: u32) -> Result<Self, RsError>
k = 2^log_k message and n = 2^log_n codeword symbols,
1 <= log_k < log_n <= min(F::BITS, usize::BITS - 1).
The only allocation is the two twiddle schedules.
pub fn message_len(&self) -> usize
pub fn codeword_len(&self) -> usize
Sourcepub fn encode_scalar(
&self,
msg: &[Flat<F>],
out: &mut [Flat<F>],
) -> Result<(), RsError>
pub fn encode_scalar( &self, msg: &[Flat<F>], out: &mut [Flat<F>], ) -> Result<(), RsError>
Encode one row: msg.len() == k,
out.len() == n, out[..k] == msg on return.
Sourcepub fn encode(
&self,
msg: &[PackedFlat<F>],
out: &mut [PackedFlat<F>],
) -> Result<(), RsError>
pub fn encode( &self, msg: &[PackedFlat<F>], out: &mut [PackedFlat<F>], ) -> Result<(), RsError>
Encode F::WIDTH rows in lockstep. Lengths are in
packed elements: msg.len() == k, out.len() == n.
Auto Trait Implementations§
impl<F> Freeze for ReedSolomon<F>
impl<F> RefUnwindSafe for ReedSolomon<F>where
F: RefUnwindSafe,
impl<F> Send for ReedSolomon<F>where
F: Send,
impl<F> Sync for ReedSolomon<F>where
F: Sync,
impl<F> Unpin for ReedSolomon<F>
impl<F> UnsafeUnpin for ReedSolomon<F>
impl<F> UnwindSafe for ReedSolomon<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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more