pub struct FullModuleHomomorphism<S: Module, T: Module<Algebra = S::Algebra> = S> {
source: Arc<S>,
target: Arc<T>,
degree_shift: i32,
matrices: OnceBiVec<Matrix>,
quasi_inverses: OnceBiVec<QuasiInverse>,
kernels: OnceBiVec<Subspace>,
images: OnceBiVec<Subspace>,
}Expand description
A ModuleHomomorphism that simply records the matrix of the homomorphism in every degree. This is currently rather bare bones.
Fields§
§source: Arc<S>§target: Arc<T>§degree_shift: i32§matrices: OnceBiVec<Matrix>The matrices of the module homomorphism. Unspecified matrices are assumed to be zero
quasi_inverses: OnceBiVec<QuasiInverse>§kernels: OnceBiVec<Subspace>§images: OnceBiVec<Subspace>Implementations§
Source§impl<A, S, T> FullModuleHomomorphism<S, T>
impl<A, S, T> FullModuleHomomorphism<S, T>
pub fn new(source: Arc<S>, target: Arc<T>, degree_shift: i32) -> Self
pub fn from_matrices( source: Arc<S>, target: Arc<T>, degree_shift: i32, matrices: BiVec<Matrix>, ) -> Self
pub fn from<F: ModuleHomomorphism<Source = S, Target = T>>(f: &F) -> Self
Sourcepub fn replace_source<S_: Module<Algebra = A>>(
self,
source: Arc<S_>,
) -> FullModuleHomomorphism<S_, T>
pub fn replace_source<S_: Module<Algebra = A>>( self, source: Arc<S_>, ) -> FullModuleHomomorphism<S_, T>
This function replaces the source of the ModuleHomomorphism and does nothing else. This is useful for changing the type of the source (but not the mathematical module itself).
Sourcepub fn replace_target<T_: Module<Algebra = A>>(
self,
target: Arc<T_>,
) -> FullModuleHomomorphism<S, T_>
pub fn replace_target<T_: Module<Algebra = A>>( self, target: Arc<T_>, ) -> FullModuleHomomorphism<S, T_>
See replace_source
Trait Implementations§
Source§impl<S: Module> IdentityHomomorphism<S> for FullModuleHomomorphism<S, S>
impl<S: Module> IdentityHomomorphism<S> for FullModuleHomomorphism<S, S>
fn identity_homomorphism(source: Arc<S>) -> Self
Source§impl<S: Module, T: Module<Algebra = S::Algebra>> ModuleHomomorphism for FullModuleHomomorphism<S, T>
impl<S: Module, T: Module<Algebra = S::Algebra>> ModuleHomomorphism for FullModuleHomomorphism<S, T>
type Source = S
type Target = T
fn source(&self) -> Arc<Self::Source>
fn target(&self) -> Arc<Self::Target>
fn degree_shift(&self) -> i32
Source§fn apply_to_basis_element(
&self,
result: FpSliceMut<'_>,
coeff: u32,
input_degree: i32,
input_idx: usize,
)
fn apply_to_basis_element( &self, result: FpSliceMut<'_>, coeff: u32, input_degree: i32, input_idx: usize, )
Calling this function when
input_idx < source().dimension(input_degree) results in
undefined behaviour. Implementations are encouraged to panic when this happens (this is
usually the case because of out-of-bounds errors.fn image(&self, degree: i32) -> Option<&Subspace>
fn quasi_inverse(&self, degree: i32) -> Option<&QuasiInverse>
fn kernel(&self, degree: i32) -> Option<&Subspace>
fn compute_auxiliary_data_through_degree(&self, degree: i32)
fn apply( &self, result: FpSliceMut<'_>, coeff: u32, input_degree: i32, input: FpSlice<'_>, )
fn prime(&self) -> ValidPrime
fn min_degree(&self) -> i32
Source§fn auxiliary_data(&self, degree: i32) -> (Subspace, Subspace, QuasiInverse)
fn auxiliary_data(&self, degree: i32) -> (Subspace, Subspace, QuasiInverse)
Compute the auxiliary data associated to the homomorphism at input degree
degree. Returns
it in the order image, kernel, quasi_inverseSource§fn get_matrix(&self, matrix: MatrixSliceMut<'_>, degree: i32)
fn get_matrix(&self, matrix: MatrixSliceMut<'_>, degree: i32)
Source§fn get_partial_matrix(&self, degree: i32, inputs: &[usize]) -> Matrix
fn get_partial_matrix(&self, degree: i32, inputs: &[usize]) -> Matrix
Get the values of the homomorphism on the specified inputs to
matrix.Source§fn apply_quasi_inverse(
&self,
result: FpSliceMut<'_>,
degree: i32,
input: FpSlice<'_>,
) -> bool
fn apply_quasi_inverse( &self, result: FpSliceMut<'_>, degree: i32, input: FpSlice<'_>, ) -> bool
Attempt to apply quasi inverse to the input. Returns whether the operation was
successful. This is required to either always succeed or always fail for each degree.
Source§impl<S: Module, T: Module<Algebra = S::Algebra>> ZeroHomomorphism<S, T> for FullModuleHomomorphism<S, T>
impl<S: Module, T: Module<Algebra = S::Algebra>> ZeroHomomorphism<S, T> for FullModuleHomomorphism<S, T>
Auto Trait Implementations§
impl<S, T = S> !Freeze for FullModuleHomomorphism<S, T>
impl<S, T> RefUnwindSafe for FullModuleHomomorphism<S, T>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> Send for FullModuleHomomorphism<S, T>
impl<S, T> Sync for FullModuleHomomorphism<S, T>
impl<S, T> Unpin for FullModuleHomomorphism<S, T>
impl<S, T = S> !UnwindSafe for FullModuleHomomorphism<S, T>
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,
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