pub struct BlockStructure {
basis_element_to_block_idx: Vec<GeneratorBasisEltPair>,
blocks: BiVec<Vec<Range<usize>>>,
}Expand description
A structure that makes it efficient to convert between an index into a sum of vector spaces and an index into an individual one.
For instance, a FreeModule has some collection of generators in various degrees and a general element is a homogenous sum \sum Op^i x_i. The basis for the FreeModule is divided into a block for each generator x_i. The entries in the block correspond to a basis for the algebra. In order to multiply by a steenrod operation, we have to pull out each block and multiply each block separately by the steenrod operation.
Fields§
§basis_element_to_block_idx: Vec<GeneratorBasisEltPair>§blocks: BiVec<Vec<Range<usize>>>Implementations§
Source§impl BlockStructure
impl BlockStructure
pub fn new(block_sizes: &BiVec<Vec<usize>>) -> Self
Sourcepub fn generator_to_block(&self, gen_deg: i32, gen_idx: usize) -> Range<usize>
pub fn generator_to_block(&self, gen_deg: i32, gen_idx: usize) -> Range<usize>
Find the block corresponding to a given generator.
Sourcepub fn generator_basis_elt_to_index(
&self,
gen_deg: i32,
gen_idx: usize,
basis_elt: usize,
) -> usize
pub fn generator_basis_elt_to_index( &self, gen_deg: i32, gen_idx: usize, basis_elt: usize, ) -> usize
Convert (generator, basis element) to basis element of the sum.
Sourcepub fn index_to_generator_basis_elt(&self, idx: usize) -> &GeneratorBasisEltPair
pub fn index_to_generator_basis_elt(&self, idx: usize) -> &GeneratorBasisEltPair
Find the (generator, basis element) pair corresponding to a given basis element of the block structure. For the FreeModule application, index => (free module generator, Steenrod algebra basis element)
Sourcepub fn add_block(
&self,
target: FpSliceMut<'_>,
coeff: u32,
gen_deg: i32,
gen_idx: usize,
source: FpSlice<'_>,
)
pub fn add_block( &self, target: FpSliceMut<'_>, coeff: u32, gen_deg: i32, gen_idx: usize, source: FpSlice<'_>, )
Add source vector “source” to the block indicated by (gen_deg, gen_idx).
pub fn total_dimension(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlockStructure
impl RefUnwindSafe for BlockStructure
impl Send for BlockStructure
impl Sync for BlockStructure
impl Unpin for BlockStructure
impl UnwindSafe for BlockStructure
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