BlockStructure

Struct BlockStructure 

Source
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

Source

pub fn new(block_sizes: &BiVec<Vec<usize>>) -> Self

Source

pub fn generator_to_block(&self, gen_deg: i32, gen_idx: usize) -> Range<usize>

Find the block corresponding to a given generator.

Source

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.

Source

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)

Source

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).

Source

pub fn total_dimension(&self) -> usize

Trait Implementations§

Source§

impl Debug for BlockStructure

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V