9#include <boost/math/interpolators/barycentric_rational.hpp>
40 std::vector<std::function<
double(
double)>> post_processors,
char separator =
',',
41 bool has_header =
false,
uint x_column = 0,
uint order = 1);
72 void setup(
const std::vector<std::string> &input_files,
73 const std::vector<std::function<
double(
double)>> &post_processors,
char separator =
',',
74 bool has_header =
false,
uint x_column = 0,
uint order = 1);
107 std::vector<boost::math::interpolators::barycentric_rational<double>>
interpolators;
This class takes in a .csv file with x-dependent data and interpolates it to a given x on request.
Definition external_data_interpolator.hh:27
ExternalDataInterpolator(std::vector< std::string > input_files, char separator=',', bool has_header=false, uint x_column=0, uint order=1)
Construct a new External Data Interpolator object.
std::string input_file
Definition external_data_interpolator.hh:105
double value(double x, uint i) const
Interpolate the data to a given x.
void setup(const std::vector< std::string > &input_files, const std::vector< std::function< double(double)> > &post_processors, char separator=',', bool has_header=false, uint x_column=0, uint order=1)
Set up the interpolator.
double derivative(double x, uint i) const
Interpolate the derivative of the data to a given x.
bool check_consistency(double tolerance) const
Check whether the interpolator is consistent with the original data. The interpolator checks if it ca...
ExternalDataInterpolator()
Construct an empty External Data Interpolator object.
double max_x
Definition external_data_interpolator.hh:109
ExternalDataInterpolator(std::vector< std::string > input_files, std::vector< std::function< double(double)> > post_processors, char separator=',', bool has_header=false, uint x_column=0, uint order=1)
Construct a new External Data Interpolator object.
std::vector< boost::math::interpolators::barycentric_rational< double > > interpolators
Definition external_data_interpolator.hh:107
std::vector< std::vector< double > > file_data
Definition external_data_interpolator.hh:106
double min_x
Definition external_data_interpolator.hh:109
Definition complex_math.hh:14
unsigned int uint
Definition utils.hh:22