pub struct MuFreeModule<const U: bool, A: MuAlgebra<U>> {
algebra: Arc<A>,
name: String,
min_degree: i32,
gen_names: OnceBiVec<Vec<String>>,
gen_deg_idx_to_internal_idx: OnceBiVec<usize>,
num_gens: OnceBiVec<usize>,
basis_element_to_opgen: OnceBiVec<OnceVec<OperationGeneratorPair>>,
generator_to_index: OnceBiVec<OnceVec<usize>>,
}Expand description
A free module.
A free module is uniquely determined by its list of generators. The generators are listed in increasing degrees, and the index in this list is the internal index.
Fields§
§algebra: Arc<A>§name: String§min_degree: i32§gen_names: OnceBiVec<Vec<String>>§gen_deg_idx_to_internal_idx: OnceBiVec<usize>degree -> internal index of first generator in degree
num_gens: OnceBiVec<usize>§basis_element_to_opgen: OnceBiVec<OnceVec<OperationGeneratorPair>>§generator_to_index: OnceBiVec<OnceVec<usize>>degree -> internal_gen_idx -> the offset of the generator in degree
Implementations§
Source§impl<const U: bool, A: MuAlgebra<U>> MuFreeModule<U, A>
impl<const U: bool, A: MuAlgebra<U>> MuFreeModule<U, A>
Source§impl<const U: bool, A: MuAlgebra<U>> MuFreeModule<U, A>
impl<const U: bool, A: MuAlgebra<U>> MuFreeModule<U, A>
pub fn gen_names(&self) -> &OnceBiVec<Vec<String>>
pub fn number_of_gens_in_degree(&self, degree: i32) -> usize
pub fn add_generators( &self, degree: i32, num_gens: usize, names: Option<Vec<String>>, )
Sourcepub fn internal_generator_offset(
&self,
degree: i32,
internal_gen_idx: usize,
) -> usize
pub fn internal_generator_offset( &self, degree: i32, internal_gen_idx: usize, ) -> usize
Given a generator (gen_deg, gen_idx), find the first index in degree degree with
elements from the generator.
Sourcepub fn iter_gens(&self, degree: i32) -> impl Iterator<Item = (i32, usize)> + '_
pub fn iter_gens(&self, degree: i32) -> impl Iterator<Item = (i32, usize)> + '_
Iterate the degrees and indices of each generator up to degree degree.
Sourcepub fn iter_gen_offsets<const N: usize>(
&self,
degree: [i32; N],
) -> impl Iterator<Item = GeneratorData<N>> + '_
pub fn iter_gen_offsets<const N: usize>( &self, degree: [i32; N], ) -> impl Iterator<Item = GeneratorData<N>> + '_
Iterate the degrees and offsets of each generator up to degree degree.
Sourcepub fn generator_offset(
&self,
degree: i32,
gen_deg: i32,
gen_idx: usize,
) -> usize
pub fn generator_offset( &self, degree: i32, gen_deg: i32, gen_idx: usize, ) -> usize
Given a generator (gen_deg, gen_idx), find the first index in degree degree with
elements from the generator.
pub fn operation_generator_to_index( &self, op_deg: i32, op_idx: usize, gen_deg: i32, gen_idx: usize, ) -> usize
pub fn index_to_op_gen( &self, degree: i32, index: usize, ) -> &OperationGeneratorPair
pub fn extend_by_zero(&self, degree: i32)
Sourcepub fn slice_vector<'a>(
&self,
degree: i32,
gen_degree: i32,
gen_index: usize,
v: FpSlice<'a>,
) -> FpSlice<'a>
pub fn slice_vector<'a>( &self, degree: i32, gen_degree: i32, gen_index: usize, v: FpSlice<'a>, ) -> FpSlice<'a>
Given a vector that represents an element in degree degree, slice it to the part that
represents the terms that correspond to the specified generator.
Sourcepub fn iter_slices<'a>(
&'a self,
degree: i32,
slice: FpSlice<'a>,
) -> impl Iterator<Item = (i32, usize, i32, FpSlice<'a>)> + 'a
pub fn iter_slices<'a>( &'a self, degree: i32, slice: FpSlice<'a>, ) -> impl Iterator<Item = (i32, usize, i32, FpSlice<'a>)> + 'a
Given an element in a degree, iterate through the slices corresponding to each generator.
Each item of the iterator is (gen_degree, gen_index, op_degree, slice). This skips slices
that are zero length.
Trait Implementations§
Source§impl<const U: bool, A: MuAlgebra<U>> Module for MuFreeModule<U, A>
impl<const U: bool, A: MuAlgebra<U>> Module for MuFreeModule<U, A>
type Algebra = A
Source§fn min_degree(&self) -> i32
fn min_degree(&self) -> i32
Source§fn max_computed_degree(&self) -> i32
fn max_computed_degree(&self) -> i32
t for which the module is fully defined at t. See Module documentation
for more details.Source§fn max_generator_degree(&self) -> Option<i32>
fn max_generator_degree(&self) -> Option<i32>
Source§fn compute_basis(&self, max_degree: i32)
fn compute_basis(&self, max_degree: i32)
degree.
This should be run by the user whenever they want to query such information. Read moreSource§fn basis_element_to_string(&self, degree: i32, idx: usize) -> String
fn basis_element_to_string(&self, degree: i32, idx: usize) -> String
fn act_on_basis( &self, result: FpSliceMut<'_>, coeff: u32, op_degree: i32, op_index: usize, mod_degree: i32, mod_index: usize, )
Source§fn act(
&self,
result: FpSliceMut<'_>,
coeff: u32,
op_degree: i32,
op_index: usize,
input_degree: i32,
input: FpSlice<'_>,
)
fn act( &self, result: FpSliceMut<'_>, coeff: u32, op_degree: i32, op_index: usize, input_degree: i32, input: FpSlice<'_>, )
input need not be equal to the dimension of the module in said degree.
Missing entries are interpreted to be 0, while extra entries must be zero. Read moreSource§fn prime(&self) -> ValidPrime
fn prime(&self) -> ValidPrime
Source§fn max_degree(&self) -> Option<i32>
fn max_degree(&self) -> Option<i32>
max_degree is the a degree such that if t > max_degree, then self.dimension(t) = 0.fn total_dimension(&self) -> usize
fn act_by_element( &self, result: FpSliceMut<'_>, coeff: u32, op_degree: i32, op: FpSlice<'_>, input_degree: i32, input: FpSlice<'_>, )
fn act_by_element_on_basis( &self, result: FpSliceMut<'_>, coeff: u32, op_degree: i32, op: FpSlice<'_>, input_degree: i32, input_index: usize, )
Source§fn element_to_string(&self, degree: i32, element: FpSlice<'_>) -> String
fn element_to_string(&self, degree: i32, element: FpSlice<'_>) -> String
Module::basis_element_to_string in the obvious way.Source§impl<const U: bool, M: Module> ZeroHomomorphism<MuFreeModule<U, <M as Module>::Algebra>, M> for MuFreeModuleHomomorphism<U, M>
impl<const U: bool, M: Module> ZeroHomomorphism<MuFreeModule<U, <M as Module>::Algebra>, M> for MuFreeModuleHomomorphism<U, M>
fn zero_homomorphism( source: Arc<MuFreeModule<U, M::Algebra>>, target: Arc<M>, degree_shift: i32, ) -> Self
Source§impl<const U: bool, A: MuAlgebra<U>> ZeroModule for MuFreeModule<U, A>
impl<const U: bool, A: MuAlgebra<U>> ZeroModule for MuFreeModule<U, A>
fn zero_module(algebra: Arc<A>, min_degree: i32) -> Self
Auto Trait Implementations§
impl<const U: bool, A> !Freeze for MuFreeModule<U, A>
impl<const U: bool, A> RefUnwindSafe for MuFreeModule<U, A>where
A: RefUnwindSafe,
impl<const U: bool, A> Send for MuFreeModule<U, A>
impl<const U: bool, A> Sync for MuFreeModule<U, A>
impl<const U: bool, A> Unpin for MuFreeModule<U, A>
impl<const U: bool, A> !UnwindSafe for MuFreeModule<U, A>
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
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>
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>
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