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

Add collection builder that deduplicates on insertion #955

Merged
merged 8 commits into from
Sep 26, 2023

Conversation

sethrj
Copy link
Member

@sethrj sethrj commented Sep 23, 2023

This is intended for use primarily with ORANGE to essentially "compress" parameter data while it's being assembled. It hashes every call to insert_back and returns a previously inserted range if available. There are a few subtleties:

  1. The data cannot be modified after it's inserted. The CDF renormalization in physics violates this.
  2. Each element must be "uniquely representable", i.e. it can't have padding nor contain floats. Specializations of std::hash must be created for each one.

@sethrj sethrj added enhancement New feature or request core Software engineering infrastructure labels Sep 23, 2023
@sethrj sethrj requested a review from amandalund September 23, 2023 21:47
Copy link
Contributor

@amandalund amandalund left a comment

Choose a reason for hiding this comment

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

Looks good @sethrj!

src/corecel/data/CollectionBuilder.hh Outdated Show resolved Hide resolved
@sethrj sethrj merged commit 7f97174 into celeritas-project:develop Sep 26, 2023
@sethrj sethrj deleted the deduplicate-collection branch September 26, 2023 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Software engineering infrastructure enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants