[xiph-commits] r11495 - trunk/planarity

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu Jun 1 16:58:39 PDT 2006


Author: xiphmont
Date: 2006-06-01 16:58:38 -0700 (Thu, 01 Jun 2006)
New Revision: 11495

Modified:
   trunk/planarity/graph_generate_mesh2.c
   trunk/planarity/version.h
Log:
Correct a board geenration bug found by Jared Lash;

the bug caused edges from the wrong region of a graph with fully partitioned sections to be considered in edge population, causing the possibility of intersections that were not recorded int he objective...

AFAIK, it affected only board 69, but was a serious logic bug
nonetheless.  Board 69 is now demonstrated solvable (it was not
previously solvable due to the bug).



Modified: trunk/planarity/graph_generate_mesh2.c
===================================================================
--- trunk/planarity/graph_generate_mesh2.c	2006-06-01 19:42:23 UTC (rev 11494)
+++ trunk/planarity/graph_generate_mesh2.c	2006-06-01 23:58:38 UTC (rev 11495)
@@ -129,7 +129,7 @@
   // mark all possible choices
   while(v){
     v->selected = 0;
-    if(v!=current){
+    if(v!=current && current->active == m->active_current){
       if(length_limit==0 || sq_point_distance(v,current)<=length_limit){
 	if(!exists_edge(v,current)){
 	  edge e;
@@ -349,15 +349,17 @@
 }
 
 static void random_populate(mesh *m,vertex *current,int dense_128, float length_limit){
-  int count=select_available(m,current,length_limit,0);
-  if(count){
-    vertex *v = m->g->verticies;
-    while(v){
-      if(v->active == m->active_current && v->selected && random_yes(dense_128)){
-	add_edge(m->g,v,current);
-	v->selected=0;
+  if(current->active == m->active_current){
+    int count=select_available(m,current,length_limit,0);
+    if(count){
+      vertex *v = m->g->verticies;
+      while(v){
+	if(v->selected && random_yes(dense_128)){
+	  add_edge(m->g,v,current);
+	  v->selected=0;
+	}
+	v=v->next;
       }
-      v=v->next;
     }
   }
 }

Modified: trunk/planarity/version.h
===================================================================
--- trunk/planarity/version.h	2006-06-01 19:42:23 UTC (rev 11494)
+++ trunk/planarity/version.h	2006-06-01 23:58:38 UTC (rev 11495)
@@ -1,2 +1,2 @@
 #define VERSION "$Id$ "
-/* DO NOT EDIT: Automated versioning hack [Fri Dec 23 02:17:18 EST 2005] */
+/* DO NOT EDIT: Automated versioning hack [Thu Jun  1 19:53:10 EDT 2006] */



More information about the commits mailing list