🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.c++.leda
2 messages
2 total messages Started by Paddy Healy Tue, 08 Aug 1995 13:05
LEDA-R-3.2.1 bug?
#30
Author: Paddy Healy
Date: Tue, 08 Aug 1995 13:05
54 lines
1956 bytes

Machine:	Gateway 2000
OS:		Linux (kernel 1.2.8)
Compiler:	g++ 2.6.3
LEDA:		3.2.1

The following looks like a bug to me in rat_segment::intersection().  The
program should report no intersection for the first two intervals (y=1575)
sg1=[0, 675] and sg2=[1800, 2250].  It should then report an intersection of
the two segments that cross at the origin.

The output is the following:
(foscadh)pH#258 isect_bug
Hey, they intersect!!!
(foscadh)pH#259

This suggests two failures: a false positive with the first pair and a false
negative with the second pair.

isect_bug.cc:
----------------------------------- Cut Here -----------------------------------
#include <LEDA/basic.h>
#include <LEDA/list.h>
#include <LEDA/rat_point.h>
#include <LEDA/rat_segment.h>

main(int argc, char **argv)
{
   rat_point ppt;
   rat_segment sg1(0, 1575, 675, 1575), sg2(1800, 1575, 2250, 1575);

   if (intersection(sg1, sg2))
      cout<< "Hey, they intersect!!!"<< endl;

   if (sg1.intersection(sg2, ppt))
      cout<< "Hey, they intersect at"<< ppt<< endl;

   rat_point ipt;
//   rat_segment s1(675, 0, 675, 2025), s2(2025, 1575, 0, 1575);
   rat_segment s1(-1, 0, 1, 0), s2(0, -1, 0, 1);
   if (s1.intersection(s2, ppt))
      cout<< "Hey, they intersect at"<< ipt<< endl;

}
----------------------------------- Cut Here -----------------------------------

--

Patrick Healy, Dept. of Computer Science and Information Systems
University of Limerick, Limerick, Ireland.

E-mail: healyp@ul.ie	Phone: +353-61-202727	(W)
Fax:	+353-61-330876	       +353-61-325697	(H)
Re: LEDA-R-3.2.1 bug?
#34
Author: Christian Uhrig
Date: Fri, 11 Aug 1995 10:46
19 lines
978 bytes
In article 95Aug8140517@deontas.cs.ul.ie, healyp@ul.ie ( Paddy Healy ) writes:
> 
> 
> Machine:	Gateway 2000
> OS:		Linux (kernel 1.2.8)
> Compiler:	g++ 2.6.3
> LEDA:		3.2.1
> 
> The following looks like a bug to me in rat_segment::intersection().  The
> program should report no intersection for the first two intervals (y=1575)
> sg1=[0, 675] and sg2=[1800, 2250].  It should then report an intersection of
> the two segments that cross at the origin.


The bug will be fixed in the next bug fix release.

regards,

Christian
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads