Skip to content
Snippets Groups Projects
Commit 51f06a73 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[ML] Constant function.

parent 8dd5c871
No related branches found
No related tags found
No related merge requests found
/**
* \author Norihiro Watanabe
* \date 2013-08-13
*
* \copyright
* Copyright (c) 2012-2015, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#ifndef MATHLIB_CONSTANTFUNCTION_H_
#define MATHLIB_CONSTANTFUNCTION_H_
#include <array>
#include <numeric>
namespace MathLib
{
/**
* A constant function.
* \f[
* f(x_1,...,x_k)=a_0
* \f]
*/
template <typename T_TYPE>
class ConstantFunction
{
public:
explicit ConstantFunction(T_TYPE const& value)
: _value(value)
{}
T_TYPE operator()() const
{
return _value;
}
private:
T_TYPE const _value;
};
}
#endif // MATHLIB_CONSTANTFUNCTION_H_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment