ソースを参照

openmp for bfs_orient and sparse for components

Former-commit-id: a459b5963ef08835df18708cdd7a9302f3cbc325
Alec Jacobson (jalec 11 年 前
コミット
31685d56d9
2 ファイル変更6 行追加2 行削除
  1. 1 0
      include/igl/boost/bfs_orient.cpp
  2. 5 2
      include/igl/boost/components.cpp

+ 1 - 0
include/igl/boost/bfs_orient.cpp

@@ -29,6 +29,7 @@ void igl::bfs_orient(
     FF = F;
   }
   // loop over patches
+#pragma omp parallel for
   for(int c = 0;c<num_cc;c++)
   {
     queue<int> Q;

+ 5 - 2
include/igl/boost/components.cpp

@@ -1,7 +1,8 @@
 #include "components.h"
 #include <igl/adjacency_matrix.h>
 
-#include <boost/graph/adjacency_matrix.hpp>
+//#include <boost/graph/adjacency_matrix.hpp>
+#include <boost/graph/adjacency_list.hpp>
 #include <boost/graph/connected_components.hpp>
 #include <iostream>
 #include <vector>
@@ -14,7 +15,9 @@ IGL_INLINE void igl::components(
 {
   assert(A.rows() == A.cols());
   using namespace Eigen;
-  boost::adjacency_matrix<boost::undirectedS> bA(A.rows());
+  // THIS IS DENSE:
+  //boost::adjacency_matrix<boost::undirectedS> bA(A.rows());
+  boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS> bA(A.rows());
   for(int j=0; j<A.outerSize();j++)
   {
     // Iterate over inside