Pārlūkot izejas kodu

parallel upsample

Former-commit-id: d1e014cbc5c03c6a91a9da8e2b27ce30bbe154c9
Alec Jacobson (jalec 12 gadi atpakaļ
vecāks
revīzija
42942b051b

+ 3 - 2
Makefile

@@ -1,7 +1,8 @@
 .PHONY: all
 all: lib extras examples
 
-GG=g++
+#GG=g++
+GG=clang++
 #GG=/usr/bin/g++     17s
 #GG=/usr/bin/clang++ 14s
 #GG=g++-mp-4.3       15.5s
@@ -15,7 +16,7 @@ $(info Hello, $(IGL_USERNAME)!)
 all: LFLAGS +=
 OPTFLAGS+=-O3 -DNDEBUG $(OPENMP) $(SSE) 
 #debug: OPTFLAGS= -g -Wall -Werror
-debug: OPTFLAGS+= -g -Wall
+debug: OPTFLAGS= -g -Wall
 CFLAGS += $(OPTFLAGS)
 
 EXTRA_DIRS=

+ 3 - 0
examples/bbw/Makefile

@@ -4,6 +4,9 @@ IGL=../../
 IGL_INC=-I${IGL}/include
 IGL_LIB=-L${IGL}/lib -ligl
 
+ifndef MOSEKPLATFORM
+  MOSEKPLATFORM=osx64x86
+endif
 MOSEK=/usr/local/mosek
 MOSEK_INC=-I$(MOSEK)/6/tools/platform/$(MOSEKPLATFORM)/h
 MOSEK_LIB=-L$(MOSEK)/6/tools/platform/$(MOSEKPLATFORM)/bin -lmosek64 -liglmosek

+ 1 - 0
include/igl/is_manifold.cpp

@@ -40,4 +40,5 @@ IGL_INLINE bool igl::is_manifold(const Eigen::PlainObjectBase<DerivedV>& /*V*/,
 // Explicit template specialization
 // generated by autoexplicit.sh
 //template bool igl::is_manifold<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&);
+template bool igl::is_manifold<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
 #endif

+ 0 - 1
include/igl/per_face_normals.cpp

@@ -1,6 +1,5 @@
 #include "per_face_normals.h"
 #include <Eigen/Geometry>
-#include <omp.h>
 
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::per_face_normals(

+ 0 - 1
include/igl/per_vertex_normals.cpp

@@ -2,7 +2,6 @@
 
 #include "per_face_normals.h"
 #include "normalize_row_lengths.h"
-#include <omp.h>
 
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::per_vertex_normals(

+ 10 - 10
include/igl/readOBJ.cpp

@@ -8,13 +8,13 @@
 
 template <typename Scalar, typename Index>
 IGL_INLINE bool igl::readOBJ(
-                             const std::string obj_file_name, 
-                             std::vector<std::vector<Scalar > > & V,
-                             std::vector<std::vector<Scalar > > & TC,
-                             std::vector<std::vector<Scalar > > & N,
-                             std::vector<std::vector<Index > > & F,
-                             std::vector<std::vector<Index > > & FTC,
-                             std::vector<std::vector<Index > > & FN)
+  const std::string obj_file_name, 
+  std::vector<std::vector<Scalar > > & V,
+  std::vector<std::vector<Scalar > > & TC,
+  std::vector<std::vector<Scalar > > & N,
+  std::vector<std::vector<Index > > & F,
+  std::vector<std::vector<Index > > & FTC,
+  std::vector<std::vector<Index > > & FN)
 {
   // Open file, and check for error
   FILE * obj_file = fopen(obj_file_name.c_str(),"r");
@@ -278,9 +278,9 @@ IGL_INLINE bool igl::readOBJ(
 
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE bool igl::readOBJ(
-                             const std::string str,
-                             Eigen::PlainObjectBase<DerivedV>& V,
-                             Eigen::PlainObjectBase<DerivedF>& F)
+  const std::string str,
+  Eigen::PlainObjectBase<DerivedV>& V,
+  Eigen::PlainObjectBase<DerivedF>& F)
 {
   std::vector<std::vector<double> > vV,vTC,vN;
   std::vector<std::vector<int> > vF,vFTC,vFN;

+ 5 - 7
include/igl/upsample.cpp

@@ -98,14 +98,12 @@ IGL_INLINE void igl::upsample(
 }
 
 template <
-  typename DerivedV, 
-  typename DerivedF>
+  typename MatV, 
+  typename MatF>
 IGL_INLINE void igl::upsample(
-  Eigen::PlainObjectBase<DerivedV>& V,
-  Eigen::PlainObjectBase<DerivedF>& F)
+  MatV& V,
+  MatF& F)
 {
-  typedef Eigen::PlainObjectBase<DerivedF> MatF;
-  typedef Eigen::PlainObjectBase<DerivedV> MatV;
   const MatV V_copy = V;
   const MatF F_copy = F;
   return upsample(V_copy,F_copy,V,F);
@@ -113,5 +111,5 @@ IGL_INLINE void igl::upsample(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
-template void igl::upsample<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::upsample<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::Matrix<double, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
 #endif

+ 4 - 4
include/igl/upsample.h

@@ -35,11 +35,11 @@ namespace igl
     Eigen::PlainObjectBase<DerivedNF>& NF);
   // Virtually in place wrapper
   template <
-    typename DerivedV, 
-    typename DerivedF>
+    typename MatV, 
+    typename MatF>
   IGL_INLINE void upsample(
-    Eigen::PlainObjectBase<DerivedV>& V,
-    Eigen::PlainObjectBase<DerivedF>& F);
+    MatV& V,
+    MatF& F);
 }
 
 #ifdef IGL_HEADER_ONLY