7#ifndef BOOST_MATH_LAMBERT_W_TOOLS_HPP_INCLUDED
8#define BOOST_MATH_LAMBERT_W_TOOLS_HPP_INCLUDED
14#include <boost/math/constants/constants.hpp>
15#include <boost/type_traits/is_complex.hpp>
17#include <boost/array.hpp>
26 template<
class ArgumentType>
29 static const ArgumentType
i = std::numeric_limits<ArgumentType>::quiet_NaN();
34 template<
class ArgumentType>
35 inline const std::complex<ArgumentType>&
_imaginary_unit(
const std::complex<ArgumentType> &z)
37 static const std::complex<ArgumentType>
i((ArgumentType)0.,(ArgumentType)1.);
43 template<
class CoeffType>
48 static const CoeffType ans = exp((CoeffType)(-1.));
54 template<
class CoeffType>
60 template<
class CoeffType>
67 template<
class CoeffType>
70 static const CoeffType zero = (CoeffType)0.;
74 template<
class CoeffType>
81 template<
class CoeffType>
84 static const CoeffType ans = (CoeffType)1.;
88 template<
class CoeffType>
89 inline const std::complex<CoeffType>&
_complex_one(
const std::complex<CoeffType> &z)
91 static const std::complex<CoeffType> ans((CoeffType)1.,(CoeffType)0.);
96 template<
class ArgumentType,
class CoeffType, std::
size_t L>
97 ArgumentType
_series_sum(
const ArgumentType &z,
const boost::array<CoeffType,L> &
c)
101 for(std::size_t
k = 0;
k < L; ++
k)
110 template<
class CoeffType, std::
size_t L>
111 boost::array<CoeffType,L>
_coeff_array(CoeffType (&coeffs)(std::size_t) )
113 boost::array<CoeffType,L> ans;
114 for(std::size_t
k = 0;
k < L; ++
k)
123 template<
class ArgumentType,
class Policy>
124 ArgumentType
_linstrips(
const ArgumentType &z,
const Policy &pol)
129 template<
class ArgumentType,
class Policy>
130 std::complex<ArgumentType>
_linstrips(
const std::complex<ArgumentType> &z,
const Policy &pol)
132 return z-boost::math::constants::two_pi<ArgumentType>()
142 template<
class ArgumentType,
class Policy>
143 ArgumentType
_test_s(
const ArgumentType &z,
const ArgumentType &w,
const Policy &pol)
158 template<
class ArgumentType,
class Policy>
159 ArgumentType
_test(
const ArgumentType &z,
const ArgumentType &w,
const Policy &pol)
164 ArgumentType
t = w*exp(w);
166 return std::max(abs((z-
t)/z),abs((z-
t)/
t));
169 template<
class ArgumentType,
class Policy>
170 ArgumentType
_test(
const std::complex<ArgumentType> &z,
const std::complex<ArgumentType> &w,
const Policy &pol)
175 std::complex<ArgumentType>
t = w*exp(w);
177 return std::max(abs((z-
t)/z),abs((z-
t)/
t));
202 template<
class ArgumentType,
class IndexType>
203 ArgumentType
_log_k(
const ArgumentType &z,
const IndexType&
k)
207 return (
k==0)?(log(z)):(std::numeric_limits<ArgumentType>::quiet_NaN());
210 template<
class ArgumentType,
class IndexType>
211 std::complex<ArgumentType>
_log_k(
const std::complex<ArgumentType> &z,
const IndexType&
k)
215 return log(z) + (boost::math::constants::two_pi<ArgumentType>()*
k)*
_imaginary_unit(z);
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
FTensor::Index< 'k', 3 > k
const CoeffType & _complex_one(const CoeffType &z)
const CoeffType & rec_e()
ArgumentType _test(const ArgumentType &z, const ArgumentType &w, const Policy &pol)
const ArgumentType & _imaginary_unit(const ArgumentType &z)
ArgumentType _log_k(const ArgumentType &z, const IndexType &k)
ArgumentType _test_s(const ArgumentType &z, const ArgumentType &w, const Policy &pol)
boost::array< CoeffType, L > _coeff_array(CoeffType(&coeffs)(std::size_t))
CoeffType _complex_imag(const CoeffType &z)
ArgumentType _series_sum(const ArgumentType &z, const boost::array< CoeffType, L > &c)
CoeffType _complex_real(const CoeffType &z)
ArgumentType _linstrips(const ArgumentType &z, const Policy &pol)
constexpr double t
plate stiffness