Browse Source

all examples build with static

Former-commit-id: d1f6ef127cf4e07ebafd92b0c718287cf18c42da
jalec 13 years ago
parent
commit
b8c50e5f06
80 changed files with 356 additions and 106 deletions
  1. 9 2
      Makefile
  2. 3 0
      all_pairs_distances.cpp
  3. 48 0
      autoexplicit.sh
  4. 4 0
      axis_angle_to_quat.cpp
  5. 6 0
      cat.cpp
  6. 4 0
      colon.cpp
  7. 4 0
      cotangent.cpp
  8. 2 0
      cotmatrix.cpp
  9. 4 0
      create_vector_vbo.cpp
  10. 7 7
      edgetopology.h
  11. 5 3
      examples/Core/Makefile
  12. 30 29
      examples/Core/example2.cpp
  13. 18 0
      examples/Makefile
  14. 3 3
      examples/ReAntTweakBar/Makefile
  15. 1 1
      examples/affine/Makefile
  16. 1 1
      examples/cat/Makefile
  17. 1 1
      examples/dmat/Makefile
  18. 3 3
      examples/eigen-gotchas/Makefile
  19. 0 1
      examples/example_fun/Makefile
  20. 1 1
      examples/file_contents_as_string/Makefile
  21. 1 1
      examples/get_seconds/Makefile
  22. 1 1
      examples/glslversion/Makefile
  23. 1 0
      examples/glut_speed_test/Makefile
  24. 1 1
      examples/is_dir/Makefile
  25. 3 3
      examples/meshio/Makefile
  26. 1 1
      examples/mode/Makefile
  27. 1 1
      examples/path_tests/Makefile
  28. 1 0
      examples/pathinfo/Makefile
  29. 3 3
      examples/slice/Makefile
  30. 1 1
      examples/sort/Makefile
  31. 1 1
      examples/stdin_to_temp/Makefile
  32. 1 1
      examples/stdin_to_temp/example.cpp
  33. 1 0
      examples/trackball/Makefile
  34. 3 2
      examples/trackball/example.cpp
  35. 1 1
      examples/transpose_blocks/Makefile
  36. 2 0
      find.cpp
  37. 2 0
      full.cpp
  38. 2 0
      is_manifold.cpp
  39. 2 0
      is_symmetric.cpp
  40. 14 0
      list_to_matrix.cpp
  41. 2 0
      mat_min.cpp
  42. 4 0
      max_size.cpp
  43. 1 0
      min_quad_dense.cpp
  44. 4 0
      min_size.cpp
  45. 4 0
      mode.cpp
  46. 5 0
      normalize_quat.cpp
  47. 5 0
      normalize_rows.cpp
  48. 5 0
      per_corner_normals.cpp
  49. 9 3
      per_face_normals.cpp
  50. 6 1
      per_vertex_normals.cpp
  51. 2 0
      print_ijv.cpp
  52. 2 0
      quat_conjugate.cpp
  53. 4 0
      quat_mult.cpp
  54. 2 0
      quat_to_mat.cpp
  55. 4 1
      read.cpp
  56. 2 0
      readMESH.cpp
  57. 3 1
      readOBJ.cpp
  58. 1 1
      readOBJ.h
  59. 5 0
      readOFF.cpp
  60. 2 0
      reorder.cpp
  61. 4 0
      repdiag.cpp
  62. 5 3
      repmat.cpp
  63. 3 3
      repmat.h
  64. 2 0
      rotate_by_quat.cpp
  65. 16 6
      slice.cpp
  66. 6 6
      slice.h
  67. 8 6
      slice_into.cpp
  68. 6 6
      slice_into.h
  69. 4 0
      snap_to_canonical_view_quat.cpp
  70. 2 0
      sort.cpp
  71. 2 0
      speye.cpp
  72. 1 0
      todos.txt
  73. 3 0
      trackball.cpp
  74. 2 0
      transpose_blocks.cpp
  75. 2 0
      tt.cpp
  76. 2 0
      vf.cpp
  77. 6 0
      write.cpp
  78. 3 0
      writeDMAT.cpp
  79. 5 0
      writeOBJ.cpp
  80. 5 0
      writeOFF.cpp

+ 9 - 2
Makefile

@@ -1,8 +1,14 @@
 .PHONY: all
+.PHONY: examples
 
-all: obj libigl.a
+all: lib examples
 
-debug: obj libigl.a
+debug: lib
+
+lib: obj libigl.a
+
+examples:
+	make -C examples
 
 CPP_FILES=$(wildcard ./*.cpp)
 OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
@@ -34,3 +40,4 @@ obj/%.o: %.cpp
 clean:
 	rm -f obj/*.o
 	rm -f libigl.a
+	make -C examples clean

+ 3 - 0
all_pairs_distances.cpp

@@ -1,4 +1,5 @@
 #include "all_pairs_distances.h"
+#include <Eigen/Dense>
 
 template <typename Mat>
 IGL_INLINE void igl::all_pairs_distances(
@@ -26,4 +27,6 @@ IGL_INLINE void igl::all_pairs_distances(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::all_pairs_distances<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, bool, Eigen::Matrix<double, -1, -1, 0, -1, -1>&);
 #endif

+ 48 - 0
autoexplicit.sh

@@ -0,0 +1,48 @@
+#!/bin/bash
+# Usage:
+#   make 2>&1 | autoexplicit.sh
+
+
+# process input line by line
+while read line; do
+  if ! echo "$line" | grep -q "^\".*\", referenced from:$"
+  then 
+    # undefined symbol line not found
+    continue
+  fi
+  symbol=`echo "$line" | sed -e "s/^\"\(.*\)\", referenced from:$/\1/"`
+  #echo "symbol = $symbol"
+  filename=`echo "$symbol" | perl -pe "s#.*?igl::([A-z0-9_]*).*$'$'#\1#"`
+  #echo "filename = $filename"
+  cpp="$filename.cpp"
+  # append .cpp and check that file exists
+  if [ ! -e "$cpp" ]
+  then
+    echo "Warning: $cpp does not exist, skipping ..."
+    continue
+  fi
+
+  if ! grep -q "^\/\/ Explicit template specialization*$" "$cpp"
+  then
+    echo "Warning: skipping $cpp because it does not match ^\/\/ Explicit template specialization*$ "
+    continue;
+  fi
+
+  before=`sed '/^\/\/ Explicit template specialization$/q' "$cpp"`;
+  #echo "before = $before"
+  after=`sed '1,/^\/\/ Explicit template specialization$/d' $cpp`;
+  #echo "after = $after"
+  explicit="template $symbol;"
+  #echo "$explicit"
+  if grep -F "$explicit" "$cpp"
+  then
+    echo "Error: $cpp already contains $explicit"
+    echo "       Recompile igl static lib, recompile your project, and try again."
+    continue
+  fi
+  echo "$before" > "$cpp"
+  echo "// generated by autoexplicit.sh" >> "$cpp"
+  echo "$explicit" >> "$cpp"
+  echo "$after" >> "$cpp"
+
+done

+ 4 - 0
axis_angle_to_quat.cpp

@@ -26,4 +26,8 @@ IGL_INLINE void igl::axis_angle_to_quat(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::axis_angle_to_quat<double>(double const*, double, double*);
+// generated by autoexplicit.sh
+template void igl::axis_angle_to_quat<float>(float const*, float, float*);
 #endif

+ 6 - 0
cat.cpp

@@ -133,4 +133,10 @@ IGL_INLINE void cat(const std::vector<std::vector< Mat > > & A, Mat & C)
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template Eigen::Matrix<double, -1, -1, 0, -1, -1> igl::cat<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(int, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&);
+// generated by autoexplicit.sh
+template Eigen::SparseMatrix<double, 0, int> igl::cat<Eigen::SparseMatrix<double, 0, int> >(int, Eigen::SparseMatrix<double, 0, int> const&, Eigen::SparseMatrix<double, 0, int> const&);
+// generated by autoexplicit.sh
+template Eigen::Matrix<int, -1, -1, 0, -1, -1> igl::cat<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(int, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&);
 #endif

+ 4 - 0
colon.cpp

@@ -68,4 +68,8 @@ IGL_INLINE Eigen::Matrix<T,Eigen::Dynamic,1> igl::colon(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::colon<int, int, int>(int, int);
+// generated by autoexplicit.sh
+template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::colon<int, int, long>(int, long);
 #endif

+ 4 - 0
cotangent.cpp

@@ -126,4 +126,8 @@ IGL_INLINE void igl::cotangent(const MatV & V, const MatF & F, MatC & C)
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::cotangent<Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&);
+// generated by autoexplicit.sh
+template void igl::cotangent<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<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&);
 #endif

+ 2 - 0
cotmatrix.cpp

@@ -68,4 +68,6 @@ IGL_INLINE void igl::cotmatrix(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::cotmatrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<double, 0, int>&);
 #endif

+ 4 - 0
create_vector_vbo.cpp

@@ -42,4 +42,8 @@ IGL_INLINE void igl::create_vector_vbo(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::create_vector_vbo<int>(Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, unsigned int&);
+// generated by autoexplicit.sh
+template void igl::create_vector_vbo<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, unsigned int&);
 #endif

+ 7 - 7
edgetopology.h

@@ -22,21 +22,21 @@ namespace igl
   inline void edgetopology(
     const Eigen::MatrixXd& V, 
     const Eigen::MatrixXi& F, 
-    const Eigen::MatrixXi& EV, 
-    const Eigen::MatrixXi& FE, 
-    const Eigen::MatrixXi& EF);
+    Eigen::MatrixXi& EV, 
+    Eigen::MatrixXi& FE, 
+    Eigen::MatrixXi& EF);
 }
 
 // Broken Implementation
 #include <algorithm>
 #include "is_manifold.h"
 
-inline void edgetopology(
+inline void igl::edgetopology(
   const Eigen::MatrixXd& V, 
   const Eigen::MatrixXi& F, 
-  const Eigen::MatrixXi& EV, 
-  const Eigen::MatrixXi& FE, 
-  const Eigen::MatrixXi& EF)
+  Eigen::MatrixXi& EV, 
+  Eigen::MatrixXi& FE, 
+  Eigen::MatrixXi& EF)
 {
   assert(igl::is_manifold(V,F));
   std::vector<std::vector<int> > ETT;

+ 5 - 3
examples/Core/Makefile

@@ -6,8 +6,10 @@ eigen_lib=/opt/local/include/eigen3/
 
 CFLAGS=-g
 inc=-I$(igl_lib) -I$(eigen_lib)
+lib=-L$(igl_lib) -ligl
 
-matlablibs=-I/Applications/MATLAB_R2010b.app/extern/include -L/Applications/MATLAB_R2010b.app/bin/maci64/ -leng -lmx
+matlab_inc=-I$(MATLAB)/extern/include 
+matlab_lib=-L$(MATLAB)/bin/maci64/ -leng -lmx
 
 example1: example1.o
 	g++ $(CFLAGS) -o example1 example1.o -framework OpenGL -framework GLUT $(lib)
@@ -17,11 +19,11 @@ example1.o: example1.cpp
 	g++ $(CFLAGS) -c example1.cpp -o example1.o $(inc)
 
 example2: example2.o
-	g++ $(CFLAGS) $(matlablibs) -o example2 example2.o -framework OpenGL -framework GLUT $(lib)
+	g++ $(CFLAGS) $(matlab_lib) -o example2 example2.o -framework OpenGL -framework GLUT $(lib)
 	rm example2.o
 
 example2.o: example2.cpp
-	g++ $(CFLAGS) $(matlablibs) -c example2.cpp -o example2.o $(inc)
+	g++ $(CFLAGS) $(matlab_inc) -c example2.cpp -o example2.o $(inc)
 
 clean:
 	rm -f example1.o

+ 30 - 29
examples/Core/example2.cpp

@@ -20,35 +20,36 @@ using namespace std;
 
 int main (int argc, const char * argv[])
 {
-    // read the header of matlabinterface.h for compilation instructions
-    
-    Eigen::MatrixXd V,V2;
-    Eigen::MatrixXi F,F2;
-    
-    // Read mesh from file
-    igl::read("bunny.off",V,F);
-    
-    // Send mesh to matlab
-    igl::mlsetmatrix("V",V);
-    igl::mlsetmatrix("F",F);
-
-    // Plot the mesh from matlab
-    igl::mleval("trimesh(F,V(:,1),V(:,2),V(:,3))");
-
-    // Receive mesh from matlab
-    igl::mlgetmatrix("V",V2);
-    igl::mlgetmatrix("F",F2);
-
-    // Plot the received mesh
-    cerr << "V " << endl << V2  << endl;
-    cerr << "F " << endl << F2  << endl;
-    
-    // It is also possible to send scalars
-    igl::mlsetscalar("s", 3);
-    cerr << "s = " << igl::mlgetscalar("s") << endl;
-
-    // If the program closes the matlab session is killed too..
-    getchar();
+  // This is broken
+    //// read the header of matlabinterface.h for compilation instructions
+    //
+    //Eigen::MatrixXd V,V2;
+    //Eigen::MatrixXi F,F2;
+    //
+    //// Read mesh from file
+    //igl::read("bunny.off",V,F);
+    //
+    //// Send mesh to matlab
+    //igl::mlsetmatrix("V",V);
+    //igl::mlsetmatrix("F",F);
+
+    //// Plot the mesh from matlab
+    //igl::mleval("trimesh(F,V(:,1),V(:,2),V(:,3))");
+
+    //// Receive mesh from matlab
+    //igl::mlgetmatrix("V",V2);
+    //igl::mlgetmatrix("F",F2);
+
+    //// Plot the received mesh
+    //cerr << "V " << endl << V2  << endl;
+    //cerr << "F " << endl << F2  << endl;
+    //
+    //// It is also possible to send scalars
+    //igl::mlsetscalar("s", 3);
+    //cerr << "s = " << igl::mlgetscalar("s") << endl;
+
+    //// If the program closes the matlab session is killed too..
+    //getchar();
     
     return 0;
 }

+ 18 - 0
examples/Makefile

@@ -0,0 +1,18 @@
+.PHONY: all
+
+DIRS=$(wildcard */)
+
+all: $(DIRS) 
+	for p in  $(DIRS); \
+	do \
+	echo "cd $$p" ; \
+	$(MAKE) -C $$p; \
+	done
+	
+clean: $(DIRS) 
+	for p in  $(DIRS); \
+	do \
+	echo "cd $$p" ; \
+	$(MAKE) -C $$p clean; \
+	done
+	#$(MAKE) -C $$p || exit $$?; \#$(MAKE) -C $$p || exit $$?; \

+ 3 - 3
examples/ReAntTweakBar/Makefile

@@ -5,10 +5,10 @@ all: example
 
 .PHONY: example
 
-igl_lib=-I../../
+igl_lib=../../
 
-lib=-lAntTweakBar -framework AppKit
-inc=$(igl_lib)
+lib=-lAntTweakBar -framework AppKit -L$(igl_lib) -ligl
+inc=-I$(igl_lib)
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o -framework OpenGL -framework GLUT $(lib)

+ 1 - 1
examples/affine/Makefile

@@ -10,7 +10,7 @@ eigen=/usr/local/include/eigen3
 
 CFLAGS=-g
 inc=-I$(igl_lib) -I$(eigen)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/cat/Makefile

@@ -10,7 +10,7 @@ eigen=/usr/local/include/eigen3/
 
 CFLAGS=-g
 inc=-I$(igl_lib) -I$(eigen)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/dmat/Makefile

@@ -10,7 +10,7 @@ eigen=/usr/local/include/eigen3
 
 CFLAGS=-g
 inc=-I$(igl_lib) -I$(eigen)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 3 - 3
examples/eigen-gotchas/Makefile

@@ -5,12 +5,12 @@ all: example
 
 .PHONY: example
 
-igl_lib=-I../../
+igl_lib=../../
 eigen=-I/usr/local/include/eigen3 -I/usr/local/include/eigen3/unsupported
 
 CFLAGS=-g
