1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef BOOST_MATH_COMPLEX_DETAILS_INCLUDED
- #define BOOST_MATH_COMPLEX_DETAILS_INCLUDED
- #include <cmath>
- #include <complex>
- #include <limits>
- #include <boost/math/special_functions/sign.hpp>
- #include <boost/math/special_functions/fpclassify.hpp>
- #include <boost/math/constants/constants.hpp>
- namespace boost{ namespace math{ namespace detail{
- template <class T>
- inline T mult_minus_one(const T& t)
- {
- return (boost::math::isnan)(t) ? t : (boost::math::changesign)(t);
- }
- template <class T>
- inline std::complex<T> mult_i(const std::complex<T>& t)
- {
- return std::complex<T>(mult_minus_one(t.imag()), t.real());
- }
- template <class T>
- inline std::complex<T> mult_minus_i(const std::complex<T>& t)
- {
- return std::complex<T>(t.imag(), mult_minus_one(t.real()));
- }
- template <class T>
- inline T safe_max(T t)
- {
- return std::sqrt((std::numeric_limits<T>::max)()) / t;
- }
- inline long double safe_max(long double t)
- {
-
-
- return std::sqrt((std::numeric_limits<double>::max)()) / t;
- }
- template <class T>
- inline T safe_min(T t)
- {
- return std::sqrt((std::numeric_limits<T>::min)()) * t;
- }
- inline long double safe_min(long double t)
- {
-
-
- return std::sqrt((std::numeric_limits<double>::min)()) * t;
- }
- } } }
- #endif
|