dune-functions
2.7.0
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
#include <cmath>
7
8
namespace
Dune
{
9
namespace
Functions {
10
11
12
25
template
<
class
K,
int
sinFactor,
int
cosFactor>
26
class
TrigonometricFunction
27
{
28
public
:
30
K
operator ()
(
const
K& x)
const
31
{
32
return
sinFactor * std::sin(x) + cosFactor * std::cos(x);
33
}
34
};
35
36
38
template
<
class
K,
int
sinFactor,
int
cosFactor>
39
TrigonometricFunction
<K, -cosFactor, sinFactor>
derivative
(
const
TrigonometricFunction<K, sinFactor, cosFactor>
& f)
40
{
41
return
TrigonometricFunction
<K, -cosFactor, sinFactor>();
42
}
43
44
45
46
}}
// namespace Dune::Functions
47
48
49
50
#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
Dune::Functions::TrigonometricFunction
A linear combination of trigonomic functions.
Definition:
trigonometricfunction.hh:26
Dune
Definition:
polynomial.hh:10
Dune::Functions::derivative
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition:
trigonometricfunction.hh:39
Dune::Functions::TrigonometricFunction::operator()
K operator()(const K &x) const
Evaluate function.
Definition:
trigonometricfunction.hh:30
Generated by
1.8.17