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

Group RGI interface and implementation functions separately. #33

Merged
merged 3 commits into from
Aug 10, 2023
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
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