68 typedef typename DSLSubseg::Point
Point;
71 typedef typename DSL::Point PointDSL;
83 while(ic.
gcd(a,b) !=1)
94 trace.
beginBlock(
"Draw random values for a,b,mu and abscissa of the first point");
95 trace.
info() <<
"a b mu xf:" << a <<
" " << b <<
" " << mu <<
" " << xf << std::endl;
103 trace.
beginBlock(
"Compare DSLSubsegment/Farey fan with ArithmeticalDSS algorithm");
104 for(
unsigned int i = 0; i<l; i++)
105 for(
unsigned int j = i+1; j<l; j++)
116 DSLSubseg DSLsub(a,b,mu,A,B,
"farey");
120 DSSIterator it(a,b,-mu,A);
121 ArithDSS myDSS(*it, *it);
123 while ( (*it)[0] <=x2 && myDSS.extendFront(*it))
127 if(DSLsub.getA() != myDSS.a() || DSLsub.getB() != myDSS.b() || DSLsub.getMu() != - myDSS.mu())
130 trace.
info() << error1 <<
" errors." << std::endl;
135 trace.
beginBlock(
"Compare DSLSubsegment/localCH with DSLSubsegment/FareyFan");
136 for(
unsigned int i = 0; i<l; i++)
137 for(
unsigned int j = i+1; j<l; j++)
148 DSLSubseg DSLsubCH(a,b,mu,A,B,
"localCH");
151 DSLSubseg DSLsubF(a,b,mu,A,B,
"farey");
155 if(DSLsubCH.getA() != DSLsubF.getA() || DSLsubCH.getB() != DSLsubF.getB() || DSLsubCH.getMu() != DSLsubF.getMu())
159 trace.
info() << error2 <<
" errors." << std::endl;
164 trace.
beginBlock(
"Compare DSLSubsegment/FareyFan with ReversedSmartDSS for 4-connected DSL");
165 for(
unsigned int i = 0; i<l; i++)
166 for(
unsigned int j = i+1; j<l; j++)
172 PointDSL AA = D.lowestY( x1 );
173 PointDSL BB = D.lowestY( x2 );
176 DSL S = D.reversedSmartDSS(AA,BB);
189 DSLSubseg D2(a,a+b,-mu,A2,B2,
"farey");
192 if(!(D2.getA()==S.a() && (D2.getB()-D2.getA())==S.b() && D2.getMu()==-S.mu()))
196 trace.
info() << error3 <<
" errors." << std::endl;
200 return (error1==0 && error2==0 && error3==0);