[86917] trunk/dports/math/igraph

snc at macports.org snc at macports.org
Sun Nov 6 19:19:50 PST 2011


Revision: 86917
          http://trac.macports.org/changeset/86917
Author:   snc at macports.org
Date:     2011-11-06 19:19:49 -0800 (Sun, 06 Nov 2011)
Log Message:
-----------
igraph: fix for non-gcc compilers, #31940

Modified Paths:
--------------
    trunk/dports/math/igraph/Portfile

Added Paths:
-----------
    trunk/dports/math/igraph/files/
    trunk/dports/math/igraph/files/patch-non-gcc-compilers.diff

Modified: trunk/dports/math/igraph/Portfile
===================================================================
--- trunk/dports/math/igraph/Portfile	2011-11-07 03:03:52 UTC (rev 86916)
+++ trunk/dports/math/igraph/Portfile	2011-11-07 03:19:49 UTC (rev 86917)
@@ -22,6 +22,8 @@
 checksums           rmd160  1a230403ab3607dc14a083f0298d84dcb803ef8e \
                     sha256  0c7256849d4f63b12b240aedd4fc5be34a2888cce7dd7b4d91c02315585a063f
 
+patchfiles          patch-non-gcc-compilers.diff
+
 configure.args      --includedir=${prefix}/include/igraph
 
 test.run            yes