-inc=$(igl_lib) $(eigen)
-lib=
+inc=-I$(igl_lib) $(eigen)
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 0 - 1
examples/example_fun/Makefile

@@ -6,7 +6,6 @@ igl_lib=../../
 
 CFLAGS=-g
 inc=-I$(igl_lib)
-lib=
 
 STATIC_LIB=-ligl -L../../
 HEADER_ONLY_DEF=-DIGL_HEADER_ONLY

+ 1 - 1
examples/file_contents_as_string/Makefile

@@ -9,7 +9,7 @@ igl_lib=../../
 
 CFLAGS=-g
 inc=-I$(igl_lib)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/get_seconds/Makefile

@@ -9,7 +9,7 @@ igl_lib=../../
 
 CFLAGS=-g -Wall
 inc=-I$(igl_lib)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/glslversion/Makefile

@@ -9,7 +9,7 @@ igl_lib=../../
 
 CFLAGS=-g
 inc=-I$(igl_lib)
-lib=-framework OpenGL -framework GLUT
+lib=-framework OpenGL -framework GLUT -L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 0
examples/glut_speed_test/Makefile

@@ -9,6 +9,7 @@ igl_lib=../../
 
 CFLAGS=-g -Wall 
 inc=-I$(igl_lib)
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o -framework OpenGL -framework GLUT $(lib)

+ 1 - 1
examples/is_dir/Makefile

@@ -9,7 +9,7 @@ igl_lib=../../
 
 CFLAGS=-g
 inc=-I$(igl_lib)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 3 - 3
examples/meshio/Makefile

@@ -5,12 +5,12 @@ all: example
 
 .PHONY: example
 
-igl_lib=-I../../
+igl_lib=../../
 eigen=-I/usr/local/include/eigen3
 
 CFLAGS=-g
-inc=$(igl_lib) $(eigen)
-lib=
+inc=-I$(igl_lib) $(eigen)
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/mode/Makefile

@@ -10,7 +10,7 @@ eigen=/usr/local/include/eigen3/
 
 CFLAGS=-g
 inc=-I$(igl_lib) -I$(eigen)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/path_tests/Makefile

@@ -9,7 +9,7 @@ igl_lib=../../
 
 CFLAGS=-g
 inc=-I$(igl_lib)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 0
examples/pathinfo/Makefile

@@ -9,6 +9,7 @@ igl_lib=../../
 
 CFLAGS=-g -Wall 
 inc=-I$(igl_lib)
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib) 

+ 3 - 3
examples/slice/Makefile

@@ -5,13 +5,13 @@ all: example
 
 .PHONY: example
 
-igl_lib=-I../../
+igl_lib=../../
 eigen=-I/usr/local/include/eigen3 -I/usr/local/include/eigen3/unsupported
 
 #CFLAGS=-g
 CFLAGS=-Os -DNDEBUG
-inc=$(igl_lib) $(eigen)
-lib=
+inc=-I$(igl_lib) $(eigen)
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/sort/Makefile

@@ -10,7 +10,7 @@ eigen=/usr/local/include/eigen3/
 
 CFLAGS=-g
 inc=-I$(igl_lib) -I$(eigen)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/stdin_to_temp/Makefile

@@ -9,7 +9,7 @@ igl_lib=../../
 
 CFLAGS=-g
 inc=-I$(igl_lib)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/stdin_to_temp/example.cpp

@@ -34,7 +34,7 @@ int main(int argc,char * argv[])
     fprintf(stderr,"Fatal Error: could not convert stdin to temp file\n");
     // try to close temp file
     fclose(temp_file);
-    exit(1);
+    return 1;
   }
 
   // Do something interesting with the temporary file. 

+ 1 - 0
examples/trackball/Makefile

@@ -10,6 +10,7 @@ igl_lib=../../
 CFLAGS=-g -Wall 
 #deps=-MMD -MF depends.txt
 inc=-I$(igl_lib)
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o -framework OpenGL -framework GLUT $(lib)

+ 3 - 2
examples/trackball/example.cpp

@@ -16,6 +16,7 @@ using namespace igl;
 #include <stdlib.h>
 #include <cstdio>
 #include <cmath>
+#include <algorithm>
 using namespace std;
 
 #if defined(_WIN32) || defined(_WIN64)
@@ -50,7 +51,7 @@ const float g_LightDirection[] = { -0.57735f, -0.57735f, -0.57735f };
 int down_mouse_x, down_mouse_y;
 // keep track of size
 int width, height;
