Author: Tamas Nepusz <ntamas@gmail.com>
Last-Changed: Thu, 28 Aug 2014 10:48:43 +0100
Description: Fix failing test cases
Bug: https://github.com/igraph/igraph/issues/676
Applied-Upstream: 0.7.2, https://github.com/igraph/igraph/commit/c2afdb1


--- a/examples/simple/tls2.c
+++ b/examples/simple/tls2.c
@@ -105,10 +105,12 @@
   }
   
   while (1) {
+#if IGRAPH_THREAD_SAFE
     igraphdsaupd_(&ido, options.bmat, &options.n, options.which,
 		  &options.nev, &options.tol, resid, &options.ncv, v, 
 		  &options.ldv, options.iparam, options.ipntr, workd,
 		  workl, &options.lworkl, &options.info);
+#endif
     
     if (ido == -1 || ido == 1) {
       
@@ -142,12 +144,14 @@
     return 0;
   }
 
+#if IGRAPH_THREAD_SAFE
   igraphdseupd_(&rvec, all, select, d, v, &options.ldv,
 		&options.sigma, options.bmat, &options.n,
 		options.which, &options.nev, &options.tol,
 		resid, &options.ncv, v, &options.ldv, options.iparam,
 		options.ipntr, workd, workl, &options.lworkl,
 		&options.ierr);
+#endif
   
   if (options.ierr != 0) {
     printf("ARPACK error\n");
--- a/examples/simple/igraph_arpack_rnsolve.c
+++ b/examples/simple/igraph_arpack_rnsolve.c
@@ -66,6 +66,10 @@
   igraph_arpack_rnsolve(cb2, /*extra=*/ &data, &options, /*storage=*/ 0, 
 			&values, &vectors);
 
+  while (options.nev < igraph_matrix_nrow(&values)) {
+    igraph_matrix_remove_row(&values, igraph_matrix_nrow(&values)-1);
+  }
+  
   if (MATRIX(values, 2, 1) > 0) {
     MATRIX(values, 2, 1) = -MATRIX(values, 2, 1);
     MATRIX(values, 3, 1) = -MATRIX(values, 3, 1);    
@@ -84,6 +88,10 @@
   igraph_arpack_rnsolve(cb2, /*extra=*/ &data, &options, /*storage=*/ 0, 
 			&values, &vectors);
 
+  while (options.nev < igraph_matrix_nrow(&values)) {
+    igraph_matrix_remove_row(&values, igraph_matrix_nrow(&values)-1);
+  }
+  
   if (MATRIX(values, 2, 1) > 0) {
     MATRIX(values, 2, 1) = -MATRIX(values, 2, 1);
   }
@@ -101,6 +109,10 @@
   igraph_arpack_rnsolve(cb2, /*extra=*/ &data, &options, /*storage=*/ 0, 
 			&values, &vectors);
 
+  while (options.nev < igraph_matrix_nrow(&values)) {
+    igraph_matrix_remove_row(&values, igraph_matrix_nrow(&values)-1);
+  }
+  
   igraph_matrix_print(&values);
   printf("---\n");
   igraph_matrix_print(&vectors);
@@ -114,6 +126,10 @@
   igraph_arpack_rnsolve(cb2, /*extra=*/ &data, &options, /*storage=*/ 0, 
 			&values, &vectors);
 
+  while (options.nev < igraph_matrix_nrow(&values)) {
+    igraph_matrix_remove_row(&values, igraph_matrix_nrow(&values)-1);
+  }
+  
   igraph_matrix_print(&values);
   printf("---\n");
   igraph_matrix_print(&vectors);
