Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
Abstract interface for unary functions : R -> R. More...
#include <bayeux/mygsl/i_unary_function.h>
Public Types | |
enum | write_options_type { wo_none = 0, wo_data_index = 0x1, wo_skip_nan = 0x2, wo_skip_inf = 0x4, wo_skip_onzd = 0x8, wo_skip_odod = 0x10, wo_append = 0x20, wo_default = wo_none } |
Options for writing sampled function in an ASCII stream. More... | |
Public Types inherited from datatools::i_tree_dumpable | |
enum | ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 } |
Enumeration for standard output streams. More... | |
Public Member Functions | |
i_unary_function (double epsilon_=0.0) | |
Constructor. More... | |
virtual | ~i_unary_function () |
Destructor. More... | |
virtual bool | has_explicit_domain_of_definition () const |
Check if the function has an explicit domain of definition (default: false) More... | |
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) More... | |
virtual double | eval (double x_) const |
The function evaluation method. More... | |
double | evaluate (double x_) const |
The function evaluation method. More... | |
virtual double | eval_no_check (double x_) const |
The function evaluation method with any value check. More... | |
virtual double | get_non_zero_domain_min () const |
The minimum bound of the non-zero domain (default is minus infinity) More... | |
bool | has_non_zero_domain_min () const |
Check the minimum bound of the non-zero domain. More... | |
virtual double | get_non_zero_domain_max () const |
The maximum bound of the non-zero domain (default is plus infinity) More... | |
bool | has_non_zero_domain_max () const |
Check the maximum bound of the non-zero domain. More... | |
bool | is_in_non_zero_domain (double x_) const |
Check if a value is in the non-zero domain. More... | |
bool | is_in_zero_domain (double x_) const |
Check if a value is in the zero domain. More... | |
bool | has_zero_domain () const |
Check if the functor has an explicit zero domain. More... | |
double | operator() (double x_) const |
Standard C++ functor interface. More... | |
void | write_ascii (std::ostream &fout_, double min_, double max_, unsigned int nsamples_, int x_precision_=16, int fx_precision_=16, uint32_t options_=wo_default) const |
Write the (x,y=f(x)) value pairs in an ASCII stream : More... | |
void | write_ascii_with_units (std::ostream &fout_, double min_, double max_, unsigned int nsamples_, double x_unit_, double fx_unit_, int x_precision_=16, int fx_precision_=16, uint32_t options_=wo_default) const |
Write the (x,y=f(x)) value pairs in an ASCII stream : More... | |
void | write_ascii_file (const std::string &filename_, double min_, double max_, unsigned int nsamples_, int x_precision_=16, int fx_precision_=16, uint32_t options_=wo_default) const |
Write the (x,y=f(x)) value pairs in an ASCII file (typical Gnuplot input) : More... | |
void | write_ascii_file_with_units (const std::string &filename_, double min_, double max_, unsigned int nsamples_, const std::string &x_unit_label_, const std::string &fx_unit_label_, int x_precision_=16, int fx_precision_=16, uint32_t options_=wo_default) const |
Write the (x,y=f(x)) value pairs in an ASCII file (typical Gnuplot input) : More... | |
void | set_epsilon (double) |
Set the precision. More... | |
double | get_epsilon () const |
Return the precision. More... | |
void | initialize_simple () |
Simple initialization. More... | |
void | initialize_standalone (const datatools::properties &config_) |
Initialization from a container of parameters. More... | |
virtual void | initialize (const datatools::properties &config_, const unary_function_dict_type &functors_) |
virtual void | reset () |
Reset the functor. More... | |
virtual bool | is_initialized () const |
Check initialization status. More... | |
virtual void | tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const |
Smart printing. More... | |
Public Member Functions inherited from datatools::i_tree_dumpable | |
i_tree_dumpable () | |
Constructor. More... | |
virtual | ~i_tree_dumpable () |
Destructor. More... | |
virtual void | print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const |
Main new interface method for printing. More... | |
void | print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const |
Printing with jsonized options. More... | |
void | print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const |
Printing with jsonized options. More... | |
void | tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const |
void | tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const |
void | smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const |
Static Public Member Functions | |
static double | g_function (double x_, void *functor_) |
A generic static function to feed the GSL gsl_function interface: More... | |
Static Public Member Functions inherited from datatools::i_tree_dumpable | |
static const boost::property_tree::ptree & | empty_options () |
static boost::property_tree::ptree | make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false) |
static std::ostream & | last_skip_tag (std::ostream &out_) |
static std::ostream & | skip_tag (std::ostream &out_) |
static std::ostream & | last_tag (std::ostream &out_) |
static std::ostream & | tag (std::ostream &out_) |
Static Public Attributes | |
static const double | DEFAULT_EPSILON |
Default error. More... | |
static const double | AUTO_EPSILON |
Value for automatic computation of the error. More... | |
Protected Member Functions | |
virtual double | _eval (double x_) const =0 |
The function evaluation abstract method. More... | |
void | _base_initialize (const datatools::properties &config_, const unary_function_dict_type &functors_) |
void | _base_reset () |
void | _compute_auto_epsilon () |
void | _set_defaults () |
Set defaults attributes. More... | |
Abstract interface for unary functions : R -> R.
Options for writing sampled function in an ASCII stream.
Enumerator | |
---|---|
wo_none | |
wo_data_index | Store as a data index for Gnuplot (2 blank lines at the end) |
wo_skip_nan | Do not print (x,y=f(x)) pairs if y is a NaN. |
wo_skip_inf | Do not print (x,y=f(x)) pairs if y is a +/-infinity. |
wo_skip_onzd | Do not print (x,y=f(x)) pairs if x lies out of the non-zero domain. |
wo_skip_odod | Do not print (x,y=f(x)) pairs if x lies out of domain of definition. |
wo_append | Append to an existing file. |
wo_default |
mygsl::i_unary_function::i_unary_function | ( | double | epsilon_ = 0.0 | ) |
Constructor.
|
virtual |
Destructor.
|
protected |
|
protected |
|
protected |
|
protectedpure virtual |
The function evaluation abstract method.
Implemented in mctools::signal::triangle_gate_signal_shape, mctools::signal::triangle_signal_shape, mygsl::tabulated_function, materials::refractive_index, mygsl::polynomial, mygsl::convolution_function, mygsl::convolution_function::convolution_term, mygsl::triangle_function, mctools::signal::multi_signal_shape, mygsl::gate_function, mygsl::linear_regression::function, mygsl::unary_eval_from_multi, mygsl::i_unary_function_with_parameters, mygsl::gaussian_function, mygsl::composite_function, mygsl::linear_combination_function, mygsl::product_function, mygsl::function_with_domain, mygsl::unary_function_promoted_with_numeric_derivative, mygsl::rectangular_function, mygsl::plain_function_wrapper, mygsl::gompertz_function, mygsl::multidimensional_minimization_system::func_eval_f_param, mygsl::logistic_function, mygsl::heaviside_function, mygsl::nw_sampled_function_smoother, mygsl::identity_function, and mygsl::zero_function.
|
protected |
Set defaults attributes.
|
virtual |
The function evaluation method.
|
virtual |
The function evaluation method with any value check.
double mygsl::i_unary_function::evaluate | ( | double | x_ | ) | const |
The function evaluation method.
|
static |
A generic static function to feed the GSL gsl_function interface:
double mygsl::i_unary_function::get_epsilon | ( | ) | const |
Return the precision.
|
virtual |
The maximum bound of the non-zero domain (default is plus infinity)
Reimplemented in mctools::signal::triangle_gate_signal_shape, mctools::signal::triangle_signal_shape, mygsl::convolution_function::convolution_term, mygsl::triangle_function, mctools::signal::multi_signal_shape, mygsl::gate_function, mygsl::composite_function, mygsl::linear_combination_function, mygsl::product_function, mygsl::unary_function_promoted_with_numeric_derivative, and mygsl::rectangular_function.
|
virtual |
The minimum bound of the non-zero domain (default is minus infinity)
Reimplemented in mctools::signal::triangle_gate_signal_shape, mctools::signal::triangle_signal_shape, mygsl::convolution_function::convolution_term, mygsl::triangle_function, mctools::signal::multi_signal_shape, mygsl::gate_function, mygsl::composite_function, mygsl::linear_combination_function, mygsl::product_function, mygsl::unary_function_promoted_with_numeric_derivative, mygsl::rectangular_function, and mygsl::heaviside_function.
|
virtual |
Check if the function has an explicit domain of definition (default: false)
Reimplemented in materials::refractive_index, mctools::signal::multi_signal_shape, mygsl::composite_function, mygsl::product_function, mygsl::linear_combination_function, mygsl::unary_function_promoted_with_numeric_derivative, mygsl::function_with_domain, and mygsl::tabulated_function.
bool mygsl::i_unary_function::has_non_zero_domain_max | ( | ) | const |
Check the maximum bound of the non-zero domain.
bool mygsl::i_unary_function::has_non_zero_domain_min | ( | ) | const |
Check the minimum bound of the non-zero domain.
bool mygsl::i_unary_function::has_zero_domain | ( | ) | const |
Check if the functor has an explicit zero domain.
|
virtual |
Initialization from a container of parameters and a dictionary of functors
ISSUE: FM 2016-11-30: the functors_ dictionnary implicitely gives write access to each functors in the list. This is basicaly a problem.
Reimplemented in mygsl::tabulated_function, materials::refractive_index, mctools::signal::triangle_signal_shape, mctools::signal::triangle_gate_signal_shape, mygsl::triangle_function, mygsl::function_with_domain, mygsl::polynomial, mygsl::gate_function, mctools::signal::multi_signal_shape, mygsl::convolution_function, mygsl::plain_function_wrapper, mygsl::gaussian_function, mygsl::composite_function, mygsl::i_unary_function_with_parameters, mygsl::linear_combination_function, mygsl::rectangular_function, mygsl::product_function, mygsl::gompertz_function, mygsl::logistic_function, and mygsl::heaviside_function.
void mygsl::i_unary_function::initialize_simple | ( | ) |
Simple initialization.
void mygsl::i_unary_function::initialize_standalone | ( | const datatools::properties & | config_ | ) |
Initialization from a container of parameters.
|
virtual |
Check if a value is in the domain of definition of the function (default: true)
Reimplemented in materials::refractive_index, mctools::signal::multi_signal_shape, mygsl::composite_function, mygsl::linear_combination_function, mygsl::product_function, mygsl::function_with_domain, mygsl::unary_function_promoted_with_numeric_derivative, and mygsl::tabulated_function.
bool mygsl::i_unary_function::is_in_non_zero_domain | ( | double | x_ | ) | const |
Check if a value is in the non-zero domain.
bool mygsl::i_unary_function::is_in_zero_domain | ( | double | x_ | ) | const |
Check if a value is in the zero domain.
|
virtual |
Check initialization status.
Reimplemented in mygsl::tabulated_function, materials::refractive_index, mctools::signal::triangle_signal_shape, mctools::signal::triangle_gate_signal_shape, mygsl::unary_function_promoted_with_numeric_derivative, mygsl::triangle_function, mygsl::function_with_domain, mygsl::polynomial, mygsl::gate_function, mctools::signal::multi_signal_shape, mygsl::convolution_function, mygsl::plain_function_wrapper, mygsl::gaussian_function, mygsl::composite_function, mygsl::i_unary_function_with_parameters, mygsl::linear_combination_function, mygsl::rectangular_function, mygsl::product_function, mygsl::gompertz_function, mygsl::logistic_function, and mygsl::heaviside_function.
double mygsl::i_unary_function::operator() | ( | double | x_ | ) | const |
Standard C++ functor interface.
|
virtual |
Reset the functor.
Reimplemented in mygsl::tabulated_function, materials::refractive_index, mctools::signal::triangle_signal_shape, mctools::signal::triangle_gate_signal_shape, mygsl::triangle_function, mygsl::function_with_domain, mygsl::unary_function_promoted_with_numeric_derivative, mygsl::polynomial, mygsl::gate_function, mctools::signal::multi_signal_shape, mygsl::convolution_function, mygsl::plain_function_wrapper, mygsl::gaussian_function, mygsl::composite_function, mygsl::i_unary_function_with_parameters, mygsl::linear_combination_function, mygsl::rectangular_function, mygsl::product_function, mygsl::gompertz_function, mygsl::logistic_function, and mygsl::heaviside_function.
void mygsl::i_unary_function::set_epsilon | ( | double | ) |
Set the precision.
|
virtual |
Smart printing.
Reimplemented from datatools::i_tree_dumpable.
Reimplemented in mctools::signal::triangle_gate_signal_shape, mctools::signal::triangle_signal_shape, mygsl::tabulated_function, mygsl::polynomial, mygsl::triangle_function, mctools::signal::multi_signal_shape, mygsl::gate_function, mygsl::convolution_function, mygsl::i_unary_function_with_parameters, mygsl::gaussian_function, mygsl::composite_function, mygsl::linear_combination_function, mygsl::product_function, mygsl::rectangular_function, mygsl::gompertz_function, mygsl::logistic_function, and mygsl::heaviside_function.
void mygsl::i_unary_function::write_ascii | ( | std::ostream & | fout_, |
double | min_, | ||
double | max_, | ||
unsigned int | nsamples_, | ||
int | x_precision_ = 16 , |
||
int | fx_precision_ = 16 , |
||
uint32_t | options_ = wo_default |
||
) | const |
Write the (x,y=f(x)) value pairs in an ASCII stream :
void mygsl::i_unary_function::write_ascii_file | ( | const std::string & | filename_, |
double | min_, | ||
double | max_, | ||
unsigned int | nsamples_, | ||
int | x_precision_ = 16 , |
||
int | fx_precision_ = 16 , |
||
uint32_t | options_ = wo_default |
||
) | const |
Write the (x,y=f(x)) value pairs in an ASCII file (typical Gnuplot input) :
void mygsl::i_unary_function::write_ascii_file_with_units | ( | const std::string & | filename_, |
double | min_, | ||
double | max_, | ||
unsigned int | nsamples_, | ||
const std::string & | x_unit_label_, | ||
const std::string & | fx_unit_label_, | ||
int | x_precision_ = 16 , |
||
int | fx_precision_ = 16 , |
||
uint32_t | options_ = wo_default |
||
) | const |
Write the (x,y=f(x)) value pairs in an ASCII file (typical Gnuplot input) :
void mygsl::i_unary_function::write_ascii_with_units | ( | std::ostream & | fout_, |
double | min_, | ||
double | max_, | ||
unsigned int | nsamples_, | ||
double | x_unit_, | ||
double | fx_unit_, | ||
int | x_precision_ = 16 , |
||
int | fx_precision_ = 16 , |
||
uint32_t | options_ = wo_default |
||
) | const |
Write the (x,y=f(x)) value pairs in an ASCII stream :
|
static |
Value for automatic computation of the error.
|
static |
Default error.