63 typedef typename DSL::Point
Point;
64 typedef typename DSL::Vector
Vector;
65 typedef typename DSL::Integer
Integer;
66 typedef typename DSL::Position Position;
68 unsigned int nbok = 0;
76 Position l = (2*aDSL.patternLength());
77 std::vector<Point> lch, uch;
79 std::back_inserter(uch), std::back_inserter(lch) );
81 if (v ==
Vector(aDSL.b(),aDSL.a()))
84 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
85 if ( aDSL.remainder(lch.back()) == aDSL.mu()-1 )
88 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
89 if ( aDSL.remainder(uch.back()) == aDSL.mu() )
92 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
96 unsigned int threshold = (
unsigned int) std::ceil( std::log(bound) / std::log(1.618) );
97 if ( (lch.size()+uch.size()-1) <= threshold )
100 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
202 typedef typename DSL::Point
Point;
203 typedef typename DSL::Vector
Vector;
204 typedef typename DSL::Coordinate Coordinate;
206 unsigned int nbok = 0;
212 trace.
info() << a <<
" " << b << std::endl;
213 trace.
info() <<
"testing every mu between 0 and -" << inputDSL.omega() << std::endl;
215 for (
typename DSL::Integer mu = 0; ( (mu-1 >= -inputDSL.omega())&&(nbok == nb) ); --mu)
217 trace.
info() <<
"mu=" << mu <<
", testing every length between 1 and 2*" << inputDSL.omega() << std::endl;
218 inputDSL = DSL(a,b,mu);
220 for (
typename DSL::Position l = 1; ( (l <= 2*inputDSL.patternLength())&&(nbok == nb) ); ++l)
225 std::vector<Point> lch, uch;
227 std::back_inserter(uch), std::back_inserter(lch) );
234 Vector shift = -inputDSL.shift();
239 typename CIP::HalfSpace line(
typename CIP::Vector(a,-b), mu );
240 typename CIP::HalfSpace line2(
typename CIP::Vector(a,-b), mu-1 );
245 typename CIP::HalfSpace constraint(
typename CIP::Vector(shift[1],-shift[0]), l );
246 std::vector<typename CIP::Point> inch, outch, inch2, outch2;
247 inch.push_back(
typename CIP::Point(shift[0],shift[1]) );
248 inch2.push_back(
typename CIP::Point(shift[0],shift[1]) );
249 ASSERT( line(inch[0]) );
250 ASSERT( constraint(inch[0]) );
251 outch.push_back(
typename CIP::Point(0,0) );
252 outch2.push_back(
typename CIP::Point(0,0) );
253 ASSERT( (!line2(outch[0])) );
254 ASSERT( constraint(outch[0]) );
255 typename CIP::Vector vBezout(1,0);
256 cip.getAllPointsOfHull(inch, outch, vBezout, line, constraint);
257 cip.getAllPointsOfHull(inch2, outch2, vBezout, line2, constraint);
265 std::unique(inch2.begin(), inch2.end());
266 if (std::equal(lch.begin(), lch.end(), inch2.begin()))
270 std::unique(outch.begin(), outch.end());
271 if (std::equal(uch.begin(), uch.end(), outch.begin()))
319 typename DSL::Position x,
typename DSL::Position y)
323 typedef typename DSL::Point
Point;
324 typedef typename DSL::Vector
Vector;
325 typedef typename DSL::Integer
Integer;
327 Point startingPoint = aDSL.getPoint(x);
330 std::vector<Point> lch, uch;
332 std::back_inserter(uch), std::back_inserter(lch) );
335 Point upperLeaningPoint = uch.back();
337 -
static_cast<Integer>(upperLeaningPoint[1])*
static_cast<Integer>(v[0]));
340 return DSL( v[1],v[0],intercept );
357 typename DSL::Position x,
typename DSL::Position y)
361 typedef typename DSL::Point
Point;
362 typedef typename DSL::Coordinate Coordinate;
363 typedef typename DSL::Integer
Integer;
367 Point startingPoint = aDSL.getPoint(x);
368 ASSERT( aDSL(startingPoint) );
369 Point endingPoint = aDSL.getPoint(y);
370 ASSERT( aDSL(endingPoint) );
377 for (++it; (it != ite); ++it)
379 dss.extendFront(*it);
383 return DSL(dss.a(), dss.b(), dss.mu());
501 typedef typename DSL::Point
Point;
502 typedef typename DSL::Vector
Vector;
503 typedef typename DSL::Coordinate Coordinate;
504 typedef typename DSL::Integer
Integer;
505 typedef typename DSL::Position Position;
507 unsigned int nbok = 0;
515 Position l = (2*aDSL.patternLength());
516 Point B = aDSL.getPoint( aDSL.position(A) + l + 1 );
517 DSS dss(aDSL.begin(A), aDSL.begin(B) );
522 std::vector<Point> lch, uch;
524 std::back_inserter(uch), std::back_inserter(lch) );
526 trace.
info() << v << lch.back() << uch.back() << std::endl;
528 if ( (uch.back() == A) && (lch.back() == A - aDSL.shift()) )
531 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
533 Vector LU = lch.back() - uch.back();
537 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
630 typename DSS::Position aBound)
632 ASSERT( (aBound - aDSS.position(aDSS.back())) > 0 );
634 typedef typename DSS::Point
Point;
635 typedef typename DSS::Vector
Vector;
636 typedef typename DSS::Integer
Integer;
637 typedef typename DSS::DSL DSL;
639 Point startingPoint = aDSS.dsl().getPoint(aBound);
642 std::vector<Point> lch, uch;
644 std::back_inserter(uch), std::back_inserter(lch) );
647 Point upperLeaningPoint = uch.back();
649 -
static_cast<Integer>(upperLeaningPoint[1])*
static_cast<Integer>(v[0]));
652 return DSL( v[1],v[0],intercept );
687 unsigned int nbok = 0;
693 for (
typename DSL::Integer mu = 0; ( (mu-1 >= -aDSL.omega())&&(nbok == nb) ); --mu)
695 trace.
info() <<
"mu=" << mu << std::endl;
698 typedef typename DSL::Point
Point;
699 typedef typename DSL::Coordinate Coordinate;
700 typedef typename DSL::Integer
Integer;
703 Point startingPoint = aDSL.getPoint(0);
704 ASSERT( aDSL(startingPoint) );
705 Point endingPoint = aDSL.getPoint(2*aDSL.patternLength()+1);
706 ASSERT( aDSL(endingPoint) );
708 DSS dss = DSS(aDSL.begin(startingPoint), aDSL.begin(endingPoint));
711 for (
typename DSL::Position l = 1; ( (l <= 2*aDSL.patternLength())&&(nbok == nb) ); ++l)
PointVector smartCH(const PointVector &aFirstPoint, const Coordinate &aRemainderBound, const Position &aPositionBound, const PointVector &aStep, const Coordinate &aRStep, const PointVector &aShift, const Coordinate &aRShift, const PositionFunctor &aPositionFunctor, OutputIterator uIto, OutputIterator lIto)
Procedure that computes the lower and upper left hull of a DSS of first point aFirstPoint,...
PointVector reversedSmartCH(PointVector U, PointVector L, PointVector V, const Position &aFirstPosition, const Position &aLastPosition, const PositionFunctor &aPositionFunctor, OutputIterator uIto, OutputIterator lIto)
Procedure that computes the lower and upper left hull of the left subsegment of a greater DSS charact...