Skip to content

Commit

Permalink
Merge pull request #33 from bigladder/group-implementations-by-class
Browse files Browse the repository at this point in the history
Group RGI interface and implementation functions separately.
  • Loading branch information
nealkruis authored Aug 10, 2023
2 parents b4d0e17 + f4fa9f4 commit 5363cdd
Show file tree
Hide file tree
Showing 4 changed files with 579 additions and 564 deletions.
59 changes: 30 additions & 29 deletions include/btwxt/regular-grid-interpolator.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ class RegularGridInterpolator {
const std::vector<std::vector<double>>& grid_point_data_vectors,
const std::shared_ptr<Courierr::Courierr>& logger = std::make_shared<BtwxtLogger>());

RegularGridInterpolator(const RegularGridInterpolator& source);

RegularGridInterpolator(const RegularGridInterpolator& source,
const std::shared_ptr<Courierr::Courierr>& logger);

RegularGridInterpolator(
const std::vector<std::vector<double>>& grid_axis_vectors,
const std::vector<GridPointDataSet>& grid_point_data_sets,
Expand All @@ -67,14 +62,43 @@ class RegularGridInterpolator {

~RegularGridInterpolator();

RegularGridInterpolator(const RegularGridInterpolator& source);

RegularGridInterpolator(const RegularGridInterpolator& source,
const std::shared_ptr<Courierr::Courierr>& logger);

RegularGridInterpolator& operator=(const RegularGridInterpolator& source);

std::size_t add_grid_point_data_set(const std::vector<double>& grid_point_data_vector,
const std::string& name = "");

std::size_t add_grid_point_data_set(const GridPointDataSet& grid_point_data_set);

// Get results
void set_axis_extrapolation_method(std::size_t axis_index, Method method);

void set_axis_interpolation_method(std::size_t axis_index, Method method);

void set_axis_extrapolation_limits(std::size_t axis_index,
const std::pair<double, double>& extrapolation_limits);

std::size_t get_number_of_dimensions();

// Public normalization methods
double normalize_grid_point_data_set_at_target(std::size_t data_set_index,
const double scalar = 1.0);

double normalize_grid_point_data_set_at_target(std::size_t data_set_index,
const std::vector<double>& target,
const double scalar = 1.0);

void normalize_grid_point_data_sets_at_target(double scalar = 1.0);

void normalize_grid_point_data_sets_at_target(const std::vector<double>& target,
const double scalar = 1.0);

std::string write_data();

// Get results
void set_target(const std::vector<double>& target);

double get_value_at_target(const std::vector<double>& target, std::size_t data_set_index);
Expand Down Expand Up @@ -102,35 +126,12 @@ class RegularGridInterpolator {

std::vector<double> operator()() { return get_values_at_target(); }

void normalize_grid_point_data_sets_at_target(double scalar = 1.0);

void normalize_grid_point_data_sets_at_target(const std::vector<double>& target,
const double scalar = 1.0);

double normalize_grid_point_data_set_at_target(std::size_t data_set_index,
const double scalar = 1.0);

double normalize_grid_point_data_set_at_target(std::size_t data_set_index,
const std::vector<double>& target,
const double scalar = 1.0);

const std::vector<double>& get_target();

[[nodiscard]] const std::vector<TargetBoundsStatus>& get_target_bounds_status() const;

void clear_target();

void set_axis_interpolation_method(std::size_t axis_index, Method method);

void set_axis_extrapolation_method(std::size_t axis_index, Method method);

void set_axis_extrapolation_limits(std::size_t axis_index,
const std::pair<double, double>& extrapolation_limits);

std::size_t get_number_of_dimensions();

std::string write_data();

void set_logger(const std::shared_ptr<Courierr::Courierr>& logger,
bool set_grid_axes_loggers = false);

Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set(library_sources
regular-grid-interpolator-implementation.h
regular-grid-interpolator-implementation.cpp
regular-grid-interpolator.cpp
grid-axis.cpp
)
Expand Down
Loading

0 comments on commit 5363cdd

Please sign in to comment.