deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
cmath.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2018 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12#ifndef dealii_cxx17_cmath_h
13#define dealii_cxx17_cmath_h
14
15#include <deal.II/base/config.h>
16
17#if defined(DEAL_II_HAVE_CXX17_BESSEL_FUNCTIONS) || \
18 defined(DEAL_II_HAVE_CXX17_LEGENDRE_FUNCTIONS)
19# include <cmath>
20#endif
21
22#ifndef DEAL_II_HAVE_CXX17_BESSEL_FUNCTIONS
23# include <boost/math/special_functions/bessel.hpp>
24#endif
25
26#ifndef DEAL_II_HAVE_CXX17_LEGENDRE_FUNCTIONS
28
29# include <boost/math/special_functions/legendre.hpp>
30
31# include <limits>
32#endif
33
34
36
37namespace std_cxx17
38{
39#ifndef DEAL_II_HAVE_CXX17_BESSEL_FUNCTIONS
40
41 inline double
42 cyl_bessel_j(double nu, double x)
43 {
44 return boost::math::cyl_bessel_j(nu, x);
45 }
46
47
48
49 inline float
50 cyl_bessel_jf(float nu, float x)
51 {
52 return boost::math::cyl_bessel_j(nu, x);
53 }
54
55#else
56 using std::cyl_bessel_j;
57 using std::cyl_bessel_jf;
58#endif
59
60#ifndef DEAL_II_HAVE_CXX17_LEGENDRE_FUNCTIONS
61
62 inline double
63 legendre(unsigned int l, double x)
64 {
65 Assert(static_cast<int>(l) >= 0,
66 ExcIndexRange(l, 0, std::numeric_limits<int>::max()));
67 return boost::math::legendre_p(static_cast<int>(l), x);
68 }
69
70
71
72 inline float
73 legendre(unsigned int l, float x)
74 {
75 Assert(static_cast<int>(l) >= 0,
76 ExcIndexRange(l, 0, std::numeric_limits<int>::max()));
77 return boost::math::legendre_p(static_cast<int>(l), x);
78 }
79
80
81
82 inline float
83 legendref(unsigned int l, float x)
84 {
85 Assert(static_cast<int>(l) >= 0,
86 ExcIndexRange(l, 0, std::numeric_limits<int>::max()));
87 return boost::math::legendre_p(static_cast<int>(l), x);
88 }
89
90#else
91 using std::legendre;
92 using std::legendref;
93#endif
94} // namespace std_cxx17
95
96
98
99#endif // dealii_cxx17_cmath_h
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define Assert(cond, exc)
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
float legendref(unsigned int l, float x)
Definition cmath.h:83
double legendre(unsigned int l, double x)
Definition cmath.h:63