std::vector<Interval> findIntervalsAtPoints(const vector<Interval>& intervals){
vector<Interval> points;
for (size_t p = 1; p <= intervals.size(); ++p){
- cout << endl << "Point " << p << " : ";
size_t f = 0;
size_t s = 0;
bool found = false;
}
}
}
- cout << f << ":" << s << endl;
points.push_back(Interval(f,s));
}
return points;
int cycles = 0;
set<size_t> marked;
vector<Interval> intervals = findIntervals(go);
- vector<Interval> points;
+ vector<Interval> points = findIntervalsAtPoints(intervals);
for (size_t p = 1; p < go.size(); ++p){
if (marked.find(p) != marked.end())
continue;
Interval i = intervals[points[p-1].first];
- while (marked.find(p) != marked.end()){
+ while (marked.find(p) == marked.end()){
marked.insert(p);
if (i == intervals[points[p-1].first])
i = intervals[points[p-1].second];
CPPUNIT_TEST( testLongestSequences );
CPPUNIT_TEST( testFindIntervals );
CPPUNIT_TEST( testFindIntervalsAtPoints );
- //CPPUNIT_TEST( testCountCycles );
+ CPPUNIT_TEST( testCountCycles );
CPPUNIT_TEST_SUITE_END();
protected: