Bayeux  3.4.1
Core Foundation library for SuperNEMO
i_unary_function_with_derivative.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2007-12-07
4  * Last modified: 2013-04-23
5  *
6  * License:
7  *
8  *
9  * Description:
10  *
11  * Abstract interface for R to R functor with
12  * support interface for associated derivativ function.
13  *
14  * History:
15  *
16  */
17 
18 #ifndef MYGSL_I_UNARY_FUNCTION_WITH_DERIVATIVE_H
19 #define MYGSL_I_UNARY_FUNCTION_WITH_DERIVATIVE_H 1
20 
21 // This project:
22 #include <mygsl/i_unary_function.h>
23 #include <mygsl/interval.h>
24 
25 namespace mygsl {
26 
29  {
30 
31  public:
32 
34  i_unary_function_with_derivative(double epsilon_ = 0.0);
35 
38 
39  virtual double eval_f(double x_) const;
40 
41  virtual double eval_df(double x_) const;
42 
43  virtual void eval_fdf(double x_, double & f_, double & df_) const;
44 
45  protected :
46 
47  virtual double _eval_df_numeric(double x_, double h_ = 0.0) const;
48 
49  };
50 
53  {
54  public:
55 
57  bool has_functor() const;
58 
60  void set_functor(const i_unary_function & functor_);
61 
64 
67 
68  virtual bool is_in_domain_of_definition(double x_) const;
69 
70  virtual bool has_explicit_domain_of_definition() const;
71 
72  virtual double get_non_zero_domain_min() const;
73 
74  virtual double get_non_zero_domain_max() const;
75 
77  virtual bool is_initialized() const;
78 
80  virtual void reset();
81 
82  protected:
83 
85  virtual double _eval(double x_) const;
86 
87  private:
88 
89  unary_function_handle _functor_;
90 
93 
94  };
95 
96 } // end of namespace mygsl
97 
98 #endif // MYGSL_I_UNARY_FUNCTION_WITH_DERIVATIVE_H
99 
100 /* Local Variables: */
101 /* mode: c++ */
102 /* coding: utf-8 */
103 /* End: */
virtual ~i_unary_function_with_derivative()
Destructor.
virtual double get_non_zero_domain_max() const
The maximum bound of the non-zero domain (default is plus infinity)
void set_functor(const i_unary_function &functor_)
Set the functor.
virtual double eval_df(double x_) const
i_unary_function_with_derivative(double epsilon_=0.0)
Constructor.
Abstract interface for unary functions with derivative.
Definition: i_unary_function_with_derivative.h:28
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)
virtual double get_non_zero_domain_min() const
The minimum bound of the non-zero domain (default is minus infinity)
virtual double _eval_df_numeric(double x_, double h_=0.0) const
bool has_functor() const
Check if the functor is defined.
virtual bool is_initialized() const
Check initialization status.
Abstract interface for unary functions : R -> R.
Definition: i_unary_function.h:44
Unary functions wrapper that adds numeric derivative.
Definition: i_unary_function_with_derivative.h:52
Smart handle to an unary function object.
Definition: unary_function_utils.h:33
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
#define MYGSL_UNARY_FUNCTOR_REGISTRATION_INTERFACE(UnaryFunctorClass)
Definition: i_unary_function.h:206
virtual bool has_explicit_domain_of_definition() const
Check if the function has an explicit domain of definition (default: false)
virtual double eval_f(double x_) const
unary_function_promoted_with_numeric_derivative()
Default constructor.
virtual double _eval(double x_) const
Evaluation.
virtual void eval_fdf(double x_, double &f_, double &df_) const