This change uses the short-circuit evaluation of if.
It first checks that the two segments have no common
endpoint and only then checks if they are parallel.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
benchmark-linf-hv.cpp is added to check the
runtime for the inputs having only axis parallel segments.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
The following file r4m1knosegless1.cin gave a failed assertion:
p -100 -74
s -89 6 34 -98
p -23 -87
p -48 -91
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
I moved a lot of the functionality for deciding the Linf incircle
test for four points to the side of bounded square predicate.
In the case of query point t being on one of the sides of the
bounded square, I use the predicate test1d. Maybe even this can
be optimized, or made even more robust with some more checks.
A bug that is fixed with the current commit is in the following
input:
$ cat ~/Dropbox/cgal/sdg/panos/sqch1a.cin
p -51 -180
p -180 -30
p -180 20
p -7 -180
I also fixed a small bug when expanding both sides of the bounded
square.
The next step is to completely remove the slow "side of oriented
square" test.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
For the case PPP for incircle_p, use the bounded side predicate
before the oriented side predicate.
A similar change should probably be done in vring, too.
The oriented side predicate makes a lot of tests that are irrelevant
for a finite PPP vertex.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
The benchmarks do not support crossing segmetns.
The input should be fed from stdin and should
be in the the format of "p x y" or "s x1 y1 x2 y2"
per line. Do not give the total number of points
and segments in the first line (this is in contrast
with Menelaos' benchmark expected input).
Example input:
p 20 34
s 10 34 78 1
s 23 18 91 22
Example run:
n=600000 ;
rbox $n D2 s B180 | tail -n $n | awk '{print "p " $1 " " $2 }' |
time benchmark-linf
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
Store the result of comparison of t with coordinates
of bottom left and top right point of square.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
sdg-creation-time.cpp
This example only creates Linf sdg with general Linf traits
sdg-creation-time-hv.cpp
This example creates Linf sdg with Linf traits for axis parallel segments
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This fixes a problem with generating Segment_voronoi_2.moc:
opt/local/include/boost/type_traits/detail/has_binary_operator.hp:50:
Parse error at "BOOST_JOIN"
The problem did not appear before installing boost 1.53 with macports.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
In the case when q and t have the same support, the following
assertion is too strong:
CGAL_assertion(
same_points(q.source_site(), t.source_site()) or
same_points(q.source_site(), t.target_site()) or
same_points(q.target_site(), t.source_site()) or
same_points(q.target_site(), t.target_site()) )
This fixes a bug in the input br89.cin:
s 10 120 60 20
s 60 40 70 60
s 30 110 100 40
s 8 56 180 160
Probably, a similar assertion has to be removed that has to do
with r and t.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>