Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressed bounds #30

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Compressed bounds #30

wants to merge 11 commits into from

Conversation

ThomasMG
Copy link
Contributor

Compress bound_t struct to 32 bits.
Optimize some methods with fewer dimension calls and diagonal extrapolation to go through fewer bounds when closing. Also remove a full dbm copy from diagonal extrapolation.

@ThomasMG ThomasMG requested a review from petergjoel September 14, 2023 08:11
std::vector<std::pair<dim_t, dim_t>> modified_bounds;
modified_bounds.reserve(dim * (dim - 1));

std::vector<bool> close_zero(dim, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a small benchmark to be had here if it is better to keep track of the dimensions that need the zero-close or have a bit-vector like this.
With the current construction you have to iterate over dim afterwords to check if it needs closing.

In the alternative construction you have
std::vector<uint32_t> close_zero; and close_zero.push(j) on line 407 instead.

Similar can be done for "skip" -- but here you want to keep the inverse.

Copy link
Member

@petergjoel petergjoel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants