14 #ifndef MYGSL_TABULATED_FUNCTION_H 15 #define MYGSL_TABULATED_FUNCTION_H 1 87 std::vector<double> & values_)
const;
96 void scale(
double s_);
105 void lock_table(
const std::string & interp_name_ =
"");
111 void relock_table(
const std::string & interp_name_ =
"");
114 void add_point(
double x_,
double y_,
bool lock_after_ =
false);
117 double x_min()
const;
120 double x_max()
const;
123 void load_from_file(
const std::string & filename_, uint32_t options_ = 0);
126 virtual void tabfunc_load(std::istream & in_,
void * context_ = 0);
129 virtual void tabfunc_store(std::ostream & out_,
void * context_ = 0)
const;
133 const std::string & header_comment_ =
"",
134 const std::string & footer_comment_ =
"")
const;
148 virtual void tree_dump(std::ostream & out_ = std::clog,
149 const std::string & title_ =
"",
150 const std::string & indent_ =
"",
151 bool inherit_ =
false)
const;
156 virtual double _eval(
double x_)
const;
161 tabfunc_impl * pImpl =
nullptr;
175 #endif // MYGSL_TABULATED_FUNCTION_H #define DATATOOLS_CLONEABLE_DECLARATION(Copyable)
Definition: i_cloneable.h:113
static const std::string & akima_periodic_interp_name()
static bool interpolator_name_is_valid(const std::string &name_)
Check the validity of the name of the interpolation algorithm (GSL)
static const std::string & akima_interp_name()
void add_point(double x_, double y_, bool lock_after_=false)
Add a point to the collection.
static const std::string & steffen_interp_name()
bool is_verbose() const
Check verbosity flag.
virtual void tabfunc_load(std::istream &in_, void *context_=0)
Load from an input stream.
virtual ~tabulated_function()
Destructor.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart printing.
static const std::string & linear_interp_name()
double x_min() const
Return the minimum x value from the collection of points.
static const std::string & cspline_periodic_interp_name()
bool is_valid(double x_) const
Check validity.
virtual bool is_in_domain_of_definition(double x_) const
Check if a value is in the domain of definition of the function (default: true)
Tabulated function.
Definition: tabulated_function.h:34
virtual bool is_initialized() const
Check initialization status.
void set_verbose(bool v_=true)
Set verbosity flag.
void lock_table(const std::string &interp_name_="")
Lock the table using a given interpolation algorithm (GSL)
void load_from_file(const std::string &filename_, uint32_t options_=0)
Load the collection of points from a file.
bool is_table_locked() const
Check the table lock flag.
virtual bool has_explicit_domain_of_definition() const
Check if the function has an explicit domain of definition (default: false)
virtual void initialize(const datatools::properties &config_, const unary_function_dict_type &functors_)
Initialization from a container of parameters and a dictionary of functors.
tabulated_function & operator=(const tabulated_function &tab_func_)
Assignement.
static const std::string & cspline_interp_name()
static const std::string & default_interpolator_name()
Return the name of the default interpolation algorithm (GSL)
Abstract interface for unary functions : R -> R.
Definition: i_unary_function.h:44
virtual void tabfunc_store(std::ostream &out_, void *context_=0) const
Store to an output stream.
bool export_to_vectors(std::vector< double > &keys_, std::vector< double > &values_) const
Export to vectors of doubles.
virtual double _eval(double x_) const
Evaluation.
void unlock_table()
Unlock the table.
void relock_table(const std::string &interp_name_="")
Relock the table using a given interpolation algorithm (GSL)
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
void print_points(std::ostream &out_, const std::string &header_comment_="", const std::string &footer_comment_="") const
Print points.
tabulated_function(const std::string &interp_name_="")
Default constructor.
double x_max() const
Return the maximum x value from the collection of points.
std::map< std::string, unary_function_handle_type > unary_function_dict_type
Alias for dictionary of handles to unary function objects.
Definition: unary_function_utils.h:30
#define MYGSL_UNARY_FUNCTOR_REGISTRATION_INTERFACE(UnaryFunctorClass)
Definition: i_unary_function.h:206
size_t size() const
Return the size of the collection of points.
const points_map_type & points() const
Return the collection of points.
void scale(double s_)
Scale the function by a given factor.
std::map< double, double > points_map_type
Definition: tabulated_function.h:39
static const std::string & polynomial_interp_name()
void reset()
Reset the functor.
#define BOOST_SERIALIZATION_BASIC_DECLARATION()
Definition: serialization_macros.h:62
static const std::string & default_interp_name()
const std::string & interpolator_name() const
Return the name of the interpolation algorithm (GSL)