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

Check config.minimal_output matches PHF template parameter #59

Merged
merged 1 commit into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/partitioned_phf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ struct partitioned_phf {
template <typename Builder>
double build(Builder& builder, build_configuration const& config) {
auto start = clock_type::now();
if (Minimal && !config.minimal_output) {
throw std::runtime_error(
"Cannot build partitioned_phf<..., ..., true> with minimal_output=false"
);
} else if (!Minimal && config.minimal_output) {
throw std::runtime_error(
"Cannot build partitioned_phf<..., ..., false> with minimal_output=true"
);
}
uint64_t num_partitions = builder.num_partitions();

m_seed = builder.seed();
Expand Down
11 changes: 10 additions & 1 deletion include/single_phf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,17 @@ struct single_phf {
}

template <typename Builder>
double build(Builder const& builder, build_configuration const&) {
double build(Builder const& builder, build_configuration const& config) {
auto start = clock_type::now();
if (Minimal && !config.minimal_output) {
throw std::runtime_error(
"Cannot build single_phf<..., ..., true> with minimal_output=false"
);
} else if (!Minimal && config.minimal_output) {
throw std::runtime_error(
"Cannot build single_phf<..., ..., false> with minimal_output=true"
);
}
m_seed = builder.seed();
m_num_keys = builder.num_keys();
m_table_size = builder.table_size();
Expand Down
Loading