|
|
|
|
Points file for testing (redirect to input from command line): 50 0 6 4 9 1 0 1 4 4 9 4 5 2 6 4 8 5 6 4 7 3 3 1 5 4 7 1 3 5 6 2 7 7 1 2 1 1 2 4 6 9 8 5 8 8 5 3 4 9 1 0 6 7 7 0 0 9 0 9 4 8 6 6 5 8 5 4 0 4 4 9 4 6 7 0 0 8 7 8 1 7 7 5 1 7 5 9 1 8 5 3 5 1 3 1 8 9 2 8 6 |
nowy20180820 wrote: |
---|
lastchance do you know any good OpenGL tutorials |
|
|
|
|
Currently logging to "gdb.txt". Future logs will be written to convexHull.log. Logs will be appended to the log file. Output will be logged and displayed. Starting program: F:\ConvexHull\QuickHull\convexHull\bin\Release/convexHull.exe [New Thread 3152.0x320c] [New Thread 3152.0x1374] [New Thread 3152.0x3404] [New Thread 3152.0x2be0] Program received signal SIGSEGV, Segmentation fault. 0x00402cf7 in Link<Point>::setPrevious(Link<Point>*) () at F:/ConvexHull/QuickHull/convexHull/Link.hpp:71 71 this->previous = previous; #0 0x00402cf7 in Link<Point>::setPrevious(Link<Point>*) () at F:/ConvexHull/QuickHull/convexHull/Link.hpp:71 #1 0x00402ac3 in DoublyLinkedList<Point>::deleteFirst() () at F:/ConvexHull/QuickHull/convexHull/DoublyLinkedList.hpp:120 #2 0x00401686 in Split(Point, Point, DoublyLinkedList<Point>&, DoublyLinkedList<Point>&, DoublyLinkedList<Point>&) () at F:\ConvexHull\QuickHull\convexHull\main.cpp:50 #3 0x0040174f in PruneAndSplit(Point, Point, Point, DoublyLinkedList<Point>&, DoublyLinkedList<Point>&, DoublyLinkedList<Point>&) () at F:\ConvexHull\QuickHull\convexHull\main.cpp:60 #4 0x004019bd in QuickHull(Point, Point, DoublyLinkedList<Point>&, DoublyLinkedList<Point>&) () at F:\ConvexHull\QuickHull\convexHull\main.cpp:101 #5 0x00401b65 in Solve(DoublyLinkedList<Point>&, DoublyLinkedList<Point>&) () at F:\ConvexHull\QuickHull\convexHull\main.cpp:121 #6 0x00401e27 in main () at F:\ConvexHull\QuickHull\convexHull\main.cpp:171 A debugging session is active. Inferior 1 [process 3152] will be killed. Quit anyway? (y or n) error return ../../gdb-7.2/gdb/windows-nat.c:1243 was 5 |
|
|
PROCEDURE Split(p,q:Point; VAR S,R,L:PointSet); ... BEGIN NewSet(R); NewSet(L); ... END; PROCEDURE PruneAndSplit(p,q,r:Point; VAR S,U,L: PointSet); VAR internal : PointSet; BEGIN Split(p,r,S,U,internal); Split(r,q,internal,L,internal); Eliminate(internal); END; |
internal
to parameters S and L in Split. But Split reinitializes L. That reinitializes S too. The fix is use a second dummy PointSet.forward_list
s to mimic what the Pascal program does. It might be slightly faster than lastchance's since it just twiddles with the list links rather than copying the points themselves.
|
|