123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- #ifndef BOOST_MATH_COMPLEX_DETAILS_INCLUDED
- #define BOOST_MATH_COMPLEX_DETAILS_INCLUDED
- #include <boost/config.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/config/no_tr1/complex.hpp>
- #include <boost/limits.hpp>
- #include <math.h> // isnan where available
- #include <boost/config/no_tr1/cmath.hpp>
- #include <boost/math/special_functions/sign.hpp>
- #include <boost/math/special_functions/fpclassify.hpp>
- #include <boost/math/special_functions/sign.hpp>
- #include <boost/math/constants/constants.hpp>
- #ifdef BOOST_NO_STDC_NAMESPACE
- namespace std{ using ::sqrt; }
- #endif
- 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;
- }
- #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
- inline float safe_max(float t)
- {
- return std::sqrt((std::numeric_limits<float>::max)()) / t;
- }
- inline double safe_max(double t)
- {
- return std::sqrt((std::numeric_limits<double>::max)()) / t;
- }
- #endif
- 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;
- }
- #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
- inline double safe_min(double t)
- {
- return std::sqrt((std::numeric_limits<double>::min)()) * t;
- }
- inline float safe_min(float t)
- {
- return std::sqrt((std::numeric_limits<float>::min)()) * t;
- }
- #endif
- } } }
- #endif
|