-double speed_factor = 1;
+float speed_factor = 1;
 
 void mouse(int glutButton, int glutState, int mouse_x, int mouse_y)
 {
@@ -162,7 +163,7 @@ int main(int argc, char *argv[])
       help_and_quit = true;
     }else
     {
-      int count = sscanf(argv[1],"%lg",&speed_factor);
+      int count = sscanf(argv[1],"%g",&speed_factor);
       if(count != 1)
       {
         printf("Error: %s is not a valid speed factor.",

+ 1 - 1
examples/transpose_blocks/Makefile

@@ -10,7 +10,7 @@ eigen=/usr/local/include/eigen3
 
 CFLAGS=-g
 inc=-I$(igl_lib) -I$(eigen)
-lib=
+lib=-L$(igl_lib) -ligl
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 2 - 0
find.cpp

@@ -51,4 +51,6 @@ IGL_INLINE void igl::find(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::find<double>(Eigen::SparseMatrix<double, 0, int> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1>&, Eigen::Matrix<int, -1, 1, 0, -1, 1>&, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
 #endif

+ 2 - 0
full.cpp

@@ -19,4 +19,6 @@ IGL_INLINE void igl::full(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::full<double>(Eigen::SparseMatrix<double, 0, int> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&);
 #endif

+ 2 - 0
is_manifold.cpp

@@ -37,4 +37,6 @@ IGL_INLINE bool igl::is_manifold(const Eigen::Matrix<T, Eigen::Dynamic, Eigen::D
 
 #ifndef IGL_HEADER_ONLY
 // 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&);
 #endif

+ 2 - 0
is_symmetric.cpp

@@ -18,4 +18,6 @@ IGL_INLINE bool igl::is_symmetric(const Eigen::SparseMatrix<T>& A)
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::is_symmetric<double>(Eigen::SparseMatrix<double, 0, int> const&);
 #endif

+ 14 - 0
list_to_matrix.cpp

@@ -3,6 +3,8 @@
 #include <cassert>
 #include <cstdio>
 
+#include <Eigen/Dense>
+
 #include "max_size.h"
 #include "min_size.h"
 #define VERBOSE
@@ -45,4 +47,16 @@ IGL_INLINE bool igl::list_to_matrix(const std::vector<std::vector<T > > & V,Mat
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<int, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<int, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
 #endif

+ 2 - 0
mat_min.cpp

@@ -37,4 +37,6 @@ IGL_INLINE void igl::mat_min(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::mat_min<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, int, Eigen::Matrix<double, -1, 1, 0, -1, 1>&, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
 #endif

+ 4 - 0
max_size.cpp

@@ -19,4 +19,8 @@ IGL_INLINE int igl::max_size(const std::vector<T> & V)
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template int igl::max_size<std::vector<int, std::allocator<int> > >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&);
+// generated by autoexplicit.sh
+template int igl::max_size<std::vector<double, std::allocator<double> > >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&);
 #endif

+ 1 - 0
min_quad_dense.cpp

@@ -81,4 +81,5 @@ IGL_INLINE void igl::min_quad_dense_precompute(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+  template void igl::min_quad_dense_precompute<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&);
 #endif

+ 4 - 0
min_size.cpp

@@ -25,4 +25,8 @@ IGL_INLINE int igl::min_size(const std::vector<T> & V)
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template int igl::min_size<std::vector<int, std::allocator<int> > >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&);
+// generated by autoexplicit.sh
+template int igl::min_size<std::vector<double, std::allocator<double> > >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&);
 #endif

+ 4 - 0
mode.cpp

@@ -48,4 +48,8 @@ IGL_INLINE void igl::mode(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::mode<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, int, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
+// generated by autoexplicit.sh
+template void igl::mode<int>(Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, int, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
 #endif

+ 5 - 0
normalize_quat.cpp

@@ -1,6 +1,7 @@
 #include "normalize_quat.h"
 
 #include "EPS.h"
+#include <cmath>
 
 template <typename Q_type>
 IGL_INLINE bool igl::normalize_quat(
@@ -26,4 +27,8 @@ IGL_INLINE bool igl::normalize_quat(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::normalize_quat<double>(double const*, double*);
+// generated by autoexplicit.sh
+template bool igl::normalize_quat<float>(float const*, float*);
 #endif

+ 5 - 0
normalize_rows.cpp

@@ -14,3 +14,8 @@ IGL_INLINE void igl::normalize_rows(
     B.row(i) = A.row(i).normalized();
   }
 }
+#ifndef IGL_HEADER_ONLY
+// Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::normalize_rows<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+#endif

+ 5 - 0
per_corner_normals.cpp

@@ -72,3 +72,8 @@ IGL_INLINE void igl::per_corner_normals(
     }
   }
 }
+#ifndef IGL_HEADER_ONLY
+// Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::per_corner_normals<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&, double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+#endif

+ 9 - 3
per_face_normals.cpp

@@ -1,10 +1,11 @@
 #include "per_face_normals.h"
+#include <Eigen/Geometry>
 
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::per_face_normals(
-                                 const Eigen::PlainObjectBase<DerivedV>& V,
-                                 const Eigen::PlainObjectBase<DerivedF>& F,
-                                 Eigen::PlainObjectBase<DerivedV> & N)
+  const Eigen::PlainObjectBase<DerivedV>& V,
+  const Eigen::PlainObjectBase<DerivedF>& F,
+  Eigen::PlainObjectBase<DerivedV> & N)
 {
   N.resize(F.rows(),3);
   // loop over faces
@@ -15,3 +16,8 @@ IGL_INLINE void igl::per_face_normals(
     N.row(i) = (v1.cross(v2)).normalized();
   }
 }
+#ifndef IGL_HEADER_ONLY
+// Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::per_face_normals<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&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+#endif

+ 6 - 1
per_vertex_normals.cpp

@@ -49,4 +49,9 @@ IGL_INLINE void igl::per_vertex_normals(
   }
   // normalize each row
   igl::normalize_rows(N,N);
-}
+}
+#ifndef IGL_HEADER_ONLY
+// Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::per_vertex_normals<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&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+#endif

+ 2 - 0
print_ijv.cpp

@@ -28,4 +28,6 @@ IGL_INLINE void igl::print_ijv(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::print_ijv<double>(Eigen::SparseMatrix<double, 0, int> const&, int);
 #endif

+ 2 - 0
quat_conjugate.cpp

@@ -13,4 +13,6 @@ IGL_INLINE void igl::quat_conjugate(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::quat_conjugate<float>(float const*, float*);
 #endif

+ 4 - 0
quat_mult.cpp

@@ -20,4 +20,8 @@ IGL_INLINE void igl::quat_mult(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::quat_mult<double>(double const*, double const*, double*);
+// generated by autoexplicit.sh
+template void igl::quat_mult<float>(float const*, float const*, float*);
 #endif

+ 2 - 0
quat_to_mat.cpp

@@ -30,4 +30,6 @@ IGL_INLINE void igl::quat_to_mat(const Q_type * quat, Q_type * mat)
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::quat_to_mat<float>(float const*, float*);
 #endif

+ 4 - 1
read.cpp

@@ -29,4 +29,7 @@ IGL_INLINE bool igl::read(
 }
 
 #ifndef IGL_HEADER_ONLY
-#endif
+// Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::read<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+#endif

+ 2 - 0
readMESH.cpp

@@ -283,4 +283,6 @@ IGL_INLINE bool igl::readMESH(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::readMESH<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 #endif

+ 3 - 1
readOBJ.cpp

@@ -281,7 +281,7 @@ IGL_INLINE bool igl::readOBJ(
   return true;
 }
 
-template <typename DerivedV, typename DerivedF, typename DerivedT>
+template <typename DerivedV, typename DerivedF>
 IGL_INLINE bool igl::readOBJ(
                              const std::string str,
                              Eigen::PlainObjectBase<DerivedV>& V,
@@ -323,4 +323,6 @@ IGL_INLINE bool igl::readOBJ(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 #endif

+ 1 - 1
readOBJ.h

@@ -79,7 +79,7 @@ namespace igl
   //
   // KNOWN BUG: This only knows how to face lines without normal or texture
   // indices. It will probably crash or give garbage on anything else.
-  template <typename DerivedV, typename DerivedF, typename DerivedT>
+  template <typename DerivedV, typename DerivedF>
   IGL_INLINE bool readOBJ(
                           const std::string str,
                           Eigen::PlainObjectBase<DerivedV>& V,

+ 5 - 0
readOFF.cpp

@@ -136,3 +136,8 @@ IGL_INLINE bool igl::readOFF(
   }
   return true;
 }
+#ifndef IGL_HEADER_ONLY
+// Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::readOFF<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+#endif

+ 2 - 0
reorder.cpp

@@ -19,4 +19,6 @@ IGL_INLINE void igl::reorder(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::reorder<double>(std::vector<double, std::allocator<double> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<double, std::allocator<double> >&);
 #endif

+ 4 - 0
repdiag.cpp

@@ -61,4 +61,8 @@ IGL_INLINE Mat igl::repdiag(const Mat & A, const int d)
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::repdiag<double>(Eigen::SparseMatrix<double, 0, int> const&, int, Eigen::SparseMatrix<double, 0, int>&);
+// generated by autoexplicit.sh
+template Eigen::SparseMatrix<double, 0, int> igl::repdiag<Eigen::SparseMatrix<double, 0, int> >(Eigen::SparseMatrix<double, 0, int> const&, int);
 #endif

+ 5 - 3
repmat.cpp

@@ -1,11 +1,11 @@
 #include "repmat.h"
 
-template <typename T,const int W, const int H>
+template <typename DerivedA>
 IGL_INLINE void igl::repmat(
-  const Eigen::Matrix<T,W,H> & A,
+  const Eigen::PlainObjectBase<DerivedA> & A,
   const int r,
   const int c,
-  Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> & B)
+  Eigen::PlainObjectBase<DerivedA> & B)
 {
   assert(r>0);
   assert(c>0);
@@ -53,4 +53,6 @@ IGL_INLINE void igl::repmat(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::repmat<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif

+ 3 - 3
repmat.h

@@ -22,12 +22,12 @@ namespace igl
   // Outputs:
   //   B  r*m by c*n output matrix
   //
-  template <typename T,const int W, const int H>
+  template <typename DerivedA>
   IGL_INLINE void repmat(
-    const Eigen::Matrix<T,W,H> & A,
+    const Eigen::PlainObjectBase<DerivedA> & A,
     const int r,
     const int c,
-    Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> & B);
+    Eigen::PlainObjectBase<DerivedA> & B);
   template <typename T>
   IGL_INLINE void repmat(
     const Eigen::SparseMatrix<T> & A,

+ 2 - 0
rotate_by_quat.cpp

@@ -35,4 +35,6 @@ IGL_INLINE void igl::rotate_by_quat(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::rotate_by_quat<float>(float const*, float const*, float*);
 #endif

+ 16 - 6
slice.cpp

@@ -64,12 +64,12 @@ IGL_INLINE void igl::slice(
   Y = Eigen::SparseMatrix<T>(dyn_Y);
 }
 
-template <typename T, const int W, const int H>
+template <typename DerivedX>
 IGL_INLINE void igl::slice(
-  const Eigen::Matrix<T,W,H> & X,
+  const Eigen::PlainObjectBase<DerivedX> & X,
   const Eigen::Matrix<int,Eigen::Dynamic,1> & R,
   const Eigen::Matrix<int,Eigen::Dynamic,1> & C,
-  Eigen::Matrix<T,W,H> & Y)
+  Eigen::PlainObjectBase<DerivedX> & Y)
 {
   int xm = X.rows();
   int xn = X.cols();
@@ -100,11 +100,11 @@ IGL_INLINE void igl::slice(
   }
 }
 
-template <typename T>
+template <typename DerivedX>
 IGL_INLINE void igl::slice(
-  const Eigen::Matrix<T,Eigen::Dynamic,1> & X,
+  const Eigen::PlainObjectBase<DerivedX> & X,
   const Eigen::Matrix<int,Eigen::Dynamic,1> & R,
-  Eigen::Matrix<T,Eigen::Dynamic,1> & Y)
+  Eigen::PlainObjectBase<DerivedX> & Y)
 {
   // phony column indices
   Eigen::Matrix<int,Eigen::Dynamic,1> C;
@@ -115,4 +115,14 @@ IGL_INLINE void igl::slice(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::slice<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+// generated by autoexplicit.sh
+template void igl::slice<Eigen::Matrix<float, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&);
+// generated by autoexplicit.sh
+template void igl::slice<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+// generated by autoexplicit.sh
+template void igl::slice<Eigen::Matrix<float, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
+// generated by autoexplicit.sh
+template void igl::slice<double>(Eigen::SparseMatrix<double, 0, int> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::SparseMatrix<double, 0, int>&);
 #endif

+ 6 - 6
slice.h

@@ -22,18 +22,18 @@ namespace igl
     const Eigen::Matrix<int,Eigen::Dynamic,1> & C,
     Eigen::SparseMatrix<T>& Y);
 
-  template <typename T, const int W, const int H>
+  template <typename DerivedX>
   IGL_INLINE void slice(
-    const Eigen::Matrix<T,W,H> & X,
+    const Eigen::PlainObjectBase<DerivedX> & X,
     const Eigen::Matrix<int,Eigen::Dynamic,1> & R,
     const Eigen::Matrix<int,Eigen::Dynamic,1> & C,
-    Eigen::Matrix<T,W,H> & Y);
+    Eigen::PlainObjectBase<DerivedX> & Y);
 
-  template <typename T>
+  template <typename DerivedX>
   IGL_INLINE void slice(
-    const Eigen::Matrix<T,Eigen::Dynamic,1> & X,
+    const Eigen::PlainObjectBase<DerivedX> & X,
     const Eigen::Matrix<int,Eigen::Dynamic,1> & R,
-    Eigen::Matrix<T,Eigen::Dynamic,1> & Y);
+    Eigen::PlainObjectBase<DerivedX> & Y);
 }
 
 #ifdef IGL_HEADER_ONLY

+ 8 - 6
slice_into.cpp

@@ -32,12 +32,12 @@ IGL_INLINE void igl::slice_into(
   Y = Eigen::SparseMatrix<T>(dyn_Y);
 }
 
-template <typename T, const int W, const int H>
+template <typename DerivedX>
 IGL_INLINE void igl::slice_into(
-  const Eigen::Matrix<T,W,H> & X,
+  const Eigen::PlainObjectBase<DerivedX> & X,
   const Eigen::Matrix<int,Eigen::Dynamic,1> & R,
   const Eigen::Matrix<int,Eigen::Dynamic,1> & C,
-  Eigen::Matrix<T,W,H> & Y)
+  Eigen::PlainObjectBase<DerivedX> & Y)
 {
 
   int xm = X.rows();
@@ -63,11 +63,11 @@ IGL_INLINE void igl::slice_into(
   }
 }
 
-template <typename T>
+template <typename DerivedX>
 IGL_INLINE void igl::slice_into(
-  const Eigen::Matrix<T,Eigen::Dynamic,1> & X,
+  const Eigen::PlainObjectBase<DerivedX> & X,
   const Eigen::Matrix<int,Eigen::Dynamic,1> & R,
-  Eigen::Matrix<T,Eigen::Dynamic,1> & Y)
+  Eigen::PlainObjectBase<DerivedX> & Y)
 {
   // phony column indices
   Eigen::Matrix<int,Eigen::Dynamic,1> C;
@@ -78,4 +78,6 @@ IGL_INLINE void igl::slice_into(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::slice_into<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif

+ 6 - 6
slice_into.h

@@ -23,18 +23,18 @@ namespace igl
     const Eigen::Matrix<int,Eigen::Dynamic,1> & C,
     Eigen::SparseMatrix<T>& Y);
 
-  template <typename T, const int W, const int H>
+  template <typename DerivedX>
   IGL_INLINE void slice_into(
-    const Eigen::Matrix<T,W,H> & X,
+    const Eigen::PlainObjectBase<DerivedX> & X,
     const Eigen::Matrix<int,Eigen::Dynamic,1> & R,
     const Eigen::Matrix<int,Eigen::Dynamic,1> & C,
-    Eigen::Matrix<T,W,H> & Y);
+    Eigen::PlainObjectBase<DerivedX> & Y);
 
-  template <typename T>
+  template <typename DerivedX>
   IGL_INLINE void slice_into(
-    const Eigen::Matrix<T,Eigen::Dynamic,1> & X,
+    const Eigen::PlainObjectBase<DerivedX> & X,
     const Eigen::Matrix<int,Eigen::Dynamic,1> & R,
-    Eigen::Matrix<T,Eigen::Dynamic,1> & Y);
+    Eigen::PlainObjectBase<DerivedX> & Y);
 }
 
 #ifdef IGL_HEADER_ONLY

+ 4 - 0
snap_to_canonical_view_quat.cpp

@@ -90,4 +90,8 @@ IGL_INLINE bool igl::snap_to_canonical_view_quat(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::snap_to_canonical_view_quat<double>(double const*, double, double*);
+// generated by autoexplicit.sh
+template bool igl::snap_to_canonical_view_quat<float>(float const*, float, float*);
 #endif

+ 2 - 0
sort.cpp

@@ -105,4 +105,6 @@ IGL_INLINE void igl::sort(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::sort<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, int, bool, Eigen::Matrix<double, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
 #endif

+ 2 - 0
speye.cpp

@@ -22,4 +22,6 @@ IGL_INLINE void igl::speye(const int n, Eigen::SparseMatrix<T> & I)
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::speye<double>(int, Eigen::SparseMatrix<double, 0, int>&);
 #endif

+ 1 - 0
todos.txt

@@ -7,3 +7,4 @@
 - clean up edgetopology.h
 - clean up mvc.h
 - clean up orth.h
+- fix bugs in examples/Core/example2.cpp

+ 3 - 0
trackball.cpp

@@ -7,6 +7,7 @@
 #include "quat_mult.h"
 #include <cmath>
 #include <cstdlib>
+#include <cassert>
 #include <algorithm>
 
 // Utility IGL_INLINE functions
@@ -100,4 +101,6 @@ IGL_INLINE void igl::trackball(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::trackball<float>(int, int, float, float const*, int, int, int, int, float*);
 #endif

+ 2 - 0
transpose_blocks.cpp

@@ -51,4 +51,6 @@ IGL_INLINE void igl::transpose_blocks(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::transpose_blocks<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, unsigned long, unsigned long, Eigen::Matrix<double, -1, -1, 0, -1, -1>&);
 #endif

+ 2 - 0
tt.cpp

@@ -80,4 +80,6 @@ IGL_INLINE void igl::tt(const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>&
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::tt<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
 #endif

+ 2 - 0
vf.cpp

@@ -27,4 +27,6 @@ IGL_INLINE void igl::vf(
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::vf<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, int>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&);
 #endif

+ 6 - 0
write.cpp

@@ -21,3 +21,9 @@ IGL_INLINE bool igl::write(
   if (!strcmp(p, ".off") || !strcmp(p, ".OFF"))
     return igl::writeOFF(str,V,F);
 }
+
+#ifndef IGL_HEADER_ONLY
+// Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::write<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
+#endif

+ 3 - 0
writeDMAT.cpp

@@ -1,6 +1,7 @@
 #include "writeDMAT.h"
 
 #include <cstdio>
+#include <Eigen/Dense>
 
   template <class Mat>
 IGL_INLINE bool igl::writeDMAT(const std::string file_name, const Mat & W)
@@ -28,4 +29,6 @@ IGL_INLINE bool igl::writeDMAT(const std::string file_name, const Mat & W)
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::writeDMAT<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&);
 #endif

+ 5 - 0
writeOBJ.cpp

@@ -102,3 +102,8 @@ IGL_INLINE bool igl::writeOBJ(
   fclose(obj_file);
   return true;  
 }
+#ifndef IGL_HEADER_ONLY
+// Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::writeOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
+#endif

+ 5 - 0
writeOFF.cpp

@@ -27,3 +27,8 @@ IGL_INLINE bool igl::writeOFF(
     fclose (fp);
     return true;
 }
+#ifndef IGL_HEADER_ONLY
+// Explicit template specialization
+// generated by autoexplicit.sh
+template bool igl::writeOFF<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
+#endif