Bayeux  3.4.1
Core Foundation library for SuperNEMO
logistic_function.h
Go to the documentation of this file.
1 #ifndef MYGSL_LOGISTIC_FUNCTION_H
2 #define MYGSL_LOGISTIC_FUNCTION_H
3 
4 // Third party:
5 // - Bayeux/datatools :
7 
8 // This project:
10 
11 namespace mygsl {
12 
15  : public i_unary_function,
17  {
18  public:
19 
22 
24  logistic_function(double steepness_, double midpoint_, double amplitude_);
25 
27  virtual ~logistic_function();
28 
30  void set_steepness(double steepness_);
31 
33  double get_steepness() const;
34 
36  void set_midpoint(double midpoint_);
37 
39  double get_midpoint() const;
40 
42  void set_amplitude(double amplitude_);
43 
45  double get_amplitude() const;
46 
48  virtual bool is_initialized() const;
49 
51  virtual void initialize(const datatools::properties & config_,
52  const unary_function_dict_type & functors_);
53 
55  virtual void reset();
56 
58  virtual void tree_dump(std::ostream & out_ = std::clog,
59  const std::string & title_ = "",
60  const std::string & indent_ = "",
61  bool inherit_ = false) const;
62 
63  protected:
64 
66  double _eval(double x_) const;
67 
69  void _set_defaults();
70 
71  private:
72 
73  double _steepness_;
74  double _midpoint_;
75  double _amplitude_;
76 
79 
80 
82 
83  };
84 
85 } // namespace mygsl
86 
87 #endif // MYGSL_LOGISTIC_FUNCTION_H
88 
89 // Local Variables: --
90 // mode: c++ --
91 // c-file-style: "gnu" --
92 // tab-width: 2 --
93 // End: --
#define DATATOOLS_CLONEABLE_DECLARATION(Copyable)
Definition: i_cloneable.h:113
virtual bool is_initialized() const
Check initialization status.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart printing.
void set_midpoint(double midpoint_)
Set the midpoint.
virtual ~logistic_function()
Destructor.
void set_amplitude(double amplitude_)
Set the amplitude.
Logistic function.
Definition: logistic_function.h:14
double get_amplitude() const
Return the amplitude.
virtual void reset()
Reset the function.
virtual void initialize(const datatools::properties &config_, const unary_function_dict_type &functors_)
Initialization from a container of parameters and a dictionary of functors.
Abstract interface for unary functions : R -> R.
Definition: i_unary_function.h:44
void set_steepness(double steepness_)
Set the steepness.
double _eval(double x_) const
Evaluation.
void _set_defaults()
Set default attributes values.
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
double get_midpoint() const
Return the midpoint.
A pure abstract class (interface) for inherited cloneable classes.
Definition: i_cloneable.h:75
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
double get_steepness() const
Return the steepness.
logistic_function()
Default constructor.
A dictionary of arbitrary properties.
Definition: properties.h:125