dune-functions
2.10
Loading...
Searching...
No Matches
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
4
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
5
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
6
7
#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
8
#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
9
10
#include <cmath>
11
12
namespace
Dune
{
13
namespace
Functions {
14
15
16
29
template
<
class
K,
int
sinFactor,
int
cosFactor>
30
class
TrigonometricFunction
31
{
32
public
:
34
K
operator ()
(
const
K& x)
const
35
{
36
return
sinFactor * std::sin(x) + cosFactor * std::cos(x);
37
}
38
};
39
40
42
template
<
class
K,
int
sinFactor,
int
cosFactor>
43
TrigonometricFunction
<K, -cosFactor, sinFactor>
derivative
(
const
TrigonometricFunction<K, sinFactor, cosFactor>
& f)
44
{
45
return
TrigonometricFunction
<K, -cosFactor, sinFactor>();
46
}
47
48
49
50
}}
// namespace Dune::Functions
51
52
53
54
#endif
// DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
Dune::Functions::derivative
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition
trigonometricfunction.hh:43
Dune
Definition
polynomial.hh:17
Dune::Functions::TrigonometricFunction
A linear combination of trigonomic functions.
Definition
trigonometricfunction.hh:31
Dune::Functions::TrigonometricFunction::operator()
K operator()(const K &x) const
Evaluate function.
Definition
trigonometricfunction.hh:34
Generated by
1.9.8