pub struct QuasiInverse {
image: Option<Vec<isize>>,
preimage: Matrix,
}Expand description
Given a matrix M, a quasi-inverse Q is a map from the co-domain to the domain such that xQM = x for all x in the image (recall our matrices act on the right).
§Fields
image- The image of the original matrix. If the image is omitted, it is assumed to be everything (with the standard basis).preimage- The actual quasi-inverse, where the basis of the image is that given byimage.
Fields§
§image: Option<Vec<isize>>§preimage: MatrixImplementations§
Source§impl QuasiInverse
impl QuasiInverse
pub fn new(image: Option<Vec<isize>>, preimage: Matrix) -> Self
pub fn image_dimension(&self) -> usize
pub fn source_dimension(&self) -> usize
pub fn target_dimension(&self) -> usize
pub fn to_bytes(&self, buffer: &mut impl Write) -> Result<()>
pub fn from_bytes(p: ValidPrime, data: &mut impl Read) -> Result<Self>
Sourcepub fn stream_quasi_inverse<T, S>(
p: ValidPrime,
data: &mut impl Read,
results: &mut [T],
inputs: &[S],
) -> Result<()>
pub fn stream_quasi_inverse<T, S>( p: ValidPrime, data: &mut impl Read, results: &mut [T], inputs: &[S], ) -> Result<()>
Given a data file containing a quasi-inverse, apply it to all the vectors in input
and write the results to the corresponding vectors in results. This reads in the
quasi-inverse row by row to minimize memory usage.
pub fn preimage(&self) -> &Matrix
pub fn pivots(&self) -> Option<&[isize]>
pub fn prime(&self) -> ValidPrime
Sourcepub fn apply(&self, target: FpSliceMut<'_>, coeff: u32, input: FpSlice<'_>)
pub fn apply(&self, target: FpSliceMut<'_>, coeff: u32, input: FpSlice<'_>)
Apply the quasi-inverse to an input vector and add a constant multiple of the result to an output vector
§Arguments
target- The output vectorcoeff- The constant multiple aboveinput- The input vector, expressed in the basis of the ambient space
Trait Implementations§
Source§impl Clone for QuasiInverse
impl Clone for QuasiInverse
Source§fn clone(&self) -> QuasiInverse
fn clone(&self) -> QuasiInverse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QuasiInverse
impl Debug for QuasiInverse
Source§impl<'de> Deserialize<'de> for QuasiInverse
impl<'de> Deserialize<'de> for QuasiInverse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for QuasiInverse
impl PartialEq for QuasiInverse
Source§impl Serialize for QuasiInverse
impl Serialize for QuasiInverse
impl Eq for QuasiInverse
impl StructuralPartialEq for QuasiInverse
Auto Trait Implementations§
impl Freeze for QuasiInverse
impl RefUnwindSafe for QuasiInverse
impl Send for QuasiInverse
impl Sync for QuasiInverse
impl Unpin for QuasiInverse
impl UnwindSafe for QuasiInverse
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. 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