pub(crate) struct PatternMatrix<const LIMBS: usize> {
pub m00: Uint<LIMBS>,
pub m01: Uint<LIMBS>,
pub m10: Uint<LIMBS>,
pub m11: Uint<LIMBS>,
pub pattern: Choice,
}Expand description
2x2-Matrix where either the diagonal or off-diagonal elements are negative.
The internal state represents the matrix
true false
[ m00 -m01 ] [ -m00 m01 ]
[ -m10 m11 ] or [ m10 -m11 ]depending on whether pattern is respectively truthy or not.
Fields§
§m00: Uint<LIMBS>§m01: Uint<LIMBS>§m10: Uint<LIMBS>§m11: Uint<LIMBS>§pattern: ChoiceImplementations§
Source§impl<const LIMBS: usize> PatternMatrix<LIMBS>
impl<const LIMBS: usize> PatternMatrix<LIMBS>
pub const UNIT: Self
Sourcepub(crate) const fn extended_apply_to<const VEC_LIMBS: usize>(
&self,
vec: (Uint<VEC_LIMBS>, Uint<VEC_LIMBS>),
) -> (ExtendedInt<VEC_LIMBS, LIMBS>, ExtendedInt<VEC_LIMBS, LIMBS>)
pub(crate) const fn extended_apply_to<const VEC_LIMBS: usize>( &self, vec: (Uint<VEC_LIMBS>, Uint<VEC_LIMBS>), ) -> (ExtendedInt<VEC_LIMBS, LIMBS>, ExtendedInt<VEC_LIMBS, LIMBS>)
Apply this matrix to a vector of Uints, returning the result as a vector of
ExtendedInts.
Sourcepub(super) const fn mul_int_matrix<const RHS_LIMBS: usize>(
&self,
rhs: &IntMatrix<RHS_LIMBS>,
) -> IntMatrix<RHS_LIMBS>
pub(super) const fn mul_int_matrix<const RHS_LIMBS: usize>( &self, rhs: &IntMatrix<RHS_LIMBS>, ) -> IntMatrix<RHS_LIMBS>
Wrapping apply this matrix to rhs. Return the result in a IntMatrix<RHS_LIMBS>.
Sourcepub(crate) const fn conditional_swap_rows(&mut self, swap: Choice)
pub(crate) const fn conditional_swap_rows(&mut self, swap: Choice)
Swap the rows of this matrix if swap is truthy. Otherwise, do nothing.
Sourcepub(crate) const fn conditional_subtract_bottom_row_from_top(
&mut self,
subtract: Choice,
)
pub(crate) const fn conditional_subtract_bottom_row_from_top( &mut self, subtract: Choice, )
Subtract the bottom row from the top if subtract is truthy. Otherwise, do nothing.
Sourcepub(crate) const fn conditional_subtract_right_column_from_left(
&mut self,
subtract: Choice,
)
pub(crate) const fn conditional_subtract_right_column_from_left( &mut self, subtract: Choice, )
Subtract the right column from the left if subtract is truthy. Otherwise, do nothing.
Sourcepub(crate) const fn conditional_add_right_column_to_left(&mut self, add: Choice)
pub(crate) const fn conditional_add_right_column_to_left(&mut self, add: Choice)
If add is truthy, add the right column to the left. Otherwise, do nothing.
Sourcepub(crate) const fn conditional_double_bottom_row(&mut self, double: Choice)
pub(crate) const fn conditional_double_bottom_row(&mut self, double: Choice)
Double the bottom row of this matrix if double is truthy. Otherwise, do nothing.
Sourcepub(crate) const fn conditional_negate(&mut self, negate: Choice)
pub(crate) const fn conditional_negate(&mut self, negate: Choice)
Negate the elements in this matrix if negate is truthy. Otherwise, do nothing.
Trait Implementations§
Source§impl<const LIMBS: usize> Clone for PatternMatrix<LIMBS>
impl<const LIMBS: usize> Clone for PatternMatrix<LIMBS>
Source§fn clone(&self) -> PatternMatrix<LIMBS>
fn clone(&self) -> PatternMatrix<LIMBS>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more