mirror of
https://github.com/boostorg/functional.git
synced 2025-08-02 22:14:28 +02:00
Remove hash_complex_test's dependency on Boost.Random.
Only test for a few values, but that should be okay as there isn't much to test. [SVN r53924]
This commit is contained in:
@@ -27,11 +27,6 @@
|
|||||||
#pragma warning(disable:4512) // assignment operator could not be generated
|
#pragma warning(disable:4512) // assignment operator could not be generated
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/random/mersenne_twister.hpp>
|
|
||||||
#include <boost/random/uniform_int.hpp>
|
|
||||||
#include <boost/random/uniform_real.hpp>
|
|
||||||
#include <boost/random/variate_generator.hpp>
|
|
||||||
|
|
||||||
#if defined(BOOST_MSVC)
|
#if defined(BOOST_MSVC)
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
@@ -61,33 +56,24 @@ void generic_complex_tests(std::complex<T> v)
|
|||||||
template <class Float>
|
template <class Float>
|
||||||
void complex_float_tests(Float*)
|
void complex_float_tests(Float*)
|
||||||
{
|
{
|
||||||
boost::mt19937 rng;
|
typedef std::complex<Float> complex;
|
||||||
boost::uniform_real<Float> uniform;
|
generic_complex_tests(complex(0,0));
|
||||||
boost::variate_generator<boost::mt19937&, boost::uniform_real<Float> >
|
generic_complex_tests(complex(0.5,0));
|
||||||
uniform_generator(rng, uniform);
|
generic_complex_tests(complex(25,0));
|
||||||
|
generic_complex_tests(complex(25,0));
|
||||||
for(int i = 0; i < 100; ++i)
|
generic_complex_tests(complex(-67.5324535,56.23578678));
|
||||||
{
|
|
||||||
std::complex<Float> v(uniform_generator(), uniform_generator());
|
|
||||||
generic_complex_tests(v);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Integer>
|
template <class Integer>
|
||||||
void complex_integral_tests(Integer*)
|
void complex_integral_tests(Integer*)
|
||||||
{
|
{
|
||||||
boost::mt19937 rng;
|
typedef std::complex<Integer> complex;
|
||||||
boost::uniform_int<Integer> uniform(
|
generic_complex_tests(complex(0,0));
|
||||||
(std::numeric_limits<Integer>::min)(),
|
generic_complex_tests(complex(15342,124));
|
||||||
(std::numeric_limits<Integer>::max)());
|
generic_complex_tests(complex(25,54356));
|
||||||
boost::variate_generator<boost::mt19937&, boost::uniform_int<Integer> >
|
generic_complex_tests(complex(5325,2346));
|
||||||
uniform_generator(rng, uniform);
|
generic_complex_tests(complex(-243897,-49923874));
|
||||||
|
generic_complex_tests(complex(-543,763));
|
||||||
for(int i = 0; i < 100; ++i)
|
|
||||||
{
|
|
||||||
std::complex<Integer>v(uniform_generator(), uniform_generator());
|
|
||||||
generic_complex_tests(v);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
Reference in New Issue
Block a user