Added: trunk/dports/math/igraph/files/patch-non-gcc-compilers.diff
===================================================================
--- trunk/dports/math/igraph/files/patch-non-gcc-compilers.diff	                        (rev 0)
+++ trunk/dports/math/igraph/files/patch-non-gcc-compilers.diff	2011-11-07 03:19:49 UTC (rev 86917)
@@ -0,0 +1,157 @@
+=== modified file 'src/DensityGrid.cpp'
+--- src/DensityGrid.cpp	2009-10-14 13:51:48 +0000
++++ src/DensityGrid.cpp	2011-03-15 14:34:40 +0000
+@@ -44,6 +44,8 @@
+ #include "drl_Node.h"
+ #include "DensityGrid.h"
+ 
++#define GET_BIN(y, x) (Bins[y*GRID_SIZE+x])
++
+ namespace drl {
+ 
+ //*******************************************************
+@@ -71,7 +73,7 @@
+     {
+       Density = new float[GRID_SIZE][GRID_SIZE];
+       fall_off = new float[RADIUS*2+1][RADIUS*2+1];
+-      Bins = new deque<Node>[GRID_SIZE][GRID_SIZE];
++      Bins = new deque<Node>[GRID_SIZE*GRID_SIZE];
+     }
+   catch (bad_alloc errora)
+     {
+@@ -88,7 +90,7 @@
+   for (i=0; i< GRID_SIZE; i++) 
+     for (int j=0; j< GRID_SIZE; j++) {
+       Density[i][j] = 0;
+-      Bins[i][j].erase(Bins[i][j].begin(),Bins[i][j].end());
++      GET_BIN(i, j).erase(GET_BIN(i, j).begin(), GET_BIN(i, j).end());
+     }
+   
+   // Compute fall off
+@@ -100,7 +102,6 @@
+ 	
+ }
+ 
+-
+ /***************************************************
+  * Function: DensityGrid::GetDensity               *
+  * Description: Get_Density from density grid      *
+@@ -129,14 +130,13 @@
+ 			for(int j=x_grid-1; j<=x_grid+1; j++) {
+ 
+ 			// Look through bin and add fine repulsions
+-			for(BI = Bins[i][j].begin(); BI < Bins[i][j].end(); ++BI) {
++			for(BI = GET_BIN(i, j).begin(); BI != GET_BIN(i, j).end(); ++BI) {
+ 				x_dist =  Nx-(BI->x);
+ 				y_dist =  Ny-(BI->y);
+ 				distance = x_dist*x_dist+y_dist*y_dist;
+ 				density += 1e-4/(distance + 1e-50);
+ 		 }
+ 		}
+-
+ 	// Course density
+ 	} else {
+ 
+@@ -250,7 +250,7 @@
+   /* Where to subtract */
+   x_grid = (int)((N.sub_x+HALF_VIEW+.5)*VIEW_TO_GRID);
+   y_grid = (int)((N.sub_y+HALF_VIEW+.5)*VIEW_TO_GRID);
+-  Bins[y_grid][x_grid].pop_front();
++  GET_BIN(y_grid, x_grid).pop_front();
+ }
+ 
+ /***************************************************
+@@ -266,7 +266,7 @@
+   y_grid = (int)((N.y+HALF_VIEW+.5)*VIEW_TO_GRID);
+   N.sub_x = N.x;
+   N.sub_y = N.y;
+-  Bins[y_grid][x_grid].push_back(N);
++  GET_BIN(y_grid, x_grid).push_back(N);
+ }
+ 
+ } // namespace drl
+
+=== modified file 'src/DensityGrid.h'
+--- src/DensityGrid.h	2009-10-14 13:51:48 +0000
++++ src/DensityGrid.h	2011-03-15 14:34:40 +0000
+@@ -74,7 +74,7 @@
+ 	  // new dynamic variables -- SBM
+ 	  float (*fall_off)[RADIUS*2+1];
+ 	  float (*Density)[GRID_SIZE];
+-	  deque<Node> (*Bins)[GRID_SIZE];
++	  deque<Node>* Bins;
+ 
+ 	  // old static variables
+ 	  //float fall_off[RADIUS*2+1][RADIUS*2+1];
+
+=== modified file 'src/DensityGrid_3d.cpp'
+--- src/DensityGrid_3d.cpp	2009-10-14 13:51:48 +0000
++++ src/DensityGrid_3d.cpp	2011-03-15 14:34:40 +0000
+@@ -44,6 +44,8 @@
+ #include "drl_Node_3d.h"
+ #include "DensityGrid_3d.h"
+ 
++#define GET_BIN(z, y, x) (Bins[(z*GRID_SIZE+y)*GRID_SIZE+x])
++
+ namespace drl3d {
+ 
+ //*******************************************************
+@@ -71,7 +73,7 @@
+     {
+       Density = new float[GRID_SIZE][GRID_SIZE][GRID_SIZE];
+       fall_off = new float[RADIUS*2+1][RADIUS*2+1][RADIUS*2+1];
+-      Bins = new deque<Node>[GRID_SIZE][GRID_SIZE][GRID_SIZE];
++      Bins = new deque<Node>[GRID_SIZE*GRID_SIZE*GRID_SIZE];
+     }
+   catch (bad_alloc errora)
+     {
+@@ -89,7 +91,7 @@
+     for (int j=0; j< GRID_SIZE; j++) 
+       for (int k=0; k < GRID_SIZE; k++) {
+ 	Density[i][j][k] = 0;
+-	Bins[i][j][k].erase(Bins[i][j][k].begin(),Bins[i][j][k].end());
++	GET_BIN(i,j,k).erase(GET_BIN(i,j,k).begin(),GET_BIN(i,j,k).end());
+       }
+   
+   // Compute fall off
+@@ -136,7 +138,7 @@
+ 	      for(int j=x_grid-1; j<=x_grid+1; j++) {
+ 		      
+ 		// Look through bin and add fine repulsions
+-		for(BI = Bins[k][i][j].begin(); BI < Bins[k][i][j].end(); ++BI) {
++		for(BI = GET_BIN(k,i,j).begin(); BI < GET_BIN(k,i,j).end(); ++BI) {
+ 		  x_dist =  Nx-(BI->x);
+ 		  y_dist =  Ny-(BI->y);
+ 		  z_dist =  Nz-(BI->z);
+@@ -267,7 +269,7 @@
+   x_grid = (int)((N.sub_x+HALF_VIEW+.5)*VIEW_TO_GRID);
+   y_grid = (int)((N.sub_y+HALF_VIEW+.5)*VIEW_TO_GRID);
+   z_grid = (int)((N.sub_z+HALF_VIEW+.5)*VIEW_TO_GRID);
+-  Bins[z_grid][y_grid][x_grid].pop_front();
++  GET_BIN(z_grid,y_grid,x_grid).pop_front();
+ }
+ 
+ /***************************************************
+@@ -285,7 +287,7 @@
+   N.sub_x = N.x;
+   N.sub_y = N.y;
+   N.sub_z = N.z;
+-  Bins[z_grid][y_grid][x_grid].push_back(N);
++  GET_BIN(z_grid,y_grid,x_grid).push_back(N);
+ }
+ 
+ } // namespace drl3d
+
+=== modified file 'src/DensityGrid_3d.h'
+--- src/DensityGrid_3d.h	2009-10-14 13:51:48 +0000
++++ src/DensityGrid_3d.h	2011-03-15 14:34:40 +0000
+@@ -74,7 +74,7 @@
+ 	  // new dynamic variables -- SBM
+ 	  float (*fall_off)[RADIUS*2+1][RADIUS*2+1];
+ 	  float (*Density)[GRID_SIZE][GRID_SIZE];
+-	  deque<Node> (*Bins)[GRID_SIZE][GRID_SIZE];
++	  deque<Node>* Bins;
+ 
+ 	  // old static variables
+ 	  //float fall_off[RADIUS*2+1][RADIUS*2+1];
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111106/32e622a4/attachment.html>


More information about the macports-changes mailing list