1 #include <boost/test/unit_test.hpp> 13 BOOST_AUTO_TEST_SUITE(PolyTableSliceTest)
15 BOOST_AUTO_TEST_CASE( lastwindows1 )
17 vector<pair<double,string> > data;
18 for(
double i = 0.05 ; i < 0.9 ; i += 0.01 )
19 data.push_back(make_pair(i,
string(
"001000")));
21 SimData d(data.begin(),data.end());
23 unsigned nwindows = unsigned(1./0.001);
24 BOOST_REQUIRE_EQUAL(w.size(),nwindows);
27 BOOST_AUTO_TEST_CASE( nwindows1 )
29 vector<pair<double,string> > data;
30 for(
double i = 0.05 ; i < 0.9 ; i += 0.01 )
31 data.push_back(make_pair(i,
string(
"001000")));
33 SimData d(data.begin(),data.end());
35 unsigned ewindows = std::ceil(
double(d.numsites())/64);
36 BOOST_REQUIRE_EQUAL(w.size(),std::ceil(
double(d.numsites())/
double(ewindows)));
37 for(
auto i = w.cbegin();i!=w.cend();++i)
39 auto wi = w.get_slice(i);
40 BOOST_CHECK( wi.empty() == false );
44 BOOST_AUTO_TEST_CASE( nwindows2 )
47 vector<pair<double,string> > data;
48 for(
double i = 0.05 ; i < 0.9 ; i += 0.001 )
49 data.push_back(make_pair(i,
string(
"001000")));
51 SimData d(data.begin(),data.end());
53 unsigned ewindows = std::ceil(
double(d.numsites())/64);
54 BOOST_REQUIRE_EQUAL(w.size(),std::ceil(
double(d.numsites())/
double(ewindows)));
55 for(
auto i = w.cbegin();i!=w.cend();++i)
57 auto wi = w.get_slice(i);
58 BOOST_CHECK( wi.empty() == false );
63 BOOST_AUTO_TEST_SUITE_END()
The namespace in which this library resides.
Declaration of Sequence::SimData, a class representing polymorphism data from coalescent simulations ...
Data from coalescent simulations.
A container class for "sliding windows" along a polymorphism table.