STK++ 0.9.13
STK_Law_Functors.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2018 Serge Iovleff, Université Lille 1, Inria
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place,
18 Suite 330,
19 Boston, MA 02111-1307
20 USA
21
22 Contact : S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23*/
24
25/* Project: stkpp::
26 * created on: May 7, 2018
27 * Author: iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
28 **/
29
36#ifndef STK_LAW_FUNCTORS_H
37#define STK_LAW_FUNCTORS_H
38
39namespace STK
40{
41
42namespace Law
43{
44
48template<typename Type>
49struct PdfOp
50{
51 enum { NbParam_ = 1 };
52 typedef Type result_type;
54
55 inline PdfOp(IUnivLaw<Type> const& law): law_(law) {}
56 inline PdfOp(PdfOp const& functor): law_(functor.law_) {}
57 inline result_type operator()(param1_type const& a) const { return law_.pdf(a);}
58
59 private:
61};
62
66template<typename Type>
68{
69 enum { NbParam_ = 1 };
70 typedef Type result_type;
72
73 inline LogPdfOp(IUnivLaw<Type> const& law): law_(law) {}
74 inline LogPdfOp(LogPdfOp const& functor): law_(functor.law_) {}
75 inline result_type operator()(param1_type const& a) const { return law_.lpdf(a);}
76
77 private:
79};
80
84template<typename Type>
85struct CdfOp
86{
87 enum { NbParam_ = 1 };
88 typedef Type result_type;
90
91 inline CdfOp(IUnivLaw<Type> const& law): law_(law) {}
92 inline CdfOp(CdfOp const& functor): law_(functor.law_) {}
93 inline result_type operator()(param1_type const& a) const { return law_.cdf(a);}
94
95 private:
97};
98
102template<typename Type>
104{
105 enum { NbParam_ = 1 };
106 typedef Type result_type;
108
109 inline LogCdfOp(IUnivLaw<Type> const& law): law_(law) {}
110 inline LogCdfOp(LogCdfOp const& functor): law_(functor.law_) {}
111 inline result_type operator()(param1_type const& a) const { return law_.lcdf(a);}
112
113 private:
115};
116
120template<typename Type>
121struct CdfcOp
122{
123 enum { NbParam_ = 1 };
124 typedef Type result_type;
126
127 inline CdfcOp(IUnivLaw<Type> const& law): law_(law) {}
128 inline CdfcOp(CdfcOp const& functor): law_(functor.law_) {}
129 inline result_type operator()(param1_type const& a) const { return law_.cdfc(a);}
130
131 private:
133};
134
138template<typename Type>
140{
141 enum { NbParam_ = 1 };
142 typedef Type result_type;
144
145 inline LogCdfcOp(IUnivLaw<Type> const& law): law_(law) {}
146 inline LogCdfcOp(LogCdfcOp const& functor): law_(functor.law_) {}
147 inline result_type operator()(param1_type const& a) const { return law_.lcdfc(a);}
148
149 private:
151};
152
156template<typename Type>
157struct IcdfOp
158{
159 enum { NbParam_ = 1 };
160 typedef Type result_type;
162
163 inline IcdfOp(IUnivLaw<Type> const& law): law_(law) {}
164 inline IcdfOp(IcdfOp const& functor): law_(functor.law_) {}
165 inline result_type operator()(param1_type const& a) const { return law_.icdf(a);}
166
167 private:
169};
170
171} // namespace law
172
173} // namespace SK
174
175#endif /* STK_LAW_FUNCTORS_H */
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
The namespace STK is the main domain space of the Statistical ToolKit project.
CdfOp(IUnivLaw< Type > const &law)
CdfOp(CdfOp const &functor)
hidden::RemoveConst< Type >::Type param1_type
IUnivLaw< Type > const & law_
result_type operator()(param1_type const &a) const
IUnivLaw< Type > const & law_
result_type operator()(param1_type const &a) const
CdfcOp(IUnivLaw< Type > const &law)
hidden::RemoveConst< Type >::Type param1_type
CdfcOp(CdfcOp const &functor)
IcdfOp(IUnivLaw< Type > const &law)
IUnivLaw< Type > const & law_
hidden::RemoveConst< Type >::Type param1_type
IcdfOp(IcdfOp const &functor)
result_type operator()(param1_type const &a) const
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
IUnivLaw< Type > const & law_
LogCdfOp(LogCdfOp const &functor)
LogCdfOp(IUnivLaw< Type > const &law)
LogCdfcOp(IUnivLaw< Type > const &law)
result_type operator()(param1_type const &a) const
LogCdfcOp(LogCdfcOp const &functor)
IUnivLaw< Type > const & law_
hidden::RemoveConst< Type >::Type param1_type
LogPdfOp(IUnivLaw< Type > const &law)
hidden::RemoveConst< Type >::Type param1_type
LogPdfOp(LogPdfOp const &functor)
IUnivLaw< Type > const & law_
result_type operator()(param1_type const &a) const
PdfOp(PdfOp const &functor)
hidden::RemoveConst< Type >::Type param1_type
IUnivLaw< Type > const & law_
PdfOp(IUnivLaw< Type > const &law)
result_type operator()(param1_type const &a) const