Skip to content

Use BTreeMap backing for structs in sseq #187

@JoeyBF

Description

@JoeyBF

I feel that replacing the current

pub struct DenseBigradedModule {
    dimensions: OnceBiVec<OnceBiVec<usize>>,
    min_y: i32,
}

with something like

pub struct DenseBigradedModule {
    dimensions: BTreeMap<OrderedBidegree<ByStem>, usize>,
}

would make sense. If we go ahead and refactor the sseq API to use Bidegrees throughout, it would make accessing data easier. I suppose we also reduce allocations and have one less indirection.

Similarly, I suggest we replace

pub struct Sseq<P: SseqProfile = Adams> {
    differentials: BiVec<BiVec<BiVec<Differential>>>,
    permanent_classes: BiVec<BiVec<Subspace>>,
    page_data: BiVec<BiVec<BiVec<Subquotient>>>,
    invalid: BiVec<BiVec<bool>>,
    // ...
}

with

pub struct Sseq<P: SseqProfile = Adams> {
    differentials: BTreeMap<OrderedBidegree<ByStem>, BiVec<Differential>>,
    permanent_classes: BTreeMap<OrderedBidegree<ByStem>, Subspace>,
    page_data: BTreeMap<OrderedBidegree<ByStem>, BiVec<Subquotient>>,
    invalid:  BTreeMap<OrderedBidegree<ByStem>, bool>,
    // ...
}

In fact, now that I write this all out, it might be even more convenient to use some helper struct

pub struct Bigraded<T>(BTreeMap<OrderedBidegree<ByStem>, T>)

everywhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions