dune-functions
2.6-dev
dune
functions
analyticfunctions
trigonometricfunction.hh
Go to the documentation of this file.
1
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
// vi: set et ts=4 sw=2 sts=2:
3
#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
4
#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
5
6
7
namespace
Dune
{
8
namespace
Functions {
9
10
11
24
template
<
class
K,
int
sinFactor,
int
cosFactor>
25
class
TrigonometricFunction
26
{
27
public
:
29
K
operator ()
(
const
K& x)
const
30
{
31
return
sinFactor * std::sin(x) + cosFactor * std::cos(x);
32
}
33
};
34
35
37
template
<
class
K,
int
sinFactor,
int
cosFactor>
38
TrigonometricFunction
<K, -cosFactor, sinFactor>
derivative
(
const
TrigonometricFunction<K, sinFactor, cosFactor>
& f)
39
{
40
return
TrigonometricFunction
<K, -cosFactor, sinFactor>();
41
}
42
43
44
45
}}
// namespace Dune::Functions
46
47
48
49
#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
Dune
Definition:
polynomial.hh:7
Dune::Functions::derivative
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition:
trigonometricfunction.hh:38
Dune::Functions::TrigonometricFunction::operator()
K operator()(const K &x) const
Evaluate function.
Definition:
trigonometricfunction.hh:29
Dune::Functions::TrigonometricFunction
A linear combination of trigonomic functions.
Definition:
trigonometricfunction.hh:25
Generated by
1.8.17