Reference documentation for deal.II version 9.5.1
\(\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// Copyright (C) 2018 - 2020 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.md at
12// the top level directory of deal.II.
13//
14// ---------------------------------------------------------------------
15#ifndef dealii_cxx17_cmath_h
16#define dealii_cxx17_cmath_h
17
18#include <deal.II/base/config.h>
19
20#if defined(DEAL_II_HAVE_CXX17_BESSEL_FUNCTIONS) || \
21 defined(DEAL_II_HAVE_CXX17_LEGENDRE_FUNCTIONS)
22# include <cmath>
23#endif
24
25#ifndef DEAL_II_HAVE_CXX17_BESSEL_FUNCTIONS
26# include <boost/math/special_functions/bessel.hpp>
27#endif
28
29#ifndef DEAL_II_HAVE_CXX17_LEGENDRE_FUNCTIONS
31
32# include <boost/math/special_functions/legendre.hpp>
33
34# include <limits>
35#endif
36
37
39
40namespace std_cxx17
41{
42#ifndef DEAL_II_HAVE_CXX17_BESSEL_FUNCTIONS
43
44 inline double
45 cyl_bessel_j(double nu, double x)
46 {
47 return boost::math::cyl_bessel_j(nu, x);
48 }
49
50
51
52 inline float
53 cyl_bessel_jf(float nu, float x)
54 {
55 return boost::math::cyl_bessel_j(nu, x);
56 }
57
58#else
59 using std::cyl_bessel_j;
60 using std::cyl_bessel_jf;
61#endif
62
63#ifndef DEAL_II_HAVE_CXX17_LEGENDRE_FUNCTIONS
64
65 inline double
66 legendre(unsigned int l, double x)
67 {
68 Assert(static_cast<int>(l) >= 0,
69 ExcIndexRange(l, 0, std::numeric_limits<int>::max()));
70 return boost::math::legendre_p(static_cast<int>(l), x);
71 }
72
73
74
75 inline float
76 legendre(unsigned int l, float x)
77 {
78 Assert(static_cast<int>(l) >= 0,
79 ExcIndexRange(l, 0, std::numeric_limits<int>::max()));
80 return boost::math::legendre_p(static_cast<int>(l), x);
81 }
82
83
84
85 inline float
86 legendref(unsigned int l, float x)
87 {
88 Assert(static_cast<int>(l) >= 0,
89 ExcIndexRange(l, 0, std::numeric_limits<int>::max()));
90 return boost::math::legendre_p(static_cast<int>(l), x);
91 }
92
93#else
94 using std::legendre;
95 using std::legendref;
96#endif
97} // namespace std_cxx17
98
99
101
102#endif // dealii_cxx17_cmath_h
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
#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:86
double legendre(unsigned int l, double x)
Definition cmath.h:66