STK++ 0.9.13
STK_IFunction.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2016 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/*
26 * Project: stkpp::Analysis
27 * Purpose: Define the Interface IFunction base class.
28 * Author: Serge Iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 **/
30
35#ifndef STK_IFUNCTION_H
36#define STK_IFUNCTION_H
37
38#include "Sdk.h"
39
40#include <STKernel.h>
41
42namespace STK
43{
44
68template <class Function>
69class IFunction: public IRecursiveTemplate<Function>
70{
71 protected:
73 inline IFunction() {}
75 inline ~IFunction() {}
76
77 public:
81 inline Real operator()(Real const& x) const { return this->asDerived().fImpl(x);}
82
84 inline Real xmin() const { return this->asDerived().xminImpl();}
86 inline Real xmax() const { return this->asDerived().xmaxImpl();}
87
89 inline Real xminImpl() const { return -Arithmetic<Real>::max();}
91 inline Real xmaxImpl() const { return Arithmetic<Real>::max();}
92};
93
94} // namespace STK
95
96#endif /*STK_IFUNCTION_H*/
This file include all the header files of the project STKernel.
This file include all the other header files of the project Sdk.
Interface base class for functions.
IFunction()
Default Constructor.
Real xmaxImpl() const
Real operator()(Real const &x) const
Real xminImpl() const
Real xmin() const
Real xmax() const
~IFunction()
destructor.
Interface base class for all classes implementing the curious recursive template paradigm.
Function & asDerived()
static cast : return a reference of this with a cast to the derived class.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.
Arithmetic properties of STK fundamental types.