Skip to content

Commit

Permalink
Adapter for new BVComp::new argument order
Browse files Browse the repository at this point in the history
  • Loading branch information
vigna committed Feb 29, 2024
1 parent 161ce3e commit 01f29a0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions benches/benchmarks/model4encoder_building.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn model4encoder_building_bench(c: &mut Criterion) {

let log2_mock = Log2Estimator::default();
let model_builder = BVGraphModelBuilder::<Log2Estimator>::new(log2_mock);
let mut bvcomp = BVComp::<BVGraphModelBuilder<Log2Estimator>>::new(model_builder, 7, 2, 3, 0);
let mut bvcomp = BVComp::<BVGraphModelBuilder<Log2Estimator>>::new(model_builder, 7, 3, 2, 0);

// First iteration with Log2MockWriter
bvcomp.extend(graph.iter()).unwrap();
Expand All @@ -32,7 +32,7 @@ fn model4encoder_building_bench(c: &mut Criterion) {
|| {
let model_builder =
BVGraphModelBuilder::<EntropyEstimator>::new(entropic_mock.clone());
BVComp::<BVGraphModelBuilder<EntropyEstimator>>::new(model_builder, 7, 2, 3, 0)
BVComp::<BVGraphModelBuilder<EntropyEstimator>>::new(model_builder, 7, 3, 2, 0)
},
|mut bvcomp|
// second iteration with EntropyMockWriter
Expand Down
6 changes: 3 additions & 3 deletions src/bin/bvcomp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ pub fn main() -> Result<()> {
let mut bvcomp = BVComp::<BVGraphModelBuilder<Log2Estimator>>::new(
model_builder,
args.compressions_args.compression_window,
args.compressions_args.min_interval_length,
args.compressions_args.max_ref_count,
args.compressions_args.min_interval_length,
0,
);

Expand All @@ -88,8 +88,8 @@ pub fn main() -> Result<()> {
let mut bvcomp = BVComp::<BVGraphModelBuilder<EntropyEstimator>>::new(
model_builder,
args.compressions_args.compression_window,
args.compressions_args.min_interval_length,
args.compressions_args.max_ref_count,
args.compressions_args.min_interval_length,
0,
);

Expand All @@ -111,8 +111,8 @@ pub fn main() -> Result<()> {
let mut bvcomp = BVComp::<ANSBVGraphMeasurableEncoder>::new(
ANSBVGraphMeasurableEncoder::new(model4encoder, entropy_estimator),
args.compressions_args.compression_window,
args.compressions_args.min_interval_length,
args.compressions_args.max_ref_count,
args.compressions_args.min_interval_length,
0,
);

Expand Down
18 changes: 9 additions & 9 deletions tests/test_bvgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn decoder_decodes_correctly_dummy_graph() -> Result<()> {

let log_mock = Log2Estimator::default();
let model_builder = BVGraphModelBuilder::new(log_mock);
let mut bvcomp = BVComp::<BVGraphModelBuilder<Log2Estimator>>::new(model_builder, 7, 2, 3, 0);
let mut bvcomp = BVComp::<BVGraphModelBuilder<Log2Estimator>>::new(model_builder, 7, 3, 2, 0);

// first iteration -> build the model with log2 mock writer
for node_index in 0..graph.num_nodes() {
Expand All @@ -40,7 +40,7 @@ fn decoder_decodes_correctly_dummy_graph() -> Result<()> {
let entropic_costs_table = EntropyEstimator::new(&model4encoder, folding_params);
let model_builder = BVGraphModelBuilder::<EntropyEstimator>::new(entropic_costs_table.clone());
let mut bvcomp =
BVComp::<BVGraphModelBuilder<EntropyEstimator>>::new(model_builder, 7, 2, 3, 0);
BVComp::<BVGraphModelBuilder<EntropyEstimator>>::new(model_builder, 7, 3, 2, 0);

// second iteration -> build the model with entropic mock writer
for node_index in 0..graph.num_nodes() {
Expand All @@ -55,8 +55,8 @@ fn decoder_decodes_correctly_dummy_graph() -> Result<()> {
let mut bvcomp = BVComp::<ANSBVGraphMeasurableEncoder>::new(
ANSBVGraphMeasurableEncoder::new(model4encoder, entropic_costs_table),
7,
2,
3,
2,
0,
);

Expand Down Expand Up @@ -108,7 +108,7 @@ fn decoder_decodes_correctly_cnr_graph() -> Result<()> {

let log2_mock = Log2Estimator::default();
let model_builder = BVGraphModelBuilder::<Log2Estimator>::new(log2_mock);
let mut bvcomp = BVComp::<BVGraphModelBuilder<Log2Estimator>>::new(model_builder, 7, 2, 3, 0);
let mut bvcomp = BVComp::<BVGraphModelBuilder<Log2Estimator>>::new(model_builder, 7, 3, 2, 0);

// First iteration with Log2MockWriter
bvcomp.extend(graph.iter())?;
Expand All @@ -118,7 +118,7 @@ fn decoder_decodes_correctly_cnr_graph() -> Result<()> {
let entropic_mock = EntropyEstimator::new(&model4encoder, folding_params);
let model_builder = BVGraphModelBuilder::<EntropyEstimator>::new(entropic_mock.clone());
let mut bvcomp =
BVComp::<BVGraphModelBuilder<EntropyEstimator>>::new(model_builder, 7, 2, 3, 0);
BVComp::<BVGraphModelBuilder<EntropyEstimator>>::new(model_builder, 7, 3, 2, 0);

// second iteration with EntropyMockWriter
bvcomp.extend(graph.iter())?;
Expand All @@ -128,8 +128,8 @@ fn decoder_decodes_correctly_cnr_graph() -> Result<()> {
let mut bvcomp = BVComp::<ANSBVGraphMeasurableEncoder>::new(
ANSBVGraphMeasurableEncoder::new(model4encoder, entropic_mock),
7,
2,
3,
2,
0,
);

Expand Down Expand Up @@ -170,7 +170,7 @@ fn decoder_decodes_correctly_sequential_cnr_graph() -> Result<()> {

let log2_mock = Log2Estimator::default();
let model_builder = BVGraphModelBuilder::<Log2Estimator>::new(log2_mock);
let mut bvcomp = BVComp::<BVGraphModelBuilder<Log2Estimator>>::new(model_builder, 7, 2, 3, 0);
let mut bvcomp = BVComp::<BVGraphModelBuilder<Log2Estimator>>::new(model_builder, 7, 3, 2, 0);

// First iteration with Log2MockWriter
bvcomp.extend(graph.iter())?;
Expand All @@ -180,7 +180,7 @@ fn decoder_decodes_correctly_sequential_cnr_graph() -> Result<()> {
let entropic_mock = EntropyEstimator::new(&model4encoder, folding_params);
let model_builder = BVGraphModelBuilder::<EntropyEstimator>::new(entropic_mock.clone());
let mut bvcomp =
BVComp::<BVGraphModelBuilder<EntropyEstimator>>::new(model_builder, 7, 2, 3, 0);
BVComp::<BVGraphModelBuilder<EntropyEstimator>>::new(model_builder, 7, 3, 2, 0);

// second iteration with EntropyMockWriter
bvcomp.extend(graph.iter())?;
Expand All @@ -190,8 +190,8 @@ fn decoder_decodes_correctly_sequential_cnr_graph() -> Result<()> {
let mut bvcomp = BVComp::<ANSBVGraphMeasurableEncoder>::new(
ANSBVGraphMeasurableEncoder::new(model4encoder, entropic_mock),
7,
2,
3,
2,
0,
);

Expand Down

0 comments on commit 01f29a0

Please # to comment.