Bayeux  3.4.1
Core Foundation library for SuperNEMO
product_function.h
Go to the documentation of this file.
1 //
4 // Copyright (c) 2015 by François Mauger <mauger@lpccaen.in2p3.fr>
5 //
6 // This file is part of Bayeux.
7 //
8 // Bayeux is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // Bayeux is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with Bayeux. If not, see <http://www.gnu.org/licenses/>.
20 
21 #ifndef MYGSL_PRODUCT_FUNCTION_H
22 #define MYGSL_PRODUCT_FUNCTION_H
23 
24 // This project:
25 #include <mygsl/i_unary_function.h>
26 
27 namespace mygsl {
28 
30 
39  {
40  public:
41 
44 
46  product_function(const i_unary_function & f_, const i_unary_function & g_);
47 
49  virtual ~product_function();
50 
52  virtual bool is_initialized() const;
53 
55  virtual void initialize(const datatools::properties & config_,
56  const unary_function_dict_type & functors_);
57 
59  void reset();
60 
62  void set_f(const i_unary_function &);
63 
65  void set_g(const i_unary_function &);
66 
68  bool has_f() const;
69 
71  bool has_g() const;
72 
74  /* virtual */ bool has_explicit_domain_of_definition() const;
75 
76  /* virtual */ bool is_in_domain_of_definition(double x_) const;
77 
78  /* virtual */ double get_non_zero_domain_min() const;
79 
80  /* virtual */ double get_non_zero_domain_max() const;
81 
83  virtual void tree_dump(std::ostream & out_ = std::clog,
84  const std::string & title_ = "",
85  const std::string & indent_ = "",
86  bool inherit_ = false) const;
87 
88  protected :
89 
91  double _eval(double x_) const;
92 
93  private:
94 
95  void _at_init();
96 
97  private:
98 
101 
104  };
105 
106 } // end of namespace mygsl
107 
108 #endif // MYGSL_PRODUCT_FUNCTION_H
109 
110 /* Local Variables: */
111 /* mode: c++ */
112 /* coding: utf-8 */
113 /* End: */
double get_non_zero_domain_min() const
The minimum bound of the non-zero domain (default is minus infinity)
product_function()
Default constructor.
bool has_f() const
Check the first functor.
double get_non_zero_domain_max() const
The maximum bound of the non-zero domain (default is plus infinity)
double _eval(double x_) const
Evaluation.
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_f(const i_unary_function &)
Set the first functor.
void set_g(const i_unary_function &)
Set the second functor.
bool is_in_domain_of_definition(double x_) const
Check if a value is in the domain of definition of the function (default: true)
Abstract interface for unary functions : R -> R.
Definition: i_unary_function.h:44
Smart handle to an unary function object.
Definition: unary_function_utils.h:33
bool has_g() const
Check the second functor.
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
virtual bool is_initialized() const
Check initialization status.
virtual ~product_function()
Destructor.
bool has_explicit_domain_of_definition() const
Check if the function has an explicit domain of definition (default: false)
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
virtual void initialize(const datatools::properties &config_, const unary_function_dict_type &functors_)
Initialization from a container of parameters and a dictionary of functors.
Product function.
Definition: product_function.h:38
void reset()
Reset the composite function.
A dictionary of arbitrary properties.
Definition: properties.h:125