Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/math/complex/atan.hpp @ 133:4acb5d8d80b6 tip
Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author | Chris Cannam |
---|---|
date | Tue, 30 Jul 2019 12:25:44 +0100 |
parents | 2665513ce2d3 |
children |
rev | line source |
---|---|
Chris@16 | 1 // (C) Copyright John Maddock 2005. |
Chris@16 | 2 // Use, modification and distribution are subject to the |
Chris@16 | 3 // Boost Software License, Version 1.0. (See accompanying file |
Chris@16 | 4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 5 |
Chris@16 | 6 #ifndef BOOST_MATH_COMPLEX_ATAN_INCLUDED |
Chris@16 | 7 #define BOOST_MATH_COMPLEX_ATAN_INCLUDED |
Chris@16 | 8 |
Chris@16 | 9 #ifndef BOOST_MATH_COMPLEX_DETAILS_INCLUDED |
Chris@16 | 10 # include <boost/math/complex/details.hpp> |
Chris@16 | 11 #endif |
Chris@16 | 12 #ifndef BOOST_MATH_COMPLEX_ATANH_INCLUDED |
Chris@16 | 13 # include <boost/math/complex/atanh.hpp> |
Chris@16 | 14 #endif |
Chris@16 | 15 |
Chris@16 | 16 namespace boost{ namespace math{ |
Chris@16 | 17 |
Chris@16 | 18 template<class T> |
Chris@16 | 19 std::complex<T> atan(const std::complex<T>& x) |
Chris@16 | 20 { |
Chris@16 | 21 // |
Chris@16 | 22 // We're using the C99 definition here; atan(z) = -i atanh(iz): |
Chris@16 | 23 // |
Chris@16 | 24 if(x.real() == 0) |
Chris@16 | 25 { |
Chris@16 | 26 if(x.imag() == 1) |
Chris@16 | 27 return std::complex<T>(0, std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : static_cast<T>(HUGE_VAL)); |
Chris@16 | 28 if(x.imag() == -1) |
Chris@16 | 29 return std::complex<T>(0, std::numeric_limits<T>::has_infinity ? -std::numeric_limits<T>::infinity() : -static_cast<T>(HUGE_VAL)); |
Chris@16 | 30 } |
Chris@16 | 31 return ::boost::math::detail::mult_minus_i(::boost::math::atanh(::boost::math::detail::mult_i(x))); |
Chris@16 | 32 } |
Chris@16 | 33 |
Chris@16 | 34 } } // namespaces |
Chris@16 | 35 |
Chris@16 | 36 #endif // BOOST_MATH_COMPLEX_ATAN_INCLUDED |