/usr/include/dune/functions/analyticfunctions/trigonometricfunction.hh is in libdune-functions-dev 2.5.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
namespace Dune {
namespace Functions {
/**
* \brief A linear combination of trigonomic functions
*
* \ingroup FunctionImplementations
*
* \tparam K Scalar type. The polynomial will map K to K
* \tparam sinFactor Factor in front of sin
* \tparam cosFactor Factor in front of cos
*
* This class exists mainly to demonstrate how to implement
* the \ref Concept::DifferentiableFunction<Range(Domain), DerivativeTraits> concept.
*/
template<class K, int sinFactor, int cosFactor>
class TrigonometricFunction
{
public:
//! Evaluate function
K operator () (const K& x) const
{
return sinFactor * std::sin(x) + cosFactor * std::cos(x);
}
};
//! Obtain derivative of TrigonometricFunction function \ingroup FunctionImplementations
template<class K, int sinFactor, int cosFactor>
TrigonometricFunction<K, -cosFactor, sinFactor> derivative(const TrigonometricFunction<K, sinFactor, cosFactor>& f)
{
return TrigonometricFunction<K, -cosFactor, sinFactor>();
}
}} // namespace Dune::Functions
#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
|