Skip to content

Commit

Permalink
libpressio version 0.6.4
Browse files Browse the repository at this point in the history
Bug Fixes:
- Previously the sz plugin had two keys for szMode, the duplicate key
  has been deleted.
- Previously the sz plugin had two keys for pw_relBoundRatio, the
  duplicate key has been deleted.
- Previously a pointer was passed where a value was required.  In both
  cases this has been corrected.
- Test cases were updated to use no longer use the removed "sz:mode" and
  instead use the "sz:error_bound_mode" instead.
  • Loading branch information
robertu94 committed Aug 9, 2019
1 parent 25bd0ce commit 121513f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(libpressio VERSION "0.6.3" LANGUAGES CXX C)
project(libpressio VERSION "0.6.4" LANGUAGES CXX C)

enable_testing()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/compressors/sz_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class sz_plugin: public libpressio_compressor_plugin {
struct pressio_options* options = pressio_options_new();
pressio_options_set_type(options, "sz:config_file", pressio_option_charptr_type);
pressio_options_set_type(options, "sz:config_struct", pressio_option_userptr_type);
pressio_options_set_integer(options, "sz:mode", confparams_cpr->szMode);
pressio_options_set_uinteger(options, "sz:max_quant_intervals", confparams_cpr->max_quant_intervals);
pressio_options_set_uinteger(options, "sz:quantization_intervals ", confparams_cpr->quantization_intervals);
pressio_options_set_uinteger(options, "sz:max_range_radius", confparams_cpr->maxRangeRadius);
Expand All @@ -39,7 +38,7 @@ class sz_plugin: public libpressio_compressor_plugin {
pressio_options_set_double(options, "sz:abs_err_bound", confparams_cpr->absErrBound);
pressio_options_set_double(options, "sz:rel_err_bound", confparams_cpr->relBoundRatio);
pressio_options_set_double(options, "sz:psnr_err_bound", confparams_cpr->psnr);
pressio_options_set_double(options, "sz:rel_err_bound", confparams_cpr->pw_relBoundRatio);
pressio_options_set_double(options, "sz:pw_rel_err_bound", confparams_cpr->pw_relBoundRatio);
pressio_options_set_integer(options, "sz:segment_size", confparams_cpr->segment_size);
pressio_options_set_integer(options, "sz:pwr_type", confparams_cpr->pwr_type);
pressio_options_set_integer(options, "sz:snapshot_cmpr_step", confparams_cpr->snapshotCmprStep);
Expand All @@ -63,7 +62,6 @@ class sz_plugin: public libpressio_compressor_plugin {
SZ_Init_Params(sz_param);
}

pressio_options_get_integer(options, "sz:mode", &confparams_cpr->szMode);
pressio_options_get_uinteger(options, "sz:max_quant_intervals", &confparams_cpr->max_quant_intervals);
pressio_options_get_uinteger(options, "sz:quantization_intervals ", &confparams_cpr->quantization_intervals);
pressio_options_get_uinteger(options, "sz:max_range_radius", &confparams_cpr->maxRangeRadius);
Expand Down
2 changes: 1 addition & 1 deletion src/pressio_option.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pressio_option pressio_option::as(const enum pressio_option_type to_type, const
double d = get_value<double>();
switch (to_type) {
case pressio_option_double_type:
return new pressio_option(d);
return pressio_option(d);
case pressio_option_float_type:
//narrowing
if (allow_explicit(safety)) return pressio_option(static_cast<float>(d));
Expand Down
4 changes: 2 additions & 2 deletions src/pressio_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ void pressio_options_set_type(struct pressio_options* options, const char* key,
}

enum pressio_options_key_status pressio_options_cast_set(struct pressio_options* options, const char* key, struct pressio_option* option, enum pressio_conversion_safety safety) {
return options->cast_set(key, option, safety);
return options->cast_set(key, *option, safety);
}

enum pressio_options_key_status pressio_options_as_set(struct pressio_options* options, const char* key, struct pressio_option* option) {
return options->cast_set(key, option);
return options->cast_set(key, *option);
}


Expand Down
2 changes: 1 addition & 1 deletion test/metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int main(int argc, char *argv[])
struct pressio_compressor* compressor = pressio_get_compressor(library, "sz");
struct pressio_options* sz_options = pressio_compressor_get_options(compressor);

pressio_options_set_integer(sz_options, "sz:mode", ABS);
pressio_options_set_integer(sz_options, "sz:error_bound_mode", ABS);
pressio_options_set_double(sz_options, "sz:abs_err_bound", 0.5);
if(pressio_compressor_check_options(compressor, sz_options)) {
printf("%s\n", pressio_compressor_error_msg(compressor));
Expand Down
2 changes: 1 addition & 1 deletion test/sz_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main(int argc, char *argv[])
struct pressio_compressor* compressor = pressio_get_compressor(library, "sz");
struct pressio_options* sz_options = pressio_compressor_get_options(compressor);

pressio_options_set_integer(sz_options, "sz:mode", ABS);
pressio_options_set_integer(sz_options, "sz:error_bound_mode", ABS);
pressio_options_set_double(sz_options, "sz:abs_err_bound", 0.5);
if(pressio_compressor_check_options(compressor, sz_options)) {
printf("%s\n", pressio_compressor_error_msg(compressor));
Expand Down

0 comments on commit 121513f

Please sign in to comment.