Browse Source

Merge pull request #1228 from skoch9/python

Python
Francis Williams 6 years ago
parent
commit
c2a4fdc912
100 changed files with 683 additions and 656 deletions
  1. 0 5
      .appveyor.yml
  2. 6 15
      .travis.yml
  3. 6 7
      CMakeLists.txt
  4. 1 1
      cmake/LibiglDownloadExternal.cmake
  5. 7 8
      cmake/libigl.cmake
  6. 6 0
      include/igl/AABB.cpp
  7. 7 6
      include/igl/MappingEnergyType.h
  8. 1 1
      include/igl/active_set.cpp
  9. 14 14
      include/igl/ambient_occlusion.cpp
  10. 10 10
      include/igl/ambient_occlusion.h
  11. 15 9
      include/igl/arap_linear_block.cpp
  12. 8 8
      include/igl/arap_linear_block.h
  13. 18 12
      include/igl/arap_rhs.cpp
  14. 10 9
      include/igl/arap_rhs.h
  15. 2 2
      include/igl/average_onto_vertices.cpp
  16. 9 9
      include/igl/average_onto_vertices.h
  17. 2 0
      include/igl/barycenter.cpp
  18. 2 2
      include/igl/bfs.cpp
  19. 1 1
      include/igl/bfs.h
  20. 7 7
      include/igl/bfs_orient.cpp
  21. 2 2
      include/igl/bfs_orient.h
  22. 31 27
      include/igl/biharmonic_coordinates.cpp
  23. 4 4
      include/igl/biharmonic_coordinates.h
  24. 8 8
      include/igl/bijective_composite_harmonic_mapping.cpp
  25. 2 2
      include/igl/bone_parents.cpp
  26. 1 1
      include/igl/bone_parents.h
  27. 2 2
      include/igl/boundary_loop.cpp
  28. 0 1
      include/igl/bounding_box_diagonal.h
  29. 6 2
      include/igl/circumradius.cpp
  30. 3 3
      include/igl/circumradius.h
  31. 20 19
      include/igl/colon.cpp
  32. 14 14
      include/igl/comb_cross_field.cpp
  33. 4 4
      include/igl/comb_cross_field.h
  34. 8 8
      include/igl/comb_frame_field.cpp
  35. 6 6
      include/igl/comb_frame_field.h
  36. 9 9
      include/igl/comb_line_field.cpp
  37. 3 6
      include/igl/comb_line_field.h
  38. 13 13
      include/igl/compute_frame_field_bisectors.cpp
  39. 10 10
      include/igl/compute_frame_field_bisectors.h
  40. 5 5
      include/igl/connect_boundary_to_infinity.cpp
  41. 4 4
      include/igl/connect_boundary_to_infinity.h
  42. 13 13
      include/igl/copyleft/tetgen/tetrahedralize.cpp
  43. 10 10
      include/igl/copyleft/tetgen/tetrahedralize.h
  44. 26 24
      include/igl/cross.cpp
  45. 15 15
      include/igl/cross_field_mismatch.cpp
  46. 4 4
      include/igl/cross_field_mismatch.h
  47. 11 11
      include/igl/crouzeix_raviart_cotmatrix.cpp
  48. 4 4
      include/igl/crouzeix_raviart_massmatrix.cpp
  49. 3 3
      include/igl/cut_mesh.cpp
  50. 16 16
      include/igl/cut_mesh_from_singularities.cpp
  51. 3 3
      include/igl/cut_mesh_from_singularities.h
  52. 6 6
      include/igl/dihedral_angles.cpp
  53. 4 4
      include/igl/dihedral_angles.h
  54. 8 6
      include/igl/directed_edge_parents.cpp
  55. 1 1
      include/igl/directed_edge_parents.h
  56. 6 6
      include/igl/ears.cpp
  57. 20 20
      include/igl/edge_topology.cpp
  58. 6 6
      include/igl/edge_topology.h
  59. 3 3
      include/igl/euler_characteristic.cpp
  60. 2 2
      include/igl/euler_characteristic.h
  61. 4 4
      include/igl/exact_geodesic.cpp
  62. 2 2
      include/igl/facet_components.cpp
  63. 1 1
      include/igl/facet_components.h
  64. 4 4
      include/igl/gaussian_curvature.cpp
  65. 2 2
      include/igl/gaussian_curvature.h
  66. 13 12
      include/igl/harmonic.cpp
  67. 6 6
      include/igl/harmonic.h
  68. 13 13
      include/igl/hausdorff.cpp
  69. 13 13
      include/igl/hausdorff.h
  70. 6 6
      include/igl/in_element.cpp
  71. 4 4
      include/igl/in_element.h
  72. 14 10
      include/igl/invert_diag.cpp
  73. 3 3
      include/igl/invert_diag.h
  74. 1 1
      include/igl/is_border_vertex.cpp
  75. 0 1
      include/igl/is_edge_manifold.h
  76. 3 3
      include/igl/is_irregular_vertex.cpp
  77. 1 1
      include/igl/is_irregular_vertex.h
  78. 4 4
      include/igl/isdiag.cpp
  79. 2 2
      include/igl/isdiag.h
  80. 10 10
      include/igl/isolines.cpp
  81. 4 4
      include/igl/local_basis.cpp
  82. 2 2
      include/igl/local_basis.h
  83. 28 28
      include/igl/loop.cpp
  84. 4 4
      include/igl/loop.h
  85. 2 2
      include/igl/massmatrix.cpp
  86. 2 2
      include/igl/massmatrix_intrinsic.cpp
  87. 2 2
      include/igl/mat_min.cpp
  88. 17 19
      include/igl/matrix_to_list.cpp
  89. 3 3
      include/igl/matrix_to_list.h
  90. 5 2
      include/igl/min_quad_with_fixed.cpp
  91. 5 5
      include/igl/orientable_patches.cpp
  92. 2 2
      include/igl/orientable_patches.h
  93. 4 4
      include/igl/per_edge_normals.cpp
  94. 3 3
      include/igl/per_vertex_attribute_smoothing.cpp
  95. 2 2
      include/igl/per_vertex_attribute_smoothing.h
  96. 9 9
      include/igl/planarize_quad_mesh.cpp
  97. 2 2
      include/igl/planarize_quad_mesh.h
  98. 12 8
      include/igl/point_mesh_squared_distance.cpp
  99. 13 12
      include/igl/point_mesh_squared_distance.h
  100. 8 6
      include/igl/point_simplex_squared_distance.cpp

+ 0 - 5
.appveyor.yml

@@ -11,18 +11,13 @@ environment:
   matrix:
   matrix:
   - CONFIG: Debug
   - CONFIG: Debug
     BOOST_ROOT: C:/Libraries/boost_1_65_1
     BOOST_ROOT: C:/Libraries/boost_1_65_1
-    PYTHON: 37
   - CONFIG: Release
   - CONFIG: Release
     BOOST_ROOT: C:/Libraries/boost_1_65_1
     BOOST_ROOT: C:/Libraries/boost_1_65_1
-    PYTHON: 37
-install:
-  - cinstall: python
 build:
 build:
   parallel: true
   parallel: true
 build_script:
 build_script:
   - cd c:\projects\libigl
   - cd c:\projects\libigl
   # Tutorials and tests
   # Tutorials and tests
-  - set PATH=C:\Python%PYTHON%-x64;C:\Python%PYTHON%-x64\Scripts;%PATH%
   - mkdir build
   - mkdir build
   - cd build
   - cd build
   - cmake -DCMAKE_BUILD_TYPE=%CONFIG%
   - cmake -DCMAKE_BUILD_TYPE=%CONFIG%

+ 6 - 15
.travis.yml

@@ -16,8 +16,6 @@ addons:
     - libglu1-mesa-dev
     - libglu1-mesa-dev
     - liblapack-dev
     - liblapack-dev
     - libmpfr-dev
     - libmpfr-dev
-    - libpython3-dev
-    - python3-setuptools
     - xorg-dev
     - xorg-dev
   homebrew:
   homebrew:
     packages:
     packages:
@@ -27,29 +25,25 @@ matrix:
   - os: linux
   - os: linux
     compiler: gcc # 4.8.4 by default on Trusty
     compiler: gcc # 4.8.4 by default on Trusty
     env:
     env:
-    - MATRIX_EVAL="export CONFIG=Release PYTHON=python3"
+    - MATRIX_EVAL="export CONFIG=Release"
   - os: linux
   - os: linux
     compiler: gcc-7
     compiler: gcc-7
     env:
     env:
-    - MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release PYTHON=python3"
+    - MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release"
   - os: linux # same config like above but with -DLIBIGL_USE_STATIC_LIBRARY=OFF to test static and header-only builds
   - os: linux # same config like above but with -DLIBIGL_USE_STATIC_LIBRARY=OFF to test static and header-only builds
     compiler: gcc-7
     compiler: gcc-7
     env:
     env:
-    - MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release PYTHON=python3 CMAKE_EXTRA='-DLIBIGL_USE_STATIC_LIBRARY=OFF'"
-  - os: linux
-    compiler: gcc-7
-    env:
-    - MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release PYTHON=python3 CMAKE_EXTRA='-DLIBIGL_EIGEN_VERSION=3.3.7'"
+    - MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release CMAKE_EXTRA='-DLIBIGL_USE_STATIC_LIBRARY=OFF'"
   - os: osx
   - os: osx
     osx_image: xcode10.2
     osx_image: xcode10.2
     compiler: clang
     compiler: clang
     env:
     env:
-    - MATRIX_EVAL="export CONFIG=Debug PYTHON=python3 LIBIGL_NUM_THREADS=1"
+    - MATRIX_EVAL="export CONFIG=Debug LIBIGL_NUM_THREADS=1"
   - os: osx # same config like above but with -DLIBIGL_USE_STATIC_LIBRARY=OFF to test static and header-only builds
   - os: osx # same config like above but with -DLIBIGL_USE_STATIC_LIBRARY=OFF to test static and header-only builds
     osx_image: xcode10.2
     osx_image: xcode10.2
     compiler: clang
     compiler: clang
     env:
     env:
-    - MATRIX_EVAL="export CONFIG=Debug PYTHON=python3 LIBIGL_NUM_THREADS=1 CMAKE_EXTRA='-DLIBIGL_USE_STATIC_LIBRARY=OFF'"
+    - MATRIX_EVAL="export CONFIG=Debug LIBIGL_NUM_THREADS=1 CMAKE_EXTRA='-DLIBIGL_USE_STATIC_LIBRARY=OFF'"
   - os: osx
   - os: osx
     osx_image: xcode10.2
     osx_image: xcode10.2
     compiler: clang
     compiler: clang
@@ -74,8 +68,5 @@ script:
 - make -j 2
 - make -j 2
 - ctest --verbose
 - ctest --verbose
 - popd
 - popd
-- pushd python/tutorial
-- ${PYTHON} 101_FileIO.py
-- popd
 - rm -rf build
 - rm -rf build
-- ccache --show-stats
+- ccache --show-stats

+ 6 - 7
CMakeLists.txt

@@ -19,10 +19,9 @@ else()
 	set(LIBIGL_TOPLEVEL_PROJECT OFF)
 	set(LIBIGL_TOPLEVEL_PROJECT OFF)
 endif()
 endif()
 
 
-# Build tests, tutorials and python bindings
+# Build tests and tutorials
 option(LIBIGL_BUILD_TESTS      "Build libigl unit test"        ${LIBIGL_TOPLEVEL_PROJECT})
 option(LIBIGL_BUILD_TESTS      "Build libigl unit test"        ${LIBIGL_TOPLEVEL_PROJECT})
 option(LIBIGL_BUILD_TUTORIALS  "Build libigl tutorial"         ${LIBIGL_TOPLEVEL_PROJECT})
 option(LIBIGL_BUILD_TUTORIALS  "Build libigl tutorial"         ${LIBIGL_TOPLEVEL_PROJECT})
-option(LIBIGL_BUILD_PYTHON     "Build libigl python bindings"  ${LIBIGL_TOPLEVEL_PROJECT})
 option(LIBIGL_EXPORT_TARGETS   "Export libigl CMake targets"   ${LIBIGL_TOPLEVEL_PROJECT})
 option(LIBIGL_EXPORT_TARGETS   "Export libigl CMake targets"   ${LIBIGL_TOPLEVEL_PROJECT})
 
 
 # USE_STATIC_LIBRARY speeds up the generation of multiple binaries,
 # USE_STATIC_LIBRARY speeds up the generation of multiple binaries,
@@ -42,9 +41,13 @@ option(LIBIGL_WITH_TETGEN            "Use Tetgen"                   ON)
 option(LIBIGL_WITH_TRIANGLE          "Use Triangle"                 ON)
 option(LIBIGL_WITH_TRIANGLE          "Use Triangle"                 ON)
 option(LIBIGL_WITH_PREDICATES        "Use exact predicates"         ON)
 option(LIBIGL_WITH_PREDICATES        "Use exact predicates"         ON)
 option(LIBIGL_WITH_XML               "Use XML"                      ON)
 option(LIBIGL_WITH_XML               "Use XML"                      ON)
-option(LIBIGL_WITH_PYTHON            "Use Python"                   ${LIBIGL_BUILD_PYTHON})
+option(LIBIGL_WITH_PYTHON            "Use Python"                   OFF)
 ### End
 ### End
 
 
+if(${LIBIGL_WITH_PYTHON})
+	MESSAGE(FATAL_ERROR "Python binding are in the process of being redone. Please use the master branch or refer to https://github.com/geometryprocessing/libigl-python-bindings for the developement version or https://anaconda.org/conda-forge/igl for the stable version.")
+endif()
+
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
@@ -64,7 +67,3 @@ if(LIBIGL_BUILD_TESTS)
 	enable_testing()
 	enable_testing()
 	add_subdirectory(tests)
 	add_subdirectory(tests)
 endif()
 endif()
-
-if(LIBIGL_WITH_PYTHON)
-	add_subdirectory(python)
-endif()

+ 1 - 1
cmake/LibiglDownloadExternal.cmake

@@ -64,7 +64,7 @@ function(igl_download_cork)
 endfunction()
 endfunction()
 
 
 ## Eigen
 ## Eigen
-set(LIBIGL_EIGEN_VERSION 3.2.10 CACHE STRING "Default version of Eigen used by libigl.")
+set(LIBIGL_EIGEN_VERSION 3.3.7 CACHE STRING "Default version of Eigen used by libigl.")
 function(igl_download_eigen)
 function(igl_download_eigen)
 	igl_download_project(eigen
 	igl_download_project(eigen
 		GIT_REPOSITORY https://github.com/eigenteam/eigen-git-mirror.git
 		GIT_REPOSITORY https://github.com/eigenteam/eigen-git-mirror.git

+ 7 - 8
cmake/libigl.cmake

@@ -34,10 +34,13 @@ option(LIBIGL_WITH_TETGEN            "Use Tetgen"                   OFF)
 option(LIBIGL_WITH_TRIANGLE          "Use Triangle"                 OFF)
 option(LIBIGL_WITH_TRIANGLE          "Use Triangle"                 OFF)
 option(LIBIGL_WITH_PREDICATES        "Use exact predicates"         OFF)
 option(LIBIGL_WITH_PREDICATES        "Use exact predicates"         OFF)
 option(LIBIGL_WITH_XML               "Use XML"                      OFF)
 option(LIBIGL_WITH_XML               "Use XML"                      OFF)
-option(LIBIGL_WITH_PYTHON            "Use Python"                   OFF)
 option(LIBIGL_WITHOUT_COPYLEFT       "Disable Copyleft libraries"   OFF)
 option(LIBIGL_WITHOUT_COPYLEFT       "Disable Copyleft libraries"   OFF)
 option(LIBIGL_EXPORT_TARGETS         "Export libigl CMake targets"  OFF)
 option(LIBIGL_EXPORT_TARGETS         "Export libigl CMake targets"  OFF)
 
 
+if(LIBIGL_BUILD_PYTHON)
+  message(FATAL_ERROR "Python bindings have been removed in this version. Please use an older version of libigl, or wait for the new bindings to be released.")
+endif()
+
 ################################################################################
 ################################################################################
 
 
 ### Configuration
 ### Configuration
@@ -154,7 +157,7 @@ function(compile_igl_module module_dir)
     add_library(${module_libname} STATIC ${SOURCES_IGL_${module_name}} ${ARGN})
     add_library(${module_libname} STATIC ${SOURCES_IGL_${module_name}} ${ARGN})
     if(MSVC)
     if(MSVC)
       # Silencing some compile warnings
       # Silencing some compile warnings
-      target_compile_options(${module_libname} PRIVATE 
+      target_compile_options(${module_libname} PRIVATE
         # Type conversion warnings. These can be fixed with some effort and possibly more verbose code.
         # Type conversion warnings. These can be fixed with some effort and possibly more verbose code.
         /wd4267 # conversion from 'size_t' to 'type', possible loss of data
         /wd4267 # conversion from 'size_t' to 'type', possible loss of data
         /wd4244 # conversion from 'type1' to 'type2', possible loss of data
         /wd4244 # conversion from 'type1' to 'type2', possible loss of data
@@ -200,7 +203,6 @@ compile_igl_module("core" ${SOURCES_IGL})
 ################################################################################
 ################################################################################
 ### Download the python part ###
 ### Download the python part ###
 if(LIBIGL_WITH_PYTHON)
 if(LIBIGL_WITH_PYTHON)
-  igl_download_pybind11()
 endif()
 endif()
 
 
 ################################################################################
 ################################################################################
@@ -216,11 +218,8 @@ if(LIBIGL_WITH_CGAL)
     if(EXISTS ${LIBIGL_EXTERNAL}/boost)
     if(EXISTS ${LIBIGL_EXTERNAL}/boost)
       set(BOOST_ROOT "${LIBIGL_EXTERNAL}/boost")
       set(BOOST_ROOT "${LIBIGL_EXTERNAL}/boost")
     endif()
     endif()
-    if(LIBIGL_WITH_PYTHON)
-      option(CGAL_Boost_USE_STATIC_LIBS "Use static Boost libs with CGAL" OFF)
-    else()
-      option(CGAL_Boost_USE_STATIC_LIBS "Use static Boost libs with CGAL" ON)
-    endif()
+    option(CGAL_Boost_USE_STATIC_LIBS "Use static Boost libs with CGAL" ON)
+
     find_package(CGAL CONFIG COMPONENTS Core PATHS ${CGAL_DIR} NO_DEFAULT_PATH)
     find_package(CGAL CONFIG COMPONENTS Core PATHS ${CGAL_DIR} NO_DEFAULT_PATH)
   endif()
   endif()
 
 

+ 6 - 0
include/igl/AABB.cpp

@@ -1076,6 +1076,12 @@ template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::squared_di
 template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::squared_distance<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
 template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::squared_distance<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
 template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::squared_distance<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
 template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::squared_distance<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
 template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::squared_distance<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
 template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::squared_distance<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
+
+template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::init<Eigen::Matrix<int, -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&);
+template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::init<Eigen::Matrix<int, -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&);
+
+template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::squared_distance<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
+template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::squared_distance<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
 template std::vector<int, std::allocator<int> > igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::find<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 1, -1, false> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 1, -1, false> > const&, bool) const;
 template std::vector<int, std::allocator<int> > igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::find<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 1, -1, false> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 1, -1, false> > const&, bool) const;
 #ifdef WIN32
 #ifdef WIN32
 template void igl::AABB<class Eigen::Matrix<double,-1,-1,0,-1,-1>,2>::squared_distance<class Eigen::Matrix<int,-1,-1,0,-1,-1>,class Eigen::Matrix<double,-1,-1,0,-1,-1>,class Eigen::Matrix<double,-1,1,0,-1,1>,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix<double,-1,3,0,-1,3> >(class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,3,0,-1,3> > &)const;
 template void igl::AABB<class Eigen::Matrix<double,-1,-1,0,-1,-1>,2>::squared_distance<class Eigen::Matrix<int,-1,-1,0,-1,-1>,class Eigen::Matrix<double,-1,-1,0,-1,-1>,class Eigen::Matrix<double,-1,1,0,-1,1>,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix<double,-1,3,0,-1,3> >(class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,3,0,-1,3> > &)const;

+ 7 - 6
include/igl/MappingEnergyType.h

@@ -15,12 +15,13 @@ namespace igl
   
   
   enum MappingEnergyType
   enum MappingEnergyType
   {
   {
-    ARAP,
-    LOG_ARAP,
-    SYMMETRIC_DIRICHLET,
-    CONFORMAL,
-    EXP_CONFORMAL,
-    EXP_SYMMETRIC_DIRICHLET
+    ARAP = 0,
+    LOG_ARAP = 1,
+    SYMMETRIC_DIRICHLET = 2,
+    CONFORMAL = 3,
+    EXP_CONFORMAL = 4,
+    EXP_SYMMETRIC_DIRICHLET = 5,
+    NUM_SLIM_ENERGY_TYPES = 6
   };
   };
 }
 }
 #endif
 #endif

+ 1 - 1
include/igl/active_set.cpp

@@ -223,7 +223,7 @@ IGL_INLINE igl::SolverStatus igl::active_set(
     }
     }
     //cout<<matlab_format((known_i.array()+1).eval(),"known_i")<<endl;
     //cout<<matlab_format((known_i.array()+1).eval(),"known_i")<<endl;
     // PREPARE EQUALITY CONSTRAINTS
     // PREPARE EQUALITY CONSTRAINTS
-    VectorXi as_ieq_list(as_ieq_count,1);
+    Eigen::Matrix<typename DerivedY::Scalar, Eigen::Dynamic, 1> as_ieq_list(as_ieq_count,1);
     // Gather active constraints and resp. rhss
     // Gather active constraints and resp. rhss
     DerivedBeq Beq_i;
     DerivedBeq Beq_i;
     Beq_i.resize(Beq.rows()+as_ieq_count,1);
     Beq_i.resize(Beq.rows()+as_ieq_count,1);

+ 14 - 14
include/igl/ambient_occlusion.cpp

@@ -25,8 +25,8 @@ IGL_INLINE void igl::ambient_occlusion(
       const Eigen::Vector3f&,
       const Eigen::Vector3f&,
       const Eigen::Vector3f&)
       const Eigen::Vector3f&)
       > & shoot_ray,
       > & shoot_ray,
-  const Eigen::PlainObjectBase<DerivedP> & P,
-  const Eigen::PlainObjectBase<DerivedN> & N,
+  const Eigen::MatrixBase<DerivedP> & P,
+  const Eigen::MatrixBase<DerivedN> & N,
   const int num_samples,
   const int num_samples,
   Eigen::PlainObjectBase<DerivedS> & S)
   Eigen::PlainObjectBase<DerivedS> & S)
 {
 {
@@ -69,10 +69,10 @@ template <
   typename DerivedS >
   typename DerivedS >
 IGL_INLINE void igl::ambient_occlusion(
 IGL_INLINE void igl::ambient_occlusion(
   const igl::AABB<DerivedV,DIM> & aabb,
   const igl::AABB<DerivedV,DIM> & aabb,
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::PlainObjectBase<DerivedF> & F,
-  const Eigen::PlainObjectBase<DerivedP> & P,
-  const Eigen::PlainObjectBase<DerivedN> & N,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedP> & P,
+  const Eigen::MatrixBase<DerivedN> & N,
   const int num_samples,
   const int num_samples,
   Eigen::PlainObjectBase<DerivedS> & S)
   Eigen::PlainObjectBase<DerivedS> & S)
 {
 {
@@ -100,10 +100,10 @@ template <
   typename DerivedN,
   typename DerivedN,
   typename DerivedS >
   typename DerivedS >
 IGL_INLINE void igl::ambient_occlusion(
 IGL_INLINE void igl::ambient_occlusion(
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::PlainObjectBase<DerivedF> & F,
-  const Eigen::PlainObjectBase<DerivedP> & P,
-  const Eigen::PlainObjectBase<DerivedN> & N,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedP> & P,
+  const Eigen::MatrixBase<DerivedN> & N,
   const int num_samples,
   const int num_samples,
   Eigen::PlainObjectBase<DerivedS> & S)
   Eigen::PlainObjectBase<DerivedS> & S)
 {
 {
@@ -128,10 +128,10 @@ IGL_INLINE void igl::ambient_occlusion(
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template void igl::ambient_occlusion<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+template void igl::ambient_occlusion<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template void igl::ambient_occlusion<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+template void igl::ambient_occlusion<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template void igl::ambient_occlusion<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
-template void igl::ambient_occlusion<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::ambient_occlusion<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+template void igl::ambient_occlusion<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 10 - 10
include/igl/ambient_occlusion.h

@@ -34,8 +34,8 @@ namespace igl
         const Eigen::Vector3f&,
         const Eigen::Vector3f&,
         const Eigen::Vector3f&)
         const Eigen::Vector3f&)
         > & shoot_ray,
         > & shoot_ray,
-    const Eigen::PlainObjectBase<DerivedP> & P,
-    const Eigen::PlainObjectBase<DerivedN> & N,
+    const Eigen::MatrixBase<DerivedP> & P,
+    const Eigen::MatrixBase<DerivedN> & N,
     const int num_samples,
     const int num_samples,
     Eigen::PlainObjectBase<DerivedS> & S);
     Eigen::PlainObjectBase<DerivedS> & S);
   // Inputs:
   // Inputs:
@@ -49,10 +49,10 @@ namespace igl
     typename DerivedS >
     typename DerivedS >
   IGL_INLINE void ambient_occlusion(
   IGL_INLINE void ambient_occlusion(
     const igl::AABB<DerivedV,DIM> & aabb,
     const igl::AABB<DerivedV,DIM> & aabb,
-    const Eigen::PlainObjectBase<DerivedV> & V,
-    const Eigen::PlainObjectBase<DerivedF> & F,
-    const Eigen::PlainObjectBase<DerivedP> & P,
-    const Eigen::PlainObjectBase<DerivedN> & N,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedP> & P,
+    const Eigen::MatrixBase<DerivedN> & N,
     const int num_samples,
     const int num_samples,
     Eigen::PlainObjectBase<DerivedS> & S);
     Eigen::PlainObjectBase<DerivedS> & S);
   // Inputs:
   // Inputs:
@@ -65,10 +65,10 @@ namespace igl
     typename DerivedN,
     typename DerivedN,
     typename DerivedS >
     typename DerivedS >
   IGL_INLINE void ambient_occlusion(
   IGL_INLINE void ambient_occlusion(
-    const Eigen::PlainObjectBase<DerivedV> & V,
-    const Eigen::PlainObjectBase<DerivedF> & F,
-    const Eigen::PlainObjectBase<DerivedP> & P,
-    const Eigen::PlainObjectBase<DerivedN> & N,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedP> & P,
+    const Eigen::MatrixBase<DerivedN> & N,
     const int num_samples,
     const int num_samples,
     Eigen::PlainObjectBase<DerivedS> & S);
     Eigen::PlainObjectBase<DerivedS> & S);
 
 

+ 15 - 9
include/igl/arap_linear_block.cpp

@@ -10,13 +10,13 @@
 #include "cotmatrix_entries.h"
 #include "cotmatrix_entries.h"
 #include <Eigen/Dense>
 #include <Eigen/Dense>
 
 
-template <typename MatV, typename MatF, typename Scalar>
+template <typename MatV, typename MatF, typename MatK>
 IGL_INLINE void igl::arap_linear_block(
 IGL_INLINE void igl::arap_linear_block(
   const MatV & V,
   const MatV & V,
   const MatF & F,
   const MatF & F,
   const int d,
   const int d,
   const igl::ARAPEnergyType energy,
   const igl::ARAPEnergyType energy,
-  Eigen::SparseMatrix<Scalar> & Kd)
+  MatK & Kd)
 {
 {
   switch(energy)
   switch(energy)
   {
   {
@@ -36,13 +36,15 @@ IGL_INLINE void igl::arap_linear_block(
 }
 }
 
 
 
 
-template <typename MatV, typename MatF, typename Scalar>
+template <typename MatV, typename MatF, typename MatK>
 IGL_INLINE void igl::arap_linear_block_spokes(
 IGL_INLINE void igl::arap_linear_block_spokes(
   const MatV & V,
   const MatV & V,
   const MatF & F,
   const MatF & F,
   const int d,
   const int d,
-  Eigen::SparseMatrix<Scalar> & Kd)
+  MatK & Kd)
 {
 {
+  typedef typename MatK::Scalar Scalar;
+
   using namespace std;
   using namespace std;
   using namespace Eigen;
   using namespace Eigen;
   // simplex size (3: triangles, 4: tetrahedra)
   // simplex size (3: triangles, 4: tetrahedra)
@@ -101,13 +103,15 @@ IGL_INLINE void igl::arap_linear_block_spokes(
   Kd.makeCompressed();
   Kd.makeCompressed();
 }
 }
 
 
-template <typename MatV, typename MatF, typename Scalar>
+template <typename MatV, typename MatF, typename MatK>
 IGL_INLINE void igl::arap_linear_block_spokes_and_rims(
 IGL_INLINE void igl::arap_linear_block_spokes_and_rims(
   const MatV & V,
   const MatV & V,
   const MatF & F,
   const MatF & F,
   const int d,
   const int d,
-  Eigen::SparseMatrix<Scalar> & Kd)
+  MatK & Kd)
 {
 {
+  typedef typename MatK::Scalar Scalar;
+
   using namespace std;
   using namespace std;
   using namespace Eigen;
   using namespace Eigen;
   // simplex size (3: triangles, 4: tetrahedra)
   // simplex size (3: triangles, 4: tetrahedra)
@@ -183,13 +187,14 @@ IGL_INLINE void igl::arap_linear_block_spokes_and_rims(
   Kd.makeCompressed();
   Kd.makeCompressed();
 }
 }
 
 
-template <typename MatV, typename MatF, typename Scalar>
+template <typename MatV, typename MatF, typename MatK>
 IGL_INLINE void igl::arap_linear_block_elements(
 IGL_INLINE void igl::arap_linear_block_elements(
   const MatV & V,
   const MatV & V,
   const MatF & F,
   const MatF & F,
   const int d,
   const int d,
-  Eigen::SparseMatrix<Scalar> & Kd)
+  MatK & Kd)
 {
 {
+  typedef typename MatK::Scalar Scalar;
   using namespace std;
   using namespace std;
   using namespace Eigen;
   using namespace Eigen;
   // simplex size (3: triangles, 4: tetrahedra)
   // simplex size (3: triangles, 4: tetrahedra)
@@ -249,5 +254,6 @@ IGL_INLINE void igl::arap_linear_block_elements(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template IGL_INLINE void igl::arap_linear_block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, int, igl::ARAPEnergyType, Eigen::SparseMatrix<double, 0, int>&);
+template void igl::arap_linear_block<Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >, Eigen::SparseMatrix<double, 0, int> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, int, igl::ARAPEnergyType, Eigen::SparseMatrix<double, 0, int>&);
+template void igl::arap_linear_block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::SparseMatrix<double, 0, int> >(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, int, igl::ARAPEnergyType, Eigen::SparseMatrix<double, 0, int>&);
 #endif
 #endif

+ 8 - 8
include/igl/arap_linear_block.h

@@ -43,32 +43,32 @@ namespace igl
   //   Kd  #V by #V/#F block of the linear constructor matrix corresponding to
   //   Kd  #V by #V/#F block of the linear constructor matrix corresponding to
   //     coordinate d
   //     coordinate d
   //
   //
-  template <typename MatV, typename MatF, typename Scalar>
+  template <typename MatV, typename MatF, typename MatK>
   IGL_INLINE void arap_linear_block(
   IGL_INLINE void arap_linear_block(
     const MatV & V,
     const MatV & V,
     const MatF & F,
     const MatF & F,
     const int d,
     const int d,
     const igl::ARAPEnergyType energy,
     const igl::ARAPEnergyType energy,
-    Eigen::SparseMatrix<Scalar> & Kd);
+    MatK & Kd);
   // Helper functions for each energy type
   // Helper functions for each energy type
-  template <typename MatV, typename MatF, typename Scalar>
+  template <typename MatV, typename MatF, typename MatK>
   IGL_INLINE void arap_linear_block_spokes(
   IGL_INLINE void arap_linear_block_spokes(
     const MatV & V,
     const MatV & V,
     const MatF & F,
     const MatF & F,
     const int d,
     const int d,
-    Eigen::SparseMatrix<Scalar> & Kd);
-  template <typename MatV, typename MatF, typename Scalar>
+    MatK & Kd);
+  template <typename MatV, typename MatF, typename MatK>
   IGL_INLINE void arap_linear_block_spokes_and_rims(
   IGL_INLINE void arap_linear_block_spokes_and_rims(
     const MatV & V,
     const MatV & V,
     const MatF & F,
     const MatF & F,
     const int d,
     const int d,
-    Eigen::SparseMatrix<Scalar> & Kd);
-  template <typename MatV, typename MatF, typename Scalar>
+    MatK & Kd);
+  template <typename MatV, typename MatF, typename MatK>
   IGL_INLINE void arap_linear_block_elements(
   IGL_INLINE void arap_linear_block_elements(
     const MatV & V,
     const MatV & V,
     const MatF & F,
     const MatF & F,
     const int d,
     const int d,
-    Eigen::SparseMatrix<Scalar> & Kd);
+    MatK & Kd);
 }
 }
 
 
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 18 - 12
include/igl/arap_rhs.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "arap_rhs.h"
 #include "arap_rhs.h"
 #include "arap_linear_block.h"
 #include "arap_linear_block.h"
@@ -12,12 +12,13 @@
 #include "cat.h"
 #include "cat.h"
 #include <iostream>
 #include <iostream>
 
 
+template<typename DerivedV, typename DerivedF, typename DerivedK>
 IGL_INLINE void igl::arap_rhs(
 IGL_INLINE void igl::arap_rhs(
-  const Eigen::MatrixXd & V, 
-  const Eigen::MatrixXi & F,
-  const int dim,
-  const igl::ARAPEnergyType energy,
-  Eigen::SparseMatrix<double>& K)
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedF> & F,
+    const int dim,
+    const igl::ARAPEnergyType energy,
+    Eigen::SparseCompressedBase<DerivedK>& K)
 {
 {
   using namespace std;
   using namespace std;
   using namespace Eigen;
   using namespace Eigen;
@@ -48,7 +49,7 @@ IGL_INLINE void igl::arap_rhs(
       return;
       return;
   }
   }
 
 
-  SparseMatrix<double> KX,KY,KZ;
+  DerivedK KX,KY,KZ;
   arap_linear_block(V,F,0,energy,KX);
   arap_linear_block(V,F,0,energy,KX);
   arap_linear_block(V,F,1,energy,KY);
   arap_linear_block(V,F,1,energy,KY);
   if(Vdim == 2)
   if(Vdim == 2)
@@ -62,7 +63,7 @@ IGL_INLINE void igl::arap_rhs(
       K = cat(2,cat(2,repdiag(KX,dim),repdiag(KY,dim)),repdiag(KZ,dim));
       K = cat(2,cat(2,repdiag(KX,dim),repdiag(KY,dim)),repdiag(KZ,dim));
     }else if(dim ==2)
     }else if(dim ==2)
     {
     {
-      SparseMatrix<double> ZZ(KX.rows()*2,KX.cols());
+      DerivedK ZZ(KX.rows()*2,KX.cols());
       K = cat(2,cat(2,
       K = cat(2,cat(2,
             cat(2,repdiag(KX,dim),ZZ),
             cat(2,repdiag(KX,dim),ZZ),
             cat(2,repdiag(KY,dim),ZZ)),
             cat(2,repdiag(KY,dim),ZZ)),
@@ -84,6 +85,11 @@ IGL_INLINE void igl::arap_rhs(
      Vdim);
      Vdim);
     return;
     return;
   }
   }
-  
+
 }
 }
 
 
+
+
+#ifdef IGL_STATIC_LIBRARY
+template void igl::arap_rhs(const Eigen::MatrixBase<Eigen::MatrixXd> & V, const Eigen::MatrixBase<Eigen::MatrixXi> & F,const int dim, const igl::ARAPEnergyType energy,Eigen::SparseCompressedBase<Eigen::SparseMatrix<double>>& K);
+#endif

+ 10 - 9
include/igl/arap_rhs.h

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_ARAP_RHS_H
 #ifndef IGL_ARAP_RHS_H
 #define IGL_ARAP_RHS_H
 #define IGL_ARAP_RHS_H
@@ -25,16 +25,17 @@ namespace igl
   //   energy  igl::ARAPEnergyType enum value defining which energy is being
   //   energy  igl::ARAPEnergyType enum value defining which energy is being
   //     used. See igl::ARAPEnergyType.h for valid options and explanations.
   //     used. See igl::ARAPEnergyType.h for valid options and explanations.
   // Outputs:
   // Outputs:
-  //   K  #V*dim by #(F|V)*dim*dim matrix such that: 
+  //   K  #V*dim by #(F|V)*dim*dim matrix such that:
   //     b = K * reshape(permute(R,[3 1 2]),size(V|F,1)*size(V,2)*size(V,2),1);
   //     b = K * reshape(permute(R,[3 1 2]),size(V|F,1)*size(V,2)*size(V,2),1);
-  //   
+  //
   // See also: arap_linear_block
   // See also: arap_linear_block
+  template<typename DerivedV, typename DerivedF, typename DerivedK>
   IGL_INLINE void arap_rhs(
   IGL_INLINE void arap_rhs(
-    const Eigen::MatrixXd & V, 
-    const Eigen::MatrixXi & F,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedF> & F,
     const int dim,
     const int dim,
     const igl::ARAPEnergyType energy,
     const igl::ARAPEnergyType energy,
-    Eigen::SparseMatrix<double>& K);
+    Eigen::SparseCompressedBase<DerivedK>& K);
 }
 }
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY
 #include "arap_rhs.cpp"
 #include "arap_rhs.cpp"

+ 2 - 2
include/igl/average_onto_vertices.cpp

@@ -7,11 +7,11 @@
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "average_onto_vertices.h"
 #include "average_onto_vertices.h"
 
 
-template<typename DerivedV,typename DerivedF,typename DerivedS>
+template<typename DerivedV,typename DerivedF,typename DerivedS,typename DerivedSV >
 IGL_INLINE void igl::average_onto_vertices(const Eigen::MatrixBase<DerivedV> &V,
 IGL_INLINE void igl::average_onto_vertices(const Eigen::MatrixBase<DerivedV> &V,
   const Eigen::MatrixBase<DerivedF> &F,
   const Eigen::MatrixBase<DerivedF> &F,
   const Eigen::MatrixBase<DerivedS> &S,
   const Eigen::MatrixBase<DerivedS> &S,
-  Eigen::MatrixBase<DerivedS> &SV)
+  Eigen::PlainObjectBase<DerivedSV> &SV)
 {
 {
   SV = DerivedS::Zero(V.rows(),S.cols());
   SV = DerivedS::Zero(V.rows(),S.cols());
   Eigen::Matrix<typename DerivedF::Scalar,Eigen::Dynamic,1> COUNT(V.rows());
   Eigen::Matrix<typename DerivedF::Scalar,Eigen::Dynamic,1> COUNT(V.rows());

+ 9 - 9
include/igl/average_onto_vertices.h

@@ -1,31 +1,31 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_AVERAGE_ONTO_VERTICES_H
 #ifndef IGL_AVERAGE_ONTO_VERTICES_H
 #define IGL_AVERAGE_ONTO_VERTICES_H
 #define IGL_AVERAGE_ONTO_VERTICES_H
 #include "igl_inline.h"
 #include "igl_inline.h"
 
 
 #include <Eigen/Dense>
 #include <Eigen/Dense>
-namespace igl 
+namespace igl
 {
 {
-  // average_onto_vertices 
+  // average_onto_vertices
   // Move a scalar field defined on faces to vertices by averaging
   // Move a scalar field defined on faces to vertices by averaging
   //
   //
   // Input:
   // Input:
   // V,F: mesh
   // V,F: mesh
   // S: scalar field defined on faces, Fx1
   // S: scalar field defined on faces, Fx1
-  // 
+  //
   // Output:
   // Output:
   // SV: scalar field defined on vertices
   // SV: scalar field defined on vertices
-  template<typename DerivedV,typename DerivedF,typename DerivedS>
+  template<typename DerivedV,typename DerivedF,typename DerivedS,typename DerivedSV>
   IGL_INLINE void average_onto_vertices(const Eigen::MatrixBase<DerivedV> &V,
   IGL_INLINE void average_onto_vertices(const Eigen::MatrixBase<DerivedV> &V,
     const Eigen::MatrixBase<DerivedF> &F,
     const Eigen::MatrixBase<DerivedF> &F,
     const Eigen::MatrixBase<DerivedS> &S,
     const Eigen::MatrixBase<DerivedS> &S,
-    Eigen::MatrixBase<DerivedS> &SV);
+    Eigen::PlainObjectBase<DerivedSV> &SV);
 }
 }
 
 
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 2 - 0
include/igl/barycenter.cpp

@@ -56,4 +56,6 @@ template void igl::barycenter<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Mat
 template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 2, 0, -1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&);
 template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 2, 0, -1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&);
 template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 2, 3, 0, 2, 3>, Eigen::Matrix<double, 2, 3, 0, 2, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 2, 3, 0, 2, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 3, 0, 2, 3> >&);
 template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 2, 3, 0, 2, 3>, Eigen::Matrix<double, 2, 3, 0, 2, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 2, 3, 0, 2, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 3, 0, 2, 3> >&);
 template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, 2, 3, 0, 2, 3>, Eigen::Matrix<double, 2, 3, 0, 2, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, 2, 3, 0, 2, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 3, 0, 2, 3> >&);
 template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, 2, 3, 0, 2, 3>, Eigen::Matrix<double, 2, 3, 0, 2, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, 2, 3, 0, 2, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 3, 0, 2, 3> >&);
+template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 2, 0, -1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&);
+template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
 #endif
 #endif

+ 2 - 2
include/igl/bfs.cpp

@@ -59,7 +59,7 @@ template <
   typename DType,
   typename DType,
   typename PType>
   typename PType>
 IGL_INLINE void igl::bfs(
 IGL_INLINE void igl::bfs(
-  const Eigen::SparseMatrix<AType> & A,
+  const Eigen::SparseCompressedBase<AType> & A,
   const size_t s,
   const size_t s,
   std::vector<DType> & D,
   std::vector<DType> & D,
   std::vector<PType> & P)
   std::vector<PType> & P)
@@ -83,7 +83,7 @@ IGL_INLINE void igl::bfs(
     D.push_back(f);
     D.push_back(f);
     P[f] = p;
     P[f] = p;
     seen[f] = true;
     seen[f] = true;
-    for(typename Eigen::SparseMatrix<AType>::InnerIterator it (A,f); it; ++it)
+    for(typename AType::InnerIterator it (A,f); it; ++it)
     {
     {
       if(it.value()) Q.push({it.index(),f});
       if(it.value()) Q.push({it.index(),f});
     }
     }

+ 1 - 1
include/igl/bfs.h

@@ -42,7 +42,7 @@ namespace igl
     typename DType,
     typename DType,
     typename PType>
     typename PType>
   IGL_INLINE void bfs(
   IGL_INLINE void bfs(
-    const Eigen::SparseMatrix<AType> & A,
+    const Eigen::SparseCompressedBase<AType> & A,
     const size_t s,
     const size_t s,
     std::vector<DType> & D,
     std::vector<DType> & D,
     std::vector<PType> & P);
     std::vector<PType> & P);

+ 7 - 7
include/igl/bfs_orient.cpp

@@ -12,13 +12,13 @@
 
 
 template <typename DerivedF, typename DerivedFF, typename DerivedC>
 template <typename DerivedF, typename DerivedFF, typename DerivedC>
 IGL_INLINE void igl::bfs_orient(
 IGL_INLINE void igl::bfs_orient(
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedFF> & FF,
   Eigen::PlainObjectBase<DerivedFF> & FF,
   Eigen::PlainObjectBase<DerivedC> & C)
   Eigen::PlainObjectBase<DerivedC> & C)
 {
 {
   using namespace Eigen;
   using namespace Eigen;
   using namespace std;
   using namespace std;
-  SparseMatrix<int> A;
+  SparseMatrix<typename DerivedF::Scalar> A;
   orientable_patches(F,C,A);
   orientable_patches(F,C,A);
 
 
   // number of faces
   // number of faces
@@ -30,7 +30,7 @@ IGL_INLINE void igl::bfs_orient(
   // Edge sets
   // Edge sets
   const int ES[3][2] = {{1,2},{2,0},{0,1}};
   const int ES[3][2] = {{1,2},{2,0},{0,1}};
 
 
-  if(&FF != &F)
+  if(((void*)&FF) != ((void*)&F))
   {
   {
     FF = F;
     FF = F;
   }
   }
@@ -38,7 +38,7 @@ IGL_INLINE void igl::bfs_orient(
 #pragma omp parallel for
 #pragma omp parallel for
   for(int c = 0;c<num_cc;c++)
   for(int c = 0;c<num_cc;c++)
   {
   {
-    queue<int> Q;
+    queue<typename DerivedF::Scalar> Q;
     // find first member of patch c
     // find first member of patch c
     for(int f = 0;f<FF.rows();f++)
     for(int f = 0;f<FF.rows();f++)
     {
     {
@@ -51,7 +51,7 @@ IGL_INLINE void igl::bfs_orient(
     assert(!Q.empty());
     assert(!Q.empty());
     while(!Q.empty())
     while(!Q.empty())
     {
     {
-      const int f = Q.front();
+      const typename DerivedF::Scalar f = Q.front();
       Q.pop();
       Q.pop();
       if(seen(f) > 0)
       if(seen(f) > 0)
       {
       {
@@ -59,7 +59,7 @@ IGL_INLINE void igl::bfs_orient(
       }
       }
       seen(f)++;
       seen(f)++;
       // loop over neighbors of f
       // loop over neighbors of f
-      for(typename SparseMatrix<int>::InnerIterator it (A,f); it; ++it)
+      for(typename SparseMatrix<typename DerivedF::Scalar>::InnerIterator it (A,f); it; ++it)
       {
       {
         // might be some lingering zeros, and skip self-adjacency
         // might be some lingering zeros, and skip self-adjacency
         if(it.value() != 0 && it.row() != f)
         if(it.value() != 0 && it.row() != f)
@@ -96,5 +96,5 @@ IGL_INLINE void igl::bfs_orient(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::bfs_orient<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::bfs_orient<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #endif
 #endif

+ 2 - 2
include/igl/bfs_orient.h

@@ -25,10 +25,10 @@ namespace igl
   //
   //
   template <typename DerivedF, typename DerivedFF, typename DerivedC>
   template <typename DerivedF, typename DerivedFF, typename DerivedC>
   IGL_INLINE void bfs_orient(
   IGL_INLINE void bfs_orient(
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedF> & F,
     Eigen::PlainObjectBase<DerivedFF> & FF,
     Eigen::PlainObjectBase<DerivedFF> & FF,
     Eigen::PlainObjectBase<DerivedC> & C);
     Eigen::PlainObjectBase<DerivedC> & C);
-};
+}
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY
 #  include "bfs_orient.cpp"
 #  include "bfs_orient.cpp"
 #endif
 #endif

+ 31 - 27
include/igl/biharmonic_coordinates.cpp

@@ -22,8 +22,8 @@ template <
   typename SType,
   typename SType,
   typename DerivedW>
   typename DerivedW>
 IGL_INLINE bool igl::biharmonic_coordinates(
 IGL_INLINE bool igl::biharmonic_coordinates(
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::PlainObjectBase<DerivedT> & T,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedT> & T,
   const std::vector<std::vector<SType> > & S,
   const std::vector<std::vector<SType> > & S,
   Eigen::PlainObjectBase<DerivedW> & W)
   Eigen::PlainObjectBase<DerivedW> & W)
 {
 {
@@ -36,32 +36,36 @@ template <
   typename SType,
   typename SType,
   typename DerivedW>
   typename DerivedW>
 IGL_INLINE bool igl::biharmonic_coordinates(
 IGL_INLINE bool igl::biharmonic_coordinates(
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::PlainObjectBase<DerivedT> & T,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedT> & T,
   const std::vector<std::vector<SType> > & S,
   const std::vector<std::vector<SType> > & S,
   const int k,
   const int k,
   Eigen::PlainObjectBase<DerivedW> & W)
   Eigen::PlainObjectBase<DerivedW> & W)
 {
 {
   using namespace Eigen;
   using namespace Eigen;
   using namespace std;
   using namespace std;
+
+  typedef typename DerivedV::Scalar Scalar;
+  typedef typename DerivedT::Scalar Integer;
+
   // This is not the most efficient way to build A, but follows "Linear
   // This is not the most efficient way to build A, but follows "Linear
   // Subspace Design for Real-Time Shape Deformation" [Wang et al. 2015].
   // Subspace Design for Real-Time Shape Deformation" [Wang et al. 2015].
-  SparseMatrix<double> A;
+  SparseMatrix<Scalar> A;
   {
   {
-    DiagonalMatrix<double,Dynamic> Minv;
-    SparseMatrix<double> L,K;
+    DiagonalMatrix<Scalar, Dynamic> Minv;
+    SparseMatrix<Scalar> L, K;
     Array<bool,Dynamic,Dynamic> C;
     Array<bool,Dynamic,Dynamic> C;
     {
     {
       Array<bool,Dynamic,1> I;
       Array<bool,Dynamic,1> I;
       on_boundary(T,I,C);
       on_boundary(T,I,C);
     }
     }
-#ifdef false 
+#ifdef false
     // Version described in paper is "wrong"
     // Version described in paper is "wrong"
     // http://www.cs.toronto.edu/~jacobson/images/error-in-linear-subspace-design-for-real-time-shape-deformation-2017-wang-et-al.pdf
     // http://www.cs.toronto.edu/~jacobson/images/error-in-linear-subspace-design-for-real-time-shape-deformation-2017-wang-et-al.pdf
-    SparseMatrix<double> N,Z,M;
+    SparseMatrix<Scalar> N, Z, M;
     normal_derivative(V,T,N);
     normal_derivative(V,T,N);
     {
     {
-      std::vector<Triplet<double> >ZIJV;
+      std::vector<Triplet<Scalar>> ZIJV;
       for(int t =0;t<T.rows();t++)
       for(int t =0;t<T.rows();t++)
       {
       {
         for(int f =0;f<T.cols();f++)
         for(int f =0;f<T.cols();f++)
@@ -84,37 +88,37 @@ IGL_INLINE bool igl::biharmonic_coordinates(
     K = N+L;
     K = N+L;
     massmatrix(V,T,MASSMATRIX_TYPE_DEFAULT,M);
     massmatrix(V,T,MASSMATRIX_TYPE_DEFAULT,M);
     // normalize
     // normalize
-    M /= ((VectorXd)M.diagonal()).array().abs().maxCoeff();
+    M /= ((Matrix<Scalar, Dynamic, 1>)M.diagonal()).array().abs().maxCoeff();
     Minv =
     Minv =
-      ((VectorXd)M.diagonal().array().inverse()).asDiagonal();
+      ((Matrix<Scalar, Dynamic, 1>)M.diagonal().array().inverse()).asDiagonal();
 #else
 #else
-    Eigen::SparseMatrix<double> M;
-    Eigen::MatrixXi E;
-    Eigen::VectorXi EMAP;
+    Eigen::SparseMatrix<Scalar> M;
+    Eigen::Matrix<Integer, Dynamic, Dynamic> E;
+    Eigen::Matrix<Integer, Dynamic, 1> EMAP;
     crouzeix_raviart_massmatrix(V,T,M,E,EMAP);
     crouzeix_raviart_massmatrix(V,T,M,E,EMAP);
     crouzeix_raviart_cotmatrix(V,T,E,EMAP,L);
     crouzeix_raviart_cotmatrix(V,T,E,EMAP,L);
     // Ad  #E by #V facet-vertex incidence matrix
     // Ad  #E by #V facet-vertex incidence matrix
-    Eigen::SparseMatrix<double> Ad(E.rows(),V.rows());
+    Eigen::SparseMatrix<Scalar> Ad(E.rows(),V.rows());
     {
     {
-      std::vector<Eigen::Triplet<double> > AIJV(E.size());
+      std::vector<Eigen::Triplet<Scalar>> AIJV(E.size());
       for(int e = 0;e<E.rows();e++)
       for(int e = 0;e<E.rows();e++)
       {
       {
         for(int c = 0;c<E.cols();c++)
         for(int c = 0;c<E.cols();c++)
         {
         {
-          AIJV[e+c*E.rows()] = Eigen::Triplet<double>(e,E(e,c),1);
+          AIJV[e + c * E.rows()] = Eigen::Triplet<Scalar>(e, E(e, c), 1);
         }
         }
       }
       }
       Ad.setFromTriplets(AIJV.begin(),AIJV.end());
       Ad.setFromTriplets(AIJV.begin(),AIJV.end());
     }
     }
     // Degrees
     // Degrees
-    Eigen::VectorXd De;
+    Eigen::Matrix<Scalar, Dynamic, 1> De;
     sum(Ad,2,De);
     sum(Ad,2,De);
-    Eigen::DiagonalMatrix<double,Eigen::Dynamic> De_diag = 
+    Eigen::DiagonalMatrix<Scalar,Eigen::Dynamic> De_diag =
       De.array().inverse().matrix().asDiagonal();
       De.array().inverse().matrix().asDiagonal();
     K = L*(De_diag*Ad);
     K = L*(De_diag*Ad);
     // normalize
     // normalize
-    M /= ((VectorXd)M.diagonal()).array().abs().maxCoeff();
-    Minv = ((VectorXd)M.diagonal().array().inverse()).asDiagonal();
+    M /= ((Matrix<Scalar, Dynamic, 1>)M.diagonal()).array().abs().maxCoeff();
+    Minv = ((Matrix<Scalar, Dynamic, 1>)M.diagonal().array().inverse()).asDiagonal();
     // kill boundary edges
     // kill boundary edges
     for(int f = 0;f<T.rows();f++)
     for(int f = 0;f<T.rows();f++)
     {
     {
@@ -159,9 +163,9 @@ IGL_INLINE bool igl::biharmonic_coordinates(
   }
   }
   const size_t dim = T.cols()-1;
   const size_t dim = T.cols()-1;
   // Might as well be dense... I think...
   // Might as well be dense... I think...
-  MatrixXd J = MatrixXd::Zero(mp+mr,mp+r*(dim+1));
-  VectorXi b(mp+mr);
-  MatrixXd H(mp+r*(dim+1),dim);
+  Matrix<Scalar, Dynamic, Dynamic> J = Matrix<Scalar, Dynamic, Dynamic>::Zero(mp+mr,mp+r*(dim+1));
+  Matrix<Integer, Dynamic, 1> b(mp+mr);
+  Matrix<Scalar, Dynamic, Dynamic> H(mp+r*(dim+1),dim);
   {
   {
     int v = 0;
     int v = 0;
     int c = 0;
     int c = 0;
@@ -194,10 +198,10 @@ IGL_INLINE bool igl::biharmonic_coordinates(
   // minimize    ½ W' A W'
   // minimize    ½ W' A W'
   // subject to  W(b,:) = J
   // subject to  W(b,:) = J
   return min_quad_with_fixed(
   return min_quad_with_fixed(
-    A,VectorXd::Zero(A.rows()).eval(),b,J,SparseMatrix<double>(),VectorXd(),true,W);
+    A,Matrix<Scalar, Dynamic, 1>::Zero(A.rows()).eval(),b,J,SparseMatrix<Scalar>(),Matrix<Scalar, Dynamic, 1>(),true,W);
 }
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template bool igl::biharmonic_coordinates<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, int, Eigen::Matrix<double, -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&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::biharmonic_coordinates<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, int, 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&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 4 - 4
include/igl/biharmonic_coordinates.h

@@ -66,8 +66,8 @@ namespace igl
     typename SType,
     typename SType,
     typename DerivedW>
     typename DerivedW>
   IGL_INLINE bool biharmonic_coordinates(
   IGL_INLINE bool biharmonic_coordinates(
-    const Eigen::PlainObjectBase<DerivedV> & V,
-    const Eigen::PlainObjectBase<DerivedT> & T,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedT> & T,
     const std::vector<std::vector<SType> > & S,
     const std::vector<std::vector<SType> > & S,
     Eigen::PlainObjectBase<DerivedW> & W);
     Eigen::PlainObjectBase<DerivedW> & W);
   // k  2-->biharmonic, 3-->triharmonic
   // k  2-->biharmonic, 3-->triharmonic
@@ -77,8 +77,8 @@ namespace igl
     typename SType,
     typename SType,
     typename DerivedW>
     typename DerivedW>
   IGL_INLINE bool biharmonic_coordinates(
   IGL_INLINE bool biharmonic_coordinates(
-    const Eigen::PlainObjectBase<DerivedV> & V,
-    const Eigen::PlainObjectBase<DerivedT> & T,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedT> & T,
     const std::vector<std::vector<SType> > & S,
     const std::vector<std::vector<SType> > & S,
     const int k,
     const int k,
     Eigen::PlainObjectBase<DerivedW> & W);
     Eigen::PlainObjectBase<DerivedW> & W);

+ 8 - 8
include/igl/bijective_composite_harmonic_mapping.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2017 Alec Jacobson <[email protected]>
 // Copyright (C) 2017 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "bijective_composite_harmonic_mapping.h"
 #include "bijective_composite_harmonic_mapping.h"
 
 
@@ -51,11 +51,11 @@ IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
   assert(F.cols() == 3 && "F should contain triangles");
   assert(F.cols() == 3 && "F should contain triangles");
   int tries = 0;
   int tries = 0;
   int nsteps = min_steps;
   int nsteps = min_steps;
-  Derivedbc bc0;
+  Eigen::Matrix<typename Derivedbc::Scalar, Eigen::Dynamic, Eigen::Dynamic> bc0;
   slice(V,b,1,bc0);
   slice(V,b,1,bc0);
 
 
   // It's difficult to check for flips "robustly" in the sense that the input
   // It's difficult to check for flips "robustly" in the sense that the input
-  // mesh might not have positive/consistent sign to begin with. 
+  // mesh might not have positive/consistent sign to begin with.
 
 
   while(nsteps<=max_steps)
   while(nsteps<=max_steps)
   {
   {
@@ -71,7 +71,7 @@ IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
       // of the boundary conditions. Something like "Homotopic Morphing of
       // of the boundary conditions. Something like "Homotopic Morphing of
       // Planar Curves" [Dym et al. 2015] but also handling multiple connected
       // Planar Curves" [Dym et al. 2015] but also handling multiple connected
       // components.
       // components.
-      Derivedbc bct = bc0 + t*(bc - bc0);
+      Eigen::Matrix<typename Derivedbc::Scalar, Eigen::Dynamic, Eigen::Dynamic> bct = bc0 + t * (bc - bc0);
       // Compute dsicrete harmonic map using metric of previous step
       // Compute dsicrete harmonic map using metric of previous step
       for(int iter = 0;iter<num_inner_iters;iter++)
       for(int iter = 0;iter<num_inner_iters;iter++)
       {
       {
@@ -82,7 +82,7 @@ IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
         //mw.save_index(b,"b");
         //mw.save_index(b,"b");
         //mw.save(bct,"bct");
         //mw.save(bct,"bct");
         //mw.write("numerical.mat");
         //mw.write("numerical.mat");
-        harmonic(DerivedU(U),F,b,bct,1,U);
+        harmonic(Eigen::Matrix<typename DerivedU::Scalar, Eigen::Dynamic, Eigen::Dynamic>(U), F, b, bct, 1, U);
         igl::slice(U,b,1,bct);
         igl::slice(U,b,1,bct);
         nans = (U.array() != U.array()).count();
         nans = (U.array() != U.array()).count();
         if(test_for_flips)
         if(test_for_flips)

+ 2 - 2
include/igl/bone_parents.cpp

@@ -9,7 +9,7 @@
 
 
 template <typename DerivedBE, typename DerivedP>
 template <typename DerivedBE, typename DerivedP>
 IGL_INLINE void igl::bone_parents(
 IGL_INLINE void igl::bone_parents(
-  const Eigen::PlainObjectBase<DerivedBE>& BE,
+  const Eigen::MatrixBase<DerivedBE>& BE,
   Eigen::PlainObjectBase<DerivedP>& P)
   Eigen::PlainObjectBase<DerivedP>& P)
 {
 {
   P.resize(BE.rows(),1);
   P.resize(BE.rows(),1);
@@ -28,5 +28,5 @@ IGL_INLINE void igl::bone_parents(
 }
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
-template void igl::bone_parents<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::bone_parents<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #endif
 #endif

+ 1 - 1
include/igl/bone_parents.h

@@ -20,7 +20,7 @@ namespace igl
   //
   //
   template <typename DerivedBE, typename DerivedP>
   template <typename DerivedBE, typename DerivedP>
   IGL_INLINE void bone_parents(
   IGL_INLINE void bone_parents(
-    const Eigen::PlainObjectBase<DerivedBE>& BE,
+    const Eigen::MatrixBase<DerivedBE>& BE,
     Eigen::PlainObjectBase<DerivedP>& P);
     Eigen::PlainObjectBase<DerivedP>& P);
 }
 }
 
 

+ 2 - 2
include/igl/boundary_loop.cpp

@@ -24,7 +24,7 @@ IGL_INLINE void igl::boundary_loop(
     return;
     return;
 
 
   VectorXd Vdummy(F.maxCoeff()+1,1);
   VectorXd Vdummy(F.maxCoeff()+1,1);
-  DerivedF TT,TTi;
+  Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, Eigen::Dynamic> TT,TTi;
   vector<std::vector<int> > VF, VFi;
   vector<std::vector<int> > VF, VFi;
   triangle_triangle_adjacency(F,TT,TTi);
   triangle_triangle_adjacency(F,TT,TTi);
   vertex_triangle_adjacency(Vdummy,F,VF,VFi);
   vertex_triangle_adjacency(Vdummy,F,VF,VFi);
@@ -142,7 +142,7 @@ IGL_INLINE void igl::boundary_loop(
   vector<int> Lvec;
   vector<int> Lvec;
   boundary_loop(F,Lvec);
   boundary_loop(F,Lvec);
 
 
-  L.resize(Lvec.size());
+  L.resize(Lvec.size(), 1);
   for (size_t i = 0; i < Lvec.size(); ++i)
   for (size_t i = 0; i < Lvec.size(); ++i)
     L(i) = Lvec[i];
     L(i) = Lvec[i];
 }
 }

+ 0 - 1
include/igl/bounding_box_diagonal.h

@@ -16,7 +16,6 @@ namespace igl
   //
   //
   // Inputs:
   // Inputs:
   //   V  #V by 3 list of vertex positions
   //   V  #V by 3 list of vertex positions
-  //   F  #F by 3 list of triangle indices into V
   // Returns length of bounding box diagonal
   // Returns length of bounding box diagonal
   IGL_INLINE double bounding_box_diagonal( const Eigen::MatrixXd & V);
   IGL_INLINE double bounding_box_diagonal( const Eigen::MatrixXd & V);
 }
 }

+ 6 - 2
include/igl/circumradius.cpp

@@ -13,8 +13,8 @@ template <
   typename DerivedF,
   typename DerivedF,
   typename DerivedR>
   typename DerivedR>
 IGL_INLINE void igl::circumradius(
 IGL_INLINE void igl::circumradius(
-  const Eigen::PlainObjectBase<DerivedV> & V, 
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedV> & V, 
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedR> & R)
   Eigen::PlainObjectBase<DerivedR> & R)
 {
 {
   Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> l;
   Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> l;
@@ -24,3 +24,7 @@ IGL_INLINE void igl::circumradius(
   // use formula: R=abc/(4*area) to compute the circum radius
   // use formula: R=abc/(4*area) to compute the circum radius
   R = l.col(0).array() * l.col(1).array() * l.col(2).array() / (2.0*A.array());
   R = l.col(0).array() * l.col(1).array() * l.col(2).array() / (2.0*A.array());
 }
 }
+
+#ifdef IGL_STATIC_LIBRARY
+template void igl::circumradius<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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+#endif

+ 3 - 3
include/igl/circumradius.h

@@ -17,15 +17,15 @@ namespace igl
   //   V  #V by dim list of mesh vertex positions
   //   V  #V by dim list of mesh vertex positions
   //   F  #F by 3 list of triangle indices into V
   //   F  #F by 3 list of triangle indices into V
   // Outputs:
   // Outputs:
-  //   R  #F list of circumradii
+  //   R  #F list of circumradius
   //
   //
   template <
   template <
     typename DerivedV, 
     typename DerivedV, 
     typename DerivedF,
     typename DerivedF,
     typename DerivedR>
     typename DerivedR>
   IGL_INLINE void circumradius(
   IGL_INLINE void circumradius(
-    const Eigen::PlainObjectBase<DerivedV> & V, 
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedV> & V, 
+    const Eigen::MatrixBase<DerivedF> & F,
     Eigen::PlainObjectBase<DerivedR> & R);
     Eigen::PlainObjectBase<DerivedR> & R);
 }
 }
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 20 - 19
include/igl/colon.cpp

@@ -17,7 +17,7 @@ IGL_INLINE void igl::colon(
   const H hi,
   const H hi,
   Eigen::Matrix<T,Eigen::Dynamic,1> & I)
   Eigen::Matrix<T,Eigen::Dynamic,1> & I)
 {
 {
-  const int size = ((hi-low)/step)+1;
+  const H size = ((hi-low)/step)+1;
   I = igl::LinSpaced<Eigen::Matrix<T,Eigen::Dynamic,1> >(size,low,low+step*(size-1));
   I = igl::LinSpaced<Eigen::Matrix<T,Eigen::Dynamic,1> >(size,low,low+step*(size-1));
 }
 }
 
 
@@ -43,26 +43,27 @@ IGL_INLINE Eigen::Matrix<T,Eigen::Dynamic,1> igl::colon(
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template Eigen::Matrix<int,-1,1,0,-1,1> igl::colon<int,int,int>(int, int);
-template Eigen::Matrix<int,-1,1,0,-1,1> igl::colon<int,int,long>(int,long);
-template Eigen::Matrix<int,-1,1,0,-1,1> igl::colon<int,int,long long int>(int,long long int);
+template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::colon<int, int, int>(int, int);
+template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::colon<int, int, long>(int, long);
+template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::colon<int, int, long long int>(int, long long int);
 template Eigen::Matrix<double, -1, 1, 0, -1, 1> igl::colon<double, double, double>(double, double);
 template Eigen::Matrix<double, -1, 1, 0, -1, 1> igl::colon<double, double, double>(double, double);
+template void igl::colon<int, long, double>(int, long, Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template void igl::colon<int, long, int, int>(int, long, int, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
-template void igl::colon<int, int, long, int>(int, int, long, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
-template void igl::colon<int, long, int>(int, long, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
-template void igl::colon<int, int, int>(int, int, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
-template void igl::colon<int,long long int,int>(int,long long int,Eigen::Matrix<int,-1,1,0,-1,1> &);
-template void igl::colon<int, int, int, int>(int, int, int, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
-template void igl::colon<int, long, long>(int, long, Eigen::Matrix<long, -1, 1, 0, -1, 1>&);
-template void igl::colon<int, double, double, double>(int, double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
-template void igl::colon<double, double, double>(double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
-template void igl::colon<double, double, double, double>(double, double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
-template void igl::colon<int, int, long>(int, int, Eigen::Matrix<long, -1, 1, 0, -1, 1>&);
-template void igl::colon<int, long, double>(int, long, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
+template void igl::colon<int, long, int, int>(int, long, int, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
+template void igl::colon<int, int, long, int>(int, int, long, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
+template void igl::colon<int, long, int>(int, long, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
+template void igl::colon<int, int, int>(int, int, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
+template void igl::colon<int, long long int, int>(int, long long int, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
+template void igl::colon<int, int, int, int>(int, int, int, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
+template void igl::colon<int, long, long>(int, long, Eigen::Matrix<long, -1, 1, 0, -1, 1> &);
+template void igl::colon<int, double, double, double>(int, double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
+template void igl::colon<double, double, double>(double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
+template void igl::colon<double, double, double, double>(double, double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
+template void igl::colon<int, int, long>(int, int, Eigen::Matrix<long, -1, 1, 0, -1, 1> &);
+template void igl::colon<int, int, double>(int, int, Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
 #ifdef WIN32
 #ifdef WIN32
-template void igl::colon<int, long long,long>(int, long long, class Eigen::Matrix<long,-1,1,0,-1,1> &);
+template void igl::colon<int, __int64, double>(int, __int64, class Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
+template void igl::colon<int, long long, long>(int, long long, class Eigen::Matrix<long, -1, 1, 0, -1, 1> &);
 template void igl::colon<int, __int64, __int64>(int, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1> &);
 template void igl::colon<int, __int64, __int64>(int, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1> &);
-template void igl::colon<int,__int64,double>(int,__int64,class Eigen::Matrix<double,-1,1,0,-1,1> &);
-#endif
 #endif
 #endif
+#endif

+ 14 - 14
include/igl/comb_cross_field.cpp

@@ -23,10 +23,10 @@ namespace igl {
   {
   {
   public:
   public:
 
 
-    const Eigen::PlainObjectBase<DerivedV> &V;
-    const Eigen::PlainObjectBase<DerivedF> &F;
-    const Eigen::PlainObjectBase<DerivedV> &PD1;
-    const Eigen::PlainObjectBase<DerivedV> &PD2;
+    const Eigen::MatrixBase<DerivedV> &V;
+    const Eigen::MatrixBase<DerivedF> &F;
+    const Eigen::MatrixBase<DerivedV> &PD1;
+    const Eigen::MatrixBase<DerivedV> &PD2;
     DerivedV N;
     DerivedV N;
 
 
   private:
   private:
@@ -61,10 +61,10 @@ namespace igl {
 
 
 
 
   public:
   public:
-    inline Comb(const Eigen::PlainObjectBase<DerivedV> &_V,
-         const Eigen::PlainObjectBase<DerivedF> &_F,
-         const Eigen::PlainObjectBase<DerivedV> &_PD1,
-         const Eigen::PlainObjectBase<DerivedV> &_PD2
+    inline Comb(const Eigen::MatrixBase<DerivedV> &_V,
+         const Eigen::MatrixBase<DerivedF> &_F,
+         const Eigen::MatrixBase<DerivedV> &_PD1,
+         const Eigen::MatrixBase<DerivedV> &_PD2
          ):
          ):
     V(_V),
     V(_V),
     F(_F),
     F(_F),
@@ -137,10 +137,10 @@ namespace igl {
   };
   };
 }
 }
 template <typename DerivedV, typename DerivedF>
 template <typename DerivedV, typename DerivedF>
-IGL_INLINE void igl::comb_cross_field(const Eigen::PlainObjectBase<DerivedV> &V,
-                                      const Eigen::PlainObjectBase<DerivedF> &F,
-                                      const Eigen::PlainObjectBase<DerivedV> &PD1,
-                                      const Eigen::PlainObjectBase<DerivedV> &PD2,
+IGL_INLINE void igl::comb_cross_field(const Eigen::MatrixBase<DerivedV> &V,
+                                      const Eigen::MatrixBase<DerivedF> &F,
+                                      const Eigen::MatrixBase<DerivedV> &PD1,
+                                      const Eigen::MatrixBase<DerivedV> &PD2,
                                       Eigen::PlainObjectBase<DerivedV> &PD1out,
                                       Eigen::PlainObjectBase<DerivedV> &PD1out,
                                       Eigen::PlainObjectBase<DerivedV> &PD2out)
                                       Eigen::PlainObjectBase<DerivedV> &PD2out)
 {
 {
@@ -150,6 +150,6 @@ IGL_INLINE void igl::comb_cross_field(const Eigen::PlainObjectBase<DerivedV> &V,
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::comb_cross_field<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
-template void igl::comb_cross_field<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> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::comb_cross_field<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
+template void igl::comb_cross_field<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 4 - 4
include/igl/comb_cross_field.h

@@ -27,10 +27,10 @@ namespace igl
   
   
   
   
   template <typename DerivedV, typename DerivedF>
   template <typename DerivedV, typename DerivedF>
-  IGL_INLINE void comb_cross_field(const Eigen::PlainObjectBase<DerivedV> &V,
-                                   const Eigen::PlainObjectBase<DerivedF> &F,
-                                   const Eigen::PlainObjectBase<DerivedV> &PD1in,
-                                   const Eigen::PlainObjectBase<DerivedV> &PD2in,
+  IGL_INLINE void comb_cross_field(const Eigen::MatrixBase<DerivedV> &V,
+                                   const Eigen::MatrixBase<DerivedF> &F,
+                                   const Eigen::MatrixBase<DerivedV> &PD1in,
+                                   const Eigen::MatrixBase<DerivedV> &PD2in,
                                    Eigen::PlainObjectBase<DerivedV> &PD1out,
                                    Eigen::PlainObjectBase<DerivedV> &PD1out,
                                    Eigen::PlainObjectBase<DerivedV> &PD2out);
                                    Eigen::PlainObjectBase<DerivedV> &PD2out);
 }
 }

+ 8 - 8
include/igl/comb_frame_field.cpp

@@ -16,12 +16,12 @@
 #include "PI.h"
 #include "PI.h"
 
 
 template <typename DerivedV, typename DerivedF, typename DerivedP>
 template <typename DerivedV, typename DerivedF, typename DerivedP>
-IGL_INLINE void igl::comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
-                                      const Eigen::PlainObjectBase<DerivedF> &F,
-                                      const Eigen::PlainObjectBase<DerivedP> &PD1,
-                                      const Eigen::PlainObjectBase<DerivedP> &PD2,
-                                      const Eigen::PlainObjectBase<DerivedP> &BIS1_combed,
-                                      const Eigen::PlainObjectBase<DerivedP> &BIS2_combed,
+IGL_INLINE void igl::comb_frame_field(const Eigen::MatrixBase<DerivedV> &V,
+                                      const Eigen::MatrixBase<DerivedF> &F,
+                                      const Eigen::MatrixBase<DerivedP> &PD1,
+                                      const Eigen::MatrixBase<DerivedP> &PD2,
+                                      const Eigen::MatrixBase<DerivedP> &BIS1_combed,
+                                      const Eigen::MatrixBase<DerivedP> &BIS2_combed,
                                       Eigen::PlainObjectBase<DerivedP> &PD1_combed,
                                       Eigen::PlainObjectBase<DerivedP> &PD1_combed,
                                       Eigen::PlainObjectBase<DerivedP> &PD2_combed)
                                       Eigen::PlainObjectBase<DerivedP> &PD2_combed)
 {
 {
@@ -73,6 +73,6 @@ IGL_INLINE void igl::comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::comb_frame_field<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
-template void igl::comb_frame_field<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::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> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::comb_frame_field<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
+template void igl::comb_frame_field<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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 6 - 6
include/igl/comb_frame_field.h

@@ -31,12 +31,12 @@ namespace igl
 
 
 
 
   template <typename DerivedV, typename DerivedF, typename DerivedP>
   template <typename DerivedV, typename DerivedF, typename DerivedP>
-  IGL_INLINE void comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
-                                        const Eigen::PlainObjectBase<DerivedF> &F,
-                                        const Eigen::PlainObjectBase<DerivedP> &PD1,
-                                        const Eigen::PlainObjectBase<DerivedP> &PD2,
-                                        const Eigen::PlainObjectBase<DerivedP> &BIS1_combed,
-                                        const Eigen::PlainObjectBase<DerivedP> &BIS2_combed,
+  IGL_INLINE void comb_frame_field(const Eigen::MatrixBase<DerivedV> &V,
+                                        const Eigen::MatrixBase<DerivedF> &F,
+                                        const Eigen::MatrixBase<DerivedP> &PD1,
+                                        const Eigen::MatrixBase<DerivedP> &PD2,
+                                        const Eigen::MatrixBase<DerivedP> &BIS1_combed,
+                                        const Eigen::MatrixBase<DerivedP> &BIS2_combed,
                                         Eigen::PlainObjectBase<DerivedP> &PD1_combed,
                                         Eigen::PlainObjectBase<DerivedP> &PD1_combed,
                                         Eigen::PlainObjectBase<DerivedP> &PD2_combed);
                                         Eigen::PlainObjectBase<DerivedP> &PD2_combed);
 }
 }

+ 9 - 9
include/igl/comb_line_field.cpp

@@ -22,9 +22,9 @@ class CombLine
 {
 {
 public:
 public:
 
 
-    const Eigen::PlainObjectBase<DerivedV> &V;
-    const Eigen::PlainObjectBase<DerivedF> &F;
-    const Eigen::PlainObjectBase<DerivedV> &PD1;
+    const Eigen::MatrixBase<DerivedV> &V;
+    const Eigen::MatrixBase<DerivedF> &F;
+    const Eigen::MatrixBase<DerivedV> &PD1;
     DerivedV N;
     DerivedV N;
 
 
 private:
 private:
@@ -57,9 +57,9 @@ private:
 
 
 public:
 public:
 
 
-    inline CombLine(const Eigen::PlainObjectBase<DerivedV> &_V,
-                    const Eigen::PlainObjectBase<DerivedF> &_F,
-                    const Eigen::PlainObjectBase<DerivedV> &_PD1):
+    inline CombLine(const Eigen::MatrixBase<DerivedV> &_V,
+                    const Eigen::MatrixBase<DerivedF> &_F,
+                    const Eigen::MatrixBase<DerivedV> &_PD1):
         V(_V),
         V(_V),
         F(_F),
         F(_F),
         PD1(_PD1)
         PD1(_PD1)
@@ -118,9 +118,9 @@ public:
 }
 }
 
 
 template <typename DerivedV, typename DerivedF>
 template <typename DerivedV, typename DerivedF>
-IGL_INLINE void igl::comb_line_field(const Eigen::PlainObjectBase<DerivedV> &V,
-                                     const Eigen::PlainObjectBase<DerivedF> &F,
-                                     const Eigen::PlainObjectBase<DerivedV> &PD1,
+IGL_INLINE void igl::comb_line_field(const Eigen::MatrixBase<DerivedV> &V,
+                                     const Eigen::MatrixBase<DerivedF> &F,
+                                     const Eigen::MatrixBase<DerivedV> &PD1,
                                      Eigen::PlainObjectBase<DerivedV> &PD1out)
                                      Eigen::PlainObjectBase<DerivedV> &PD1out)
 {
 {
     igl::CombLine<DerivedV, DerivedF> cmb(V, F, PD1);
     igl::CombLine<DerivedV, DerivedF> cmb(V, F, PD1);

+ 3 - 6
include/igl/comb_line_field.h

@@ -19,17 +19,14 @@ namespace igl
   //   V          #V by 3 eigen Matrix of mesh vertex 3D positions
   //   V          #V by 3 eigen Matrix of mesh vertex 3D positions
   //   F          #F by 4 eigen Matrix of face (quad) indices
   //   F          #F by 4 eigen Matrix of face (quad) indices
   //   PD1in      #F by 3 eigen Matrix of the first per face cross field vector
   //   PD1in      #F by 3 eigen Matrix of the first per face cross field vector
-  //   PD2in      #F by 3 eigen Matrix of the second per face cross field vector
   // Output:
   // Output:
   //   PD1out      #F by 3 eigen Matrix of the first combed cross field vector
   //   PD1out      #F by 3 eigen Matrix of the first combed cross field vector
-  //   PD2out      #F by 3 eigen Matrix of the second combed cross field vector
-  //
 
 
 
 
   template <typename DerivedV, typename DerivedF>
   template <typename DerivedV, typename DerivedF>
-  IGL_INLINE void comb_line_field(const Eigen::PlainObjectBase<DerivedV> &V,
-                                  const Eigen::PlainObjectBase<DerivedF> &F,
-                                  const Eigen::PlainObjectBase<DerivedV> &PD1in,
+  IGL_INLINE void comb_line_field(const Eigen::MatrixBase<DerivedV> &V,
+                                  const Eigen::MatrixBase<DerivedF> &F,
+                                  const Eigen::MatrixBase<DerivedV> &PD1in,
                                   Eigen::PlainObjectBase<DerivedV> &PD1out);
                                   Eigen::PlainObjectBase<DerivedV> &PD1out);
 }
 }
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 13 - 13
include/igl/compute_frame_field_bisectors.cpp

@@ -17,12 +17,12 @@
 
 
 template <typename DerivedV, typename DerivedF>
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::compute_frame_field_bisectors(
 IGL_INLINE void igl::compute_frame_field_bisectors(
-  const Eigen::PlainObjectBase<DerivedV>& V,
-  const Eigen::PlainObjectBase<DerivedF>& F,
-  const Eigen::PlainObjectBase<DerivedV>& B1,
-  const Eigen::PlainObjectBase<DerivedV>& B2,
-  const Eigen::PlainObjectBase<DerivedV>& PD1,
-  const Eigen::PlainObjectBase<DerivedV>& PD2,
+  const Eigen::MatrixBase<DerivedV>& V,
+  const Eigen::MatrixBase<DerivedF>& F,
+  const Eigen::MatrixBase<DerivedV>& B1,
+  const Eigen::MatrixBase<DerivedV>& B2,
+  const Eigen::MatrixBase<DerivedV>& PD1,
+  const Eigen::MatrixBase<DerivedV>& PD2,
   Eigen::PlainObjectBase<DerivedV>& BIS1,
   Eigen::PlainObjectBase<DerivedV>& BIS1,
   Eigen::PlainObjectBase<DerivedV>& BIS2)
   Eigen::PlainObjectBase<DerivedV>& BIS2)
 {
 {
@@ -64,10 +64,10 @@ IGL_INLINE void igl::compute_frame_field_bisectors(
 
 
 template <typename DerivedV, typename DerivedF>
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::compute_frame_field_bisectors(
 IGL_INLINE void igl::compute_frame_field_bisectors(
-                                                   const Eigen::PlainObjectBase<DerivedV>& V,
-                                                   const Eigen::PlainObjectBase<DerivedF>& F,
-                                                   const Eigen::PlainObjectBase<DerivedV>& PD1,
-                                                   const Eigen::PlainObjectBase<DerivedV>& PD2,
+                                                   const Eigen::MatrixBase<DerivedV>& V,
+                                                   const Eigen::MatrixBase<DerivedF>& F,
+                                                   const Eigen::MatrixBase<DerivedV>& PD1,
+                                                   const Eigen::MatrixBase<DerivedV>& PD2,
                                                    Eigen::PlainObjectBase<DerivedV>& BIS1,
                                                    Eigen::PlainObjectBase<DerivedV>& BIS1,
                                                    Eigen::PlainObjectBase<DerivedV>& BIS2)
                                                    Eigen::PlainObjectBase<DerivedV>& BIS2)
 {
 {
@@ -80,7 +80,7 @@ IGL_INLINE void igl::compute_frame_field_bisectors(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::compute_frame_field_bisectors<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
-template void igl::compute_frame_field_bisectors<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> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
-template void igl::compute_frame_field_bisectors<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> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::compute_frame_field_bisectors<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
+template void igl::compute_frame_field_bisectors<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::compute_frame_field_bisectors<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 10 - 10
include/igl/compute_frame_field_bisectors.h

@@ -26,22 +26,22 @@ namespace igl
   //
   //
   template <typename DerivedV, typename DerivedF>
   template <typename DerivedV, typename DerivedF>
   IGL_INLINE void compute_frame_field_bisectors(
   IGL_INLINE void compute_frame_field_bisectors(
-                                                const Eigen::PlainObjectBase<DerivedV>& V,
-                                                const Eigen::PlainObjectBase<DerivedF>& F,
-                                                const Eigen::PlainObjectBase<DerivedV>& B1,
-                                                const Eigen::PlainObjectBase<DerivedV>& B2,
-                                                const Eigen::PlainObjectBase<DerivedV>& PD1,
-                                                const Eigen::PlainObjectBase<DerivedV>& PD2,
+                                                const Eigen::MatrixBase<DerivedV>& V,
+                                                const Eigen::MatrixBase<DerivedF>& F,
+                                                const Eigen::MatrixBase<DerivedV>& B1,
+                                                const Eigen::MatrixBase<DerivedV>& B2,
+                                                const Eigen::MatrixBase<DerivedV>& PD1,
+                                                const Eigen::MatrixBase<DerivedV>& PD2,
                                                 Eigen::PlainObjectBase<DerivedV>& BIS1,
                                                 Eigen::PlainObjectBase<DerivedV>& BIS1,
                                                 Eigen::PlainObjectBase<DerivedV>& BIS2);
                                                 Eigen::PlainObjectBase<DerivedV>& BIS2);
 
 
   // Wrapper without given basis vectors.
   // Wrapper without given basis vectors.
   template <typename DerivedV, typename DerivedF>
   template <typename DerivedV, typename DerivedF>
   IGL_INLINE void compute_frame_field_bisectors(
   IGL_INLINE void compute_frame_field_bisectors(
-                                                const Eigen::PlainObjectBase<DerivedV>& V,
-                                                const Eigen::PlainObjectBase<DerivedF>& F,
-                                                const Eigen::PlainObjectBase<DerivedV>& PD1,
-                                                const Eigen::PlainObjectBase<DerivedV>& PD2,
+                                                const Eigen::MatrixBase<DerivedV>& V,
+                                                const Eigen::MatrixBase<DerivedF>& F,
+                                                const Eigen::MatrixBase<DerivedV>& PD1,
+                                                const Eigen::MatrixBase<DerivedV>& PD2,
                                                 Eigen::PlainObjectBase<DerivedV>& BIS1,
                                                 Eigen::PlainObjectBase<DerivedV>& BIS1,
                                                 Eigen::PlainObjectBase<DerivedV>& BIS2);
                                                 Eigen::PlainObjectBase<DerivedV>& BIS2);
 }
 }

+ 5 - 5
include/igl/connect_boundary_to_infinity.cpp

@@ -10,14 +10,14 @@
 
 
 template <typename DerivedF, typename DerivedFO>
 template <typename DerivedF, typename DerivedFO>
 IGL_INLINE void igl::connect_boundary_to_infinity(
 IGL_INLINE void igl::connect_boundary_to_infinity(
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedFO> & FO)
   Eigen::PlainObjectBase<DerivedFO> & FO)
 {
 {
   return connect_boundary_to_infinity(F,F.maxCoeff(),FO);
   return connect_boundary_to_infinity(F,F.maxCoeff(),FO);
 }
 }
 template <typename DerivedF, typename DerivedFO>
 template <typename DerivedF, typename DerivedFO>
 IGL_INLINE void igl::connect_boundary_to_infinity(
 IGL_INLINE void igl::connect_boundary_to_infinity(
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedF> & F,
   const typename DerivedF::Scalar inf_index,
   const typename DerivedF::Scalar inf_index,
   Eigen::PlainObjectBase<DerivedFO> & FO)
   Eigen::PlainObjectBase<DerivedFO> & FO)
 {
 {
@@ -37,8 +37,8 @@ template <
   typename DerivedVO, 
   typename DerivedVO, 
   typename DerivedFO>
   typename DerivedFO>
 IGL_INLINE void igl::connect_boundary_to_infinity(
 IGL_INLINE void igl::connect_boundary_to_infinity(
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedVO> & VO,
   Eigen::PlainObjectBase<DerivedVO> & VO,
   Eigen::PlainObjectBase<DerivedFO> & FO)
   Eigen::PlainObjectBase<DerivedFO> & FO)
 {
 {
@@ -51,5 +51,5 @@ IGL_INLINE void igl::connect_boundary_to_infinity(
 }
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
-template void igl::connect_boundary_to_infinity<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> >(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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::connect_boundary_to_infinity<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> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 4 - 4
include/igl/connect_boundary_to_infinity.h

@@ -22,13 +22,13 @@ namespace igl
   //     edge-manifold).
   //     edge-manifold).
   template <typename DerivedF, typename DerivedFO>
   template <typename DerivedF, typename DerivedFO>
   IGL_INLINE void connect_boundary_to_infinity(
   IGL_INLINE void connect_boundary_to_infinity(
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedF> & F,
     Eigen::PlainObjectBase<DerivedFO> & FO);
     Eigen::PlainObjectBase<DerivedFO> & FO);
   // Inputs:
   // Inputs:
   //   inf_index  index of point at infinity (usually V.rows() or F.maxCoeff())
   //   inf_index  index of point at infinity (usually V.rows() or F.maxCoeff())
   template <typename DerivedF, typename DerivedFO>
   template <typename DerivedF, typename DerivedFO>
   IGL_INLINE void connect_boundary_to_infinity(
   IGL_INLINE void connect_boundary_to_infinity(
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedF> & F,
     const typename DerivedF::Scalar inf_index,
     const typename DerivedF::Scalar inf_index,
     Eigen::PlainObjectBase<DerivedFO> & FO);
     Eigen::PlainObjectBase<DerivedFO> & FO);
   // Inputs:
   // Inputs:
@@ -45,8 +45,8 @@ namespace igl
     typename DerivedVO, 
     typename DerivedVO, 
     typename DerivedFO>
     typename DerivedFO>
   IGL_INLINE void connect_boundary_to_infinity(
   IGL_INLINE void connect_boundary_to_infinity(
-    const Eigen::PlainObjectBase<DerivedV> & V,
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedF> & F,
     Eigen::PlainObjectBase<DerivedVO> & VO,
     Eigen::PlainObjectBase<DerivedVO> & VO,
     Eigen::PlainObjectBase<DerivedFO> & FO);
     Eigen::PlainObjectBase<DerivedFO> & FO);
 }
 }

+ 13 - 13
include/igl/copyleft/tetgen/tetrahedralize.cpp

@@ -78,10 +78,10 @@ template <
   typename DerivedTF,
   typename DerivedTF,
   typename DerivedTR>
   typename DerivedTR>
 IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
 IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
-  const Eigen::PlainObjectBase<DerivedV>& V,
-  const Eigen::PlainObjectBase<DerivedF>& F,
-  const Eigen::PlainObjectBase<DerivedH>& H,
-  const Eigen::PlainObjectBase<DerivedR>& R,
+  const Eigen::MatrixBase<DerivedV>& V,
+  const Eigen::MatrixBase<DerivedF>& F,
+  const Eigen::MatrixBase<DerivedH>& H,
+  const Eigen::MatrixBase<DerivedR>& R,
   const std::string switches,
   const std::string switches,
   Eigen::PlainObjectBase<DerivedTV>& TV,
   Eigen::PlainObjectBase<DerivedTV>& TV,
   Eigen::PlainObjectBase<DerivedTT>& TT,
   Eigen::PlainObjectBase<DerivedTT>& TT,
@@ -191,8 +191,8 @@ template <
   typename DerivedTT,
   typename DerivedTT,
   typename DerivedTF>
   typename DerivedTF>
 IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
 IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
-  const Eigen::PlainObjectBase<DerivedV>& V,
-  const Eigen::PlainObjectBase<DerivedF>& F,
+  const Eigen::MatrixBase<DerivedV>& V,
+  const Eigen::MatrixBase<DerivedF>& F,
   const std::string switches,
   const std::string switches,
   Eigen::PlainObjectBase<DerivedTV>& TV,
   Eigen::PlainObjectBase<DerivedTV>& TV,
   Eigen::PlainObjectBase<DerivedTT>& TT,
   Eigen::PlainObjectBase<DerivedTT>& TT,
@@ -235,10 +235,10 @@ template <
   typename DerivedTF,
   typename DerivedTF,
   typename DerivedTM>
   typename DerivedTM>
 IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
 IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
-  const Eigen::PlainObjectBase<DerivedV>& V,
-  const Eigen::PlainObjectBase<DerivedF>& F,
-  const Eigen::PlainObjectBase<DerivedVM>& VM,
-  const Eigen::PlainObjectBase<DerivedFM>& FM,
+  const Eigen::MatrixBase<DerivedV>& V,
+  const Eigen::MatrixBase<DerivedF>& F,
+  const Eigen::MatrixBase<DerivedVM>& VM,
+  const Eigen::MatrixBase<DerivedFM>& FM,
   const std::string switches,
   const std::string switches,
   Eigen::PlainObjectBase<DerivedTV>& TV,
   Eigen::PlainObjectBase<DerivedTV>& TV,
   Eigen::PlainObjectBase<DerivedTT>& TT,
   Eigen::PlainObjectBase<DerivedTT>& TT,
@@ -339,7 +339,7 @@ IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template int igl::copyleft::tetgen::tetrahedralize<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>, 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&, 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> >&);
-template int igl::copyleft::tetgen::tetrahedralize<Eigen::Matrix<double, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -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>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, 1, 0, -1, 1> >(const 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<int, -1, 1, 0, -1, 1> > &,const Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > &,const 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> > &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > &);
-template int igl::copyleft::tetgen::tetrahedralize<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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>, Eigen::Matrix<int, -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<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, 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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template int igl::copyleft::tetgen::tetrahedralize<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>, Eigen::Matrix<int, -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&, 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> >&);
+template int igl::copyleft::tetgen::tetrahedralize<Eigen::Matrix<double, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -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>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, 1, 0, -1, 1> >(const Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > &,const Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > &,const Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > &,const Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > &,const 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> > &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > &);
+template int igl::copyleft::tetgen::tetrahedralize<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, 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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 10 - 10
include/igl/copyleft/tetgen/tetrahedralize.h

@@ -61,8 +61,8 @@ namespace igl
         typename DerivedTT, 
         typename DerivedTT, 
         typename DerivedTF>
         typename DerivedTF>
       IGL_INLINE int tetrahedralize(
       IGL_INLINE int tetrahedralize(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
+        const Eigen::MatrixBase<DerivedV>& V,
+        const Eigen::MatrixBase<DerivedF>& F,
         const std::string switches,
         const std::string switches,
         Eigen::PlainObjectBase<DerivedTV>& TV,
         Eigen::PlainObjectBase<DerivedTV>& TV,
         Eigen::PlainObjectBase<DerivedTT>& TT,
         Eigen::PlainObjectBase<DerivedTT>& TT,
@@ -114,10 +114,10 @@ namespace igl
         typename DerivedTF, 
         typename DerivedTF, 
         typename DerivedTM>
         typename DerivedTM>
       IGL_INLINE int tetrahedralize(
       IGL_INLINE int tetrahedralize(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedVM>& VM,
-        const Eigen::PlainObjectBase<DerivedFM>& FM,
+        const Eigen::MatrixBase<DerivedV>& V,
+        const Eigen::MatrixBase<DerivedF>& F,
+        const Eigen::MatrixBase<DerivedVM>& VM,
+        const Eigen::MatrixBase<DerivedFM>& FM,
         const std::string switches,
         const std::string switches,
         Eigen::PlainObjectBase<DerivedTV>& TV,
         Eigen::PlainObjectBase<DerivedTV>& TV,
         Eigen::PlainObjectBase<DerivedTT>& TT,
         Eigen::PlainObjectBase<DerivedTT>& TT,
@@ -185,10 +185,10 @@ namespace igl
 	typename DerivedTF,
 	typename DerivedTF,
 	typename DerivedTR>	
 	typename DerivedTR>	
       IGL_INLINE int tetrahedralize(
       IGL_INLINE int tetrahedralize(
-	const Eigen::PlainObjectBase<DerivedV>& V,
-	const Eigen::PlainObjectBase<DerivedF>& F,
-	const Eigen::PlainObjectBase<DerivedH>& H,
-	const Eigen::PlainObjectBase<DerivedR>& R,
+	const Eigen::MatrixBase<DerivedV>& V,
+	const Eigen::MatrixBase<DerivedF>& F,
+	const Eigen::MatrixBase<DerivedH>& H,
+	const Eigen::MatrixBase<DerivedR>& R,
 	const std::string switches,
 	const std::string switches,
 	Eigen::PlainObjectBase<DerivedTV>& TV,
 	Eigen::PlainObjectBase<DerivedTV>& TV,
         Eigen::PlainObjectBase<DerivedTT>& TT,
         Eigen::PlainObjectBase<DerivedTT>& TT,

+ 26 - 24
include/igl/cross.cpp

@@ -1,45 +1,47 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "cross.h"
 #include "cross.h"
 
 
 // http://www.antisphere.com/Wiki/tools:anttweakbar
 // http://www.antisphere.com/Wiki/tools:anttweakbar
 IGL_INLINE void igl::cross(
 IGL_INLINE void igl::cross(
-  const double *a, 
-  const double *b,
-  double *out)
+    const double *a,
+    const double *b,
+    double *out)
 {
 {
-  out[0] = a[1]*b[2]-a[2]*b[1];
-  out[1] = a[2]*b[0]-a[0]*b[2];
-  out[2] = a[0]*b[1]-a[1]*b[0];
+  out[0] = a[1] * b[2] - a[2] * b[1];
+  out[1] = a[2] * b[0] - a[0] * b[2];
+  out[2] = a[0] * b[1] - a[1] * b[0];
 }
 }
 
 
 template <
 template <
-  typename DerivedA,
-  typename DerivedB,
-  typename DerivedC>
+    typename DerivedA,
+    typename DerivedB,
+    typename DerivedC>
 IGL_INLINE void igl::cross(
 IGL_INLINE void igl::cross(
-  const Eigen::PlainObjectBase<DerivedA> & A,
-  const Eigen::PlainObjectBase<DerivedB> & B,
-  Eigen::PlainObjectBase<DerivedC> & C)
+    const Eigen::PlainObjectBase<DerivedA> &A,
+    const Eigen::PlainObjectBase<DerivedB> &B,
+    Eigen::PlainObjectBase<DerivedC> &C)
 {
 {
   assert(A.cols() == 3 && "#cols should be 3");
   assert(A.cols() == 3 && "#cols should be 3");
   assert(B.cols() == 3 && "#cols should be 3");
   assert(B.cols() == 3 && "#cols should be 3");
   assert(A.rows() == B.rows() && "#rows in A and B should be equal");
   assert(A.rows() == B.rows() && "#rows in A and B should be equal");
-  C.resize(A.rows(),3);
-  for(int d = 0;d<3;d++)
+  C.resize(A.rows(), 3);
+  for (int d = 0; d < 3; d++)
   {
   {
-    C.col(d) = 
-      A.col((d+1)%3).array() * B.col((d+2)%3).array() -
-      A.col((d+2)%3).array() * B.col((d+1)%3).array();
+    C.col(d) =
+        A.col((d + 1) % 3).array() * B.col((d + 2) % 3).array() -
+        A.col((d + 2) % 3).array() * B.col((d + 1) % 3).array();
   }
   }
 }
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
-template void igl::cross<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
-template void igl::cross<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
-#endif
+template void igl::cross<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> &);
+template void igl::cross<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>>(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> &);
+template void igl::cross<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1>> &);
+template void igl::cross<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3>> &);
+#endif

+ 15 - 15
include/igl/cross_field_mismatch.cpp

@@ -25,10 +25,10 @@ namespace igl {
   {
   {
   public:
   public:
 
 
-    const Eigen::PlainObjectBase<DerivedV> &V;
-    const Eigen::PlainObjectBase<DerivedF> &F;
-    const Eigen::PlainObjectBase<DerivedV> &PD1;
-    const Eigen::PlainObjectBase<DerivedV> &PD2;
+    const Eigen::MatrixBase<DerivedV> &V;
+    const Eigen::MatrixBase<DerivedF> &F;
+    const Eigen::MatrixBase<DerivedV> &PD1;
+    const Eigen::MatrixBase<DerivedV> &PD2;
     
     
     DerivedV N;
     DerivedV N;
 
 
@@ -69,10 +69,10 @@ namespace igl {
 
 
 
 
 public:
 public:
-  inline MismatchCalculator(const Eigen::PlainObjectBase<DerivedV> &_V,
-                            const Eigen::PlainObjectBase<DerivedF> &_F,
-                            const Eigen::PlainObjectBase<DerivedV> &_PD1,
-                            const Eigen::PlainObjectBase<DerivedV> &_PD2):
+  inline MismatchCalculator(const Eigen::MatrixBase<DerivedV> &_V,
+                            const Eigen::MatrixBase<DerivedF> &_F,
+                            const Eigen::MatrixBase<DerivedV> &_PD1,
+                            const Eigen::MatrixBase<DerivedV> &_PD2):
   V(_V),
   V(_V),
   F(_F),
   F(_F),
   PD1(_PD1),
   PD1(_PD1),
@@ -102,10 +102,10 @@ public:
 };
 };
 }
 }
 template <typename DerivedV, typename DerivedF, typename DerivedM>
 template <typename DerivedV, typename DerivedF, typename DerivedM>
-IGL_INLINE void igl::cross_field_mismatch(const Eigen::PlainObjectBase<DerivedV> &V,
-                                          const Eigen::PlainObjectBase<DerivedF> &F,
-                                          const Eigen::PlainObjectBase<DerivedV> &PD1,
-                                          const Eigen::PlainObjectBase<DerivedV> &PD2,
+IGL_INLINE void igl::cross_field_mismatch(const Eigen::MatrixBase<DerivedV> &V,
+                                          const Eigen::MatrixBase<DerivedF> &F,
+                                          const Eigen::MatrixBase<DerivedV> &PD1,
+                                          const Eigen::MatrixBase<DerivedV> &PD2,
                                           const bool isCombed,
                                           const bool isCombed,
                                           Eigen::PlainObjectBase<DerivedM> &mismatch)
                                           Eigen::PlainObjectBase<DerivedM> &mismatch)
 {
 {
@@ -125,8 +125,8 @@ IGL_INLINE void igl::cross_field_mismatch(const Eigen::PlainObjectBase<DerivedV>
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::cross_field_mismatch<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const &,  Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const &,  Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const &, const bool,  Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > &);
-template void igl::cross_field_mismatch<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> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, const bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > &);
-template void igl::cross_field_mismatch<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(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> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, const bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > &);
+template void igl::cross_field_mismatch<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const &, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const &,  Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const &,  Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const &, const bool,  Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > &);
+template void igl::cross_field_mismatch<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, const bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > &);
+template void igl::cross_field_mismatch<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const &, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, const bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > &);
 
 
 #endif
 #endif

+ 4 - 4
include/igl/cross_field_mismatch.h

@@ -29,10 +29,10 @@ namespace igl
   //
   //
 
 
   template <typename DerivedV, typename DerivedF, typename DerivedM>
   template <typename DerivedV, typename DerivedF, typename DerivedM>
-  IGL_INLINE void cross_field_mismatch(const Eigen::PlainObjectBase<DerivedV> &V,
-                                       const Eigen::PlainObjectBase<DerivedF> &F,
-                                       const Eigen::PlainObjectBase<DerivedV> &PD1,
-                                       const Eigen::PlainObjectBase<DerivedV> &PD2,
+  IGL_INLINE void cross_field_mismatch(const Eigen::MatrixBase<DerivedV> &V,
+                                       const Eigen::MatrixBase<DerivedF> &F,
+                                       const Eigen::MatrixBase<DerivedV> &PD1,
+                                       const Eigen::MatrixBase<DerivedV> &PD2,
                                        const bool isCombed,
                                        const bool isCombed,
                                        Eigen::PlainObjectBase<DerivedM> &mismatch);
                                        Eigen::PlainObjectBase<DerivedM> &mismatch);
 }
 }

+ 11 - 11
include/igl/crouzeix_raviart_cotmatrix.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2017 Alec Jacobson <[email protected]>
 // Copyright (C) 2017 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "crouzeix_raviart_cotmatrix.h"
 #include "crouzeix_raviart_cotmatrix.h"
 #include "unique_simplices.h"
 #include "unique_simplices.h"
@@ -13,14 +13,14 @@
 
 
 template <typename DerivedV, typename DerivedF, typename LT, typename DerivedE, typename DerivedEMAP>
 template <typename DerivedV, typename DerivedF, typename LT, typename DerivedE, typename DerivedEMAP>
 void igl::crouzeix_raviart_cotmatrix(
 void igl::crouzeix_raviart_cotmatrix(
-  const Eigen::MatrixBase<DerivedV> & V, 
-  const Eigen::MatrixBase<DerivedF> & F, 
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::SparseMatrix<LT> & L,
   Eigen::SparseMatrix<LT> & L,
   Eigen::PlainObjectBase<DerivedE> & E,
   Eigen::PlainObjectBase<DerivedE> & E,
   Eigen::PlainObjectBase<DerivedEMAP> & EMAP)
   Eigen::PlainObjectBase<DerivedEMAP> & EMAP)
 {
 {
   // All occurrences of directed "facets"
   // All occurrences of directed "facets"
-  Eigen::MatrixXi allE;
+  Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, Eigen::Dynamic>  allE;
   oriented_facets(F,allE);
   oriented_facets(F,allE);
   Eigen::VectorXi _1;
   Eigen::VectorXi _1;
   unique_simplices(allE,E,_1,EMAP);
   unique_simplices(allE,E,_1,EMAP);
@@ -29,8 +29,8 @@ void igl::crouzeix_raviart_cotmatrix(
 
 
 template <typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedEMAP, typename LT>
 template <typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedEMAP, typename LT>
 void igl::crouzeix_raviart_cotmatrix(
 void igl::crouzeix_raviart_cotmatrix(
-  const Eigen::MatrixBase<DerivedV> & V, 
-  const Eigen::MatrixBase<DerivedF> & F, 
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedF> & F,
   const Eigen::MatrixBase<DerivedE> & E,
   const Eigen::MatrixBase<DerivedE> & E,
   const Eigen::MatrixBase<DerivedEMAP> & EMAP,
   const Eigen::MatrixBase<DerivedEMAP> & EMAP,
   Eigen::SparseMatrix<LT> & L)
   Eigen::SparseMatrix<LT> & L)
@@ -84,8 +84,8 @@ void igl::crouzeix_raviart_cotmatrix(
     for(int c = 0;c<k;c++)
     for(int c = 0;c<k;c++)
     {
     {
       LIJV.emplace_back(
       LIJV.emplace_back(
-        EMAP(F2E(f,LI(c))),
-        EMAP(F2E(f,LJ(c))),
+        EMAP(F2E(f,LI(c)), 0),
+        EMAP(F2E(f,LJ(c)), 0),
         (c<(k/2)?-1.:1.) * factor *C(f,LV(c)));
         (c<(k/2)?-1.:1.) * factor *C(f,LV(c)));
     }
     }
   }
   }

+ 4 - 4
include/igl/crouzeix_raviart_massmatrix.cpp

@@ -18,16 +18,16 @@
 
 
 template <typename MT, typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedEMAP>
 template <typename MT, typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedEMAP>
 void igl::crouzeix_raviart_massmatrix(
 void igl::crouzeix_raviart_massmatrix(
-    const Eigen::MatrixBase<DerivedV> & V, 
+    const Eigen::MatrixBase<DerivedV> & V,
     const Eigen::MatrixBase<DerivedF> & F, 
     const Eigen::MatrixBase<DerivedF> & F, 
     Eigen::SparseMatrix<MT> & M,
     Eigen::SparseMatrix<MT> & M,
     Eigen::PlainObjectBase<DerivedE> & E,
     Eigen::PlainObjectBase<DerivedE> & E,
     Eigen::PlainObjectBase<DerivedEMAP> & EMAP)
     Eigen::PlainObjectBase<DerivedEMAP> & EMAP)
 {
 {
   // All occurrences of directed "facets"
   // All occurrences of directed "facets"
-  Eigen::MatrixXi allE;
+  Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, Eigen::Dynamic> allE;
   oriented_facets(F,allE);
   oriented_facets(F,allE);
-  Eigen::VectorXi _1;
+  Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, 1> _1;
   unique_simplices(allE,E,_1,EMAP);
   unique_simplices(allE,E,_1,EMAP);
   return crouzeix_raviart_massmatrix(V,F,E,EMAP,M);
   return crouzeix_raviart_massmatrix(V,F,E,EMAP,M);
 }
 }
@@ -69,7 +69,7 @@ void igl::crouzeix_raviart_massmatrix(
   {
   {
     for(int c = 0;c<ss;c++)
     for(int c = 0;c<ss;c++)
     {
     {
-      MIJV[f+m*c] = Triplet<MT>(EMAP(f+m*c),EMAP(f+m*c),TA(f)/(double)(ss));
+      MIJV[f+m*c] = Triplet<MT>(EMAP(f+m*c, 0),EMAP(f+m*c, 0),TA(f)/(double)(ss));
     }
     }
   }
   }
   M.resize(E.rows(),E.rows());
   M.resize(E.rows(),E.rows());

+ 3 - 3
include/igl/cut_mesh.cpp

@@ -313,9 +313,9 @@ IGL_INLINE void igl::cut_mesh(
   std::vector<std::vector<int> > VF, VFi;
   std::vector<std::vector<int> > VF, VFi;
   igl::vertex_triangle_adjacency(V,F,VF,VFi);
   igl::vertex_triangle_adjacency(V,F,VF,VFi);
   // Alec: Cast? Why? This is likely to break.
   // Alec: Cast? Why? This is likely to break.
-  Eigen::MatrixXd Vt = V;
-  Eigen::MatrixXi Ft = F;
-  Eigen::MatrixXi TT, TTi;
+  DerivedV Vt = V;
+  DerivedF Ft = F;
+  DerivedF TT, TTi;
   igl::triangle_triangle_adjacency(Ft,TT,TTi);
   igl::triangle_triangle_adjacency(Ft,TT,TTi);
   std::vector<bool> V_border = igl::is_border_vertex(V,F);
   std::vector<bool> V_border = igl::is_border_vertex(V,F);
   igl::cut_mesh(V, F, VF, VFi, TT, TTi, V_border, cuts, Vcut, Fcut);
   igl::cut_mesh(V, F, VF, VFi, TT, TTi, V_border, cuts, Vcut, Fcut);

+ 16 - 16
include/igl/cut_mesh_from_singularities.cpp

@@ -25,9 +25,9 @@ namespace igl {
   class MeshCutter
   class MeshCutter
   {
   {
   protected:
   protected:
-    const Eigen::PlainObjectBase<DerivedV> &V;
-    const Eigen::PlainObjectBase<DerivedF> &F;
-    const Eigen::PlainObjectBase<DerivedM> &Handle_MMatch;
+    const Eigen::MatrixBase<DerivedV> &V;
+    const Eigen::MatrixBase<DerivedF> &F;
+    const Eigen::MatrixBase<DerivedM> &Handle_MMatch;
 
 
     Eigen::VectorXi F_visited;
     Eigen::VectorXi F_visited;
     DerivedF TT;
     DerivedF TT;
@@ -140,9 +140,9 @@ namespace igl {
 
 
   public:
   public:
 
 
-    inline MeshCutter(const Eigen::PlainObjectBase<DerivedV> &V_,
-               const Eigen::PlainObjectBase<DerivedF> &F_,
-               const Eigen::PlainObjectBase<DerivedM> &Handle_MMatch_):
+    inline MeshCutter(const Eigen::MatrixBase<DerivedV> &V_,
+               const Eigen::MatrixBase<DerivedF> &F_,
+               const Eigen::MatrixBase<DerivedM> &Handle_MMatch_):
     V(V_),
     V(V_),
     F(F_),
     F(F_),
     Handle_MMatch(Handle_MMatch_)
     Handle_MMatch(Handle_MMatch_)
@@ -184,9 +184,9 @@ template <typename DerivedV,
   typename DerivedF,
   typename DerivedF,
   typename DerivedM,
   typename DerivedM,
   typename DerivedO>
   typename DerivedO>
-IGL_INLINE void igl::cut_mesh_from_singularities(const Eigen::PlainObjectBase<DerivedV> &V,
-                                                 const Eigen::PlainObjectBase<DerivedF> &F,
-                                                 const Eigen::PlainObjectBase<DerivedM> &Handle_MMatch,
+IGL_INLINE void igl::cut_mesh_from_singularities(const Eigen::MatrixBase<DerivedV> &V,
+                                                 const Eigen::MatrixBase<DerivedF> &F,
+                                                 const Eigen::MatrixBase<DerivedM> &Handle_MMatch,
                                                  Eigen::PlainObjectBase<DerivedO> &Handle_Seams)
                                                  Eigen::PlainObjectBase<DerivedO> &Handle_Seams)
 {
 {
   igl::MeshCutter< DerivedV, DerivedF, DerivedM, DerivedO> mc(V, F, Handle_MMatch);
   igl::MeshCutter< DerivedV, DerivedF, DerivedM, DerivedO> mc(V, F, Handle_MMatch);
@@ -195,11 +195,11 @@ IGL_INLINE void igl::cut_mesh_from_singularities(const Eigen::PlainObjectBase<De
 }
 }
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
-template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
-template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
-template void igl::cut_mesh_from_singularities<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> >(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> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
-template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
-template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(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<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
-template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(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<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
+template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
+template void igl::cut_mesh_from_singularities<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> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
+template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
 #endif
 #endif

+ 3 - 3
include/igl/cut_mesh_from_singularities.h

@@ -30,9 +30,9 @@ namespace igl
     typename DerivedM, 
     typename DerivedM, 
     typename DerivedO> 
     typename DerivedO> 
   IGL_INLINE void cut_mesh_from_singularities(
   IGL_INLINE void cut_mesh_from_singularities(
-    const Eigen::PlainObjectBase<DerivedV> &V, 
-    const Eigen::PlainObjectBase<DerivedF> &F, 
-    const Eigen::PlainObjectBase<DerivedM> &MMatch,
+    const Eigen::MatrixBase<DerivedV> &V, 
+    const Eigen::MatrixBase<DerivedF> &F, 
+    const Eigen::MatrixBase<DerivedM> &MMatch,
     Eigen::PlainObjectBase<DerivedO> &seams);
     Eigen::PlainObjectBase<DerivedO> &seams);
 }
 }
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 6 - 6
include/igl/dihedral_angles.cpp

@@ -17,8 +17,8 @@ template <
   typename Derivedtheta,
   typename Derivedtheta,
   typename Derivedcos_theta>
   typename Derivedcos_theta>
 IGL_INLINE void igl::dihedral_angles(
 IGL_INLINE void igl::dihedral_angles(
-  const Eigen::PlainObjectBase<DerivedV>& V,
-  const Eigen::PlainObjectBase<DerivedT>& T,
+  const Eigen::MatrixBase<DerivedV>& V,
+  const Eigen::MatrixBase<DerivedT>& T,
   Eigen::PlainObjectBase<Derivedtheta>& theta,
   Eigen::PlainObjectBase<Derivedtheta>& theta,
   Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta)
   Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta)
 {
 {
@@ -37,8 +37,8 @@ template <
   typename Derivedtheta,
   typename Derivedtheta,
   typename Derivedcos_theta>
   typename Derivedcos_theta>
 IGL_INLINE void igl::dihedral_angles_intrinsic(
 IGL_INLINE void igl::dihedral_angles_intrinsic(
-  const Eigen::PlainObjectBase<DerivedL>& L,
-  const Eigen::PlainObjectBase<DerivedA>& A,
+  const Eigen::MatrixBase<DerivedL>& L,
+  const Eigen::MatrixBase<DerivedA>& A,
   Eigen::PlainObjectBase<Derivedtheta>& theta,
   Eigen::PlainObjectBase<Derivedtheta>& theta,
   Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta)
   Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta)
 {
 {
@@ -93,6 +93,6 @@ IGL_INLINE void igl::dihedral_angles_intrinsic(
 }
 }
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::dihedral_angles_intrinsic< Eigen::Matrix<double, -1, 6, 0, -1, 6>, Eigen::Matrix<double, -1, 4, 0, -1, 4>, Eigen::Matrix<double, -1, 6, 0, -1, 6>, Eigen::Matrix<double, -1, 6, 0, -1, 6> >(const Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&, const Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 4, 0, -1, 4> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&);
-template void igl::dihedral_angles<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> >(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> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::dihedral_angles_intrinsic< Eigen::Matrix<double, -1, 6, 0, -1, 6>, Eigen::Matrix<double, -1, 4, 0, -1, 4>, Eigen::Matrix<double, -1, 6, 0, -1, 6>, Eigen::Matrix<double, -1, 6, 0, -1, 6> >(const Eigen::MatrixBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&, const Eigen::MatrixBase<Eigen::Matrix<double, -1, 4, 0, -1, 4> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&);
+template void igl::dihedral_angles<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> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 4 - 4
include/igl/dihedral_angles.h

@@ -30,8 +30,8 @@ namespace igl
     typename Derivedtheta,
     typename Derivedtheta,
     typename Derivedcos_theta>
     typename Derivedcos_theta>
   IGL_INLINE void dihedral_angles(
   IGL_INLINE void dihedral_angles(
-    const Eigen::PlainObjectBase<DerivedV>& V,
-    const Eigen::PlainObjectBase<DerivedT>& T,
+    const Eigen::MatrixBase<DerivedV>& V,
+    const Eigen::MatrixBase<DerivedT>& T,
     Eigen::PlainObjectBase<Derivedtheta>& theta,
     Eigen::PlainObjectBase<Derivedtheta>& theta,
     Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta);
     Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta);
   template <
   template <
@@ -40,8 +40,8 @@ namespace igl
     typename Derivedtheta,
     typename Derivedtheta,
     typename Derivedcos_theta>
     typename Derivedcos_theta>
   IGL_INLINE void dihedral_angles_intrinsic(
   IGL_INLINE void dihedral_angles_intrinsic(
-    const Eigen::PlainObjectBase<DerivedL>& L,
-    const Eigen::PlainObjectBase<DerivedA>& A,
+    const Eigen::MatrixBase<DerivedL>& L,
+    const Eigen::MatrixBase<DerivedA>& A,
     Eigen::PlainObjectBase<Derivedtheta>& theta,
     Eigen::PlainObjectBase<Derivedtheta>& theta,
     Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta);
     Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta);
 
 

+ 8 - 6
include/igl/directed_edge_parents.cpp

@@ -14,21 +14,23 @@
 
 
 template <typename DerivedE, typename DerivedP>
 template <typename DerivedE, typename DerivedP>
 IGL_INLINE void igl::directed_edge_parents(
 IGL_INLINE void igl::directed_edge_parents(
-  const Eigen::PlainObjectBase<DerivedE> & E,
+  const Eigen::MatrixBase<DerivedE> & E,
   Eigen::PlainObjectBase<DerivedP> & P)
   Eigen::PlainObjectBase<DerivedP> & P)
 {
 {
   using namespace Eigen;
   using namespace Eigen;
   using namespace std;
   using namespace std;
-  VectorXi I = VectorXi::Constant(E.maxCoeff()+1,1,-1);
+  typedef Eigen::Matrix<typename DerivedE::Scalar, Eigen::Dynamic, 1> VectorT;
+
+  VectorT I = VectorT::Constant(E.maxCoeff()+1,1,-1);
   //I(E.col(1)) = 0:E.rows()-1
   //I(E.col(1)) = 0:E.rows()-1
-  slice_into(colon<int>(0,E.rows()-1),E.col(1).eval(),I);
-  VectorXi roots,_;
+  slice_into(colon<typename DerivedE::Scalar>(0, E.rows()-1), E.col(1).eval(), I);
+  VectorT roots,_;
   setdiff(E.col(0).eval(),E.col(1).eval(),roots,_);
   setdiff(E.col(0).eval(),E.col(1).eval(),roots,_);
-  std::for_each(roots.data(),roots.data()+roots.size(),[&](int r){I(r)=-1;});
+  std::for_each(roots.data(),roots.data()+roots.size(),[&](typename VectorT::Scalar r){I(r)=-1;});
   slice(I,E.col(0).eval(),P);
   slice(I,E.col(0).eval(),P);
 }
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::directed_edge_parents<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::directed_edge_parents<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #endif
 #endif

+ 1 - 1
include/igl/directed_edge_parents.h

@@ -22,7 +22,7 @@ namespace igl
   //
   //
   template <typename DerivedE, typename DerivedP>
   template <typename DerivedE, typename DerivedP>
   IGL_INLINE void directed_edge_parents(
   IGL_INLINE void directed_edge_parents(
-    const Eigen::PlainObjectBase<DerivedE> & E,
+    const Eigen::MatrixBase<DerivedE> & E,
     Eigen::PlainObjectBase<DerivedP> & P);
     Eigen::PlainObjectBase<DerivedP> & P);
 }
 }
 
 

+ 6 - 6
include/igl/ears.cpp

@@ -15,15 +15,15 @@ IGL_INLINE void igl::ears(
   Eigen::PlainObjectBase<Derivedear_opp> & ear_opp)
   Eigen::PlainObjectBase<Derivedear_opp> & ear_opp)
 {
 {
   assert(F.cols() == 3 && "F should contain triangles");
   assert(F.cols() == 3 && "F should contain triangles");
-  Eigen::Array<bool,Eigen::Dynamic,3> B;
+  Eigen::Array<bool, Eigen::Dynamic, 3> B;
   {
   {
-    Eigen::Array<bool,Eigen::Dynamic,1> I;
+    Eigen::Array<bool, Eigen::Dynamic, 1> I;
     on_boundary(F,I,B);
     on_boundary(F,I,B);
   }
   }
-  find(B.rowwise().count() == 2,ear);
-  Eigen::Array<bool,Eigen::Dynamic,3> Bear;
-  slice(B,ear,1,Bear);
-  Eigen::Array<bool,Eigen::Dynamic,1> M;
+  find(B.rowwise().count() == 2, ear);
+  Eigen::Array<bool, Eigen::Dynamic, 3> Bear;
+  slice(B, ear, 1, Bear);
+  Eigen::Array<bool, Eigen::Dynamic, 1> M;
   mat_min(Bear,2,M,ear_opp);
   mat_min(Bear,2,M,ear_opp);
 }
 }
 
 

+ 20 - 20
include/igl/edge_topology.cpp

@@ -9,24 +9,24 @@
 #include "is_edge_manifold.h"
 #include "is_edge_manifold.h"
 #include <algorithm>
 #include <algorithm>
 
 
-template<typename DerivedV, typename DerivedF>
+template<typename DerivedV, typename DerivedF, typename DerivedE>
 IGL_INLINE void igl::edge_topology(
 IGL_INLINE void igl::edge_topology(
-  const Eigen::PlainObjectBase<DerivedV>& V,
-  const Eigen::PlainObjectBase<DerivedF>& F,
-  Eigen::MatrixXi& EV,
-  Eigen::MatrixXi& FE,
-  Eigen::MatrixXi& EF)
+  const Eigen::MatrixBase<DerivedV>& V,
+  const Eigen::MatrixBase<DerivedF>& F,
+  Eigen::PlainObjectBase<DerivedE>& EV,
+  Eigen::PlainObjectBase<DerivedE>& FE,
+  Eigen::PlainObjectBase<DerivedE>& EF)
 {
 {
   // Only needs to be edge-manifold
   // Only needs to be edge-manifold
   if (V.rows() ==0 || F.rows()==0)
   if (V.rows() ==0 || F.rows()==0)
   {
   {
-    EV = Eigen::MatrixXi::Constant(0,2,-1);
-    FE = Eigen::MatrixXi::Constant(0,3,-1);
-    EF = Eigen::MatrixXi::Constant(0,2,-1);
+    EV = Eigen::PlainObjectBase<DerivedE>::Constant(0,2,-1);
+    FE = Eigen::PlainObjectBase<DerivedE>::Constant(0,3,-1);
+    EF = Eigen::PlainObjectBase<DerivedE>::Constant(0,2,-1);
     return;
     return;
   }
   }
   assert(igl::is_edge_manifold(F));
   assert(igl::is_edge_manifold(F));
-  std::vector<std::vector<int> > ETT;
+  std::vector<std::vector<typename DerivedE::Scalar> > ETT;
   for(int f=0;f<F.rows();++f)
   for(int f=0;f<F.rows();++f)
     for (int i=0;i<3;++i)
     for (int i=0;i<3;++i)
     {
     {
@@ -34,7 +34,7 @@ IGL_INLINE void igl::edge_topology(
       int v1 = F(f,i);
       int v1 = F(f,i);
       int v2 = F(f,(i+1)%3);
       int v2 = F(f,(i+1)%3);
       if (v1 > v2) std::swap(v1,v2);
       if (v1 > v2) std::swap(v1,v2);
-      std::vector<int> r(4);
+      std::vector<typename DerivedE::Scalar> r(4);
       r[0] = v1; r[1] = v2;
       r[0] = v1; r[1] = v2;
       r[2] = f;  r[3] = i;
       r[2] = f;  r[3] = i;
       ETT.push_back(r);
       ETT.push_back(r);
@@ -47,9 +47,9 @@ IGL_INLINE void igl::edge_topology(
     if (!((ETT[i][0] == ETT[i+1][0]) && (ETT[i][1] == ETT[i+1][1])))
     if (!((ETT[i][0] == ETT[i+1][0]) && (ETT[i][1] == ETT[i+1][1])))
       ++En;
       ++En;
 
 
-  EV = Eigen::MatrixXi::Constant((int)(En),2,-1);
-  FE = Eigen::MatrixXi::Constant((int)(F.rows()),3,-1);
-  EF = Eigen::MatrixXi::Constant((int)(En),2,-1);
+  EV = DerivedE::Constant((int)(En),2,-1);
+  FE = DerivedE::Constant((int)(F.rows()),3,-1);
+  EF = DerivedE::Constant((int)(En),2,-1);
   En = 0;
   En = 0;
 
 
   for(unsigned i=0;i<ETT.size();++i)
   for(unsigned i=0;i<ETT.size();++i)
@@ -59,7 +59,7 @@ IGL_INLINE void igl::edge_topology(
         )
         )
     {
     {
       // Border edge
       // Border edge
-      std::vector<int>& r1 = ETT[i];
+      std::vector<typename DerivedE::Scalar>& r1 = ETT[i];
       EV(En,0)     = r1[0];
       EV(En,0)     = r1[0];
       EV(En,1)     = r1[1];
       EV(En,1)     = r1[1];
       EF(En,0)    = r1[2];
       EF(En,0)    = r1[2];
@@ -67,8 +67,8 @@ IGL_INLINE void igl::edge_topology(
     }
     }
     else
     else
     {
     {
-      std::vector<int>& r1 = ETT[i];
-      std::vector<int>& r2 = ETT[i+1];
+      std::vector<typename DerivedE::Scalar>& r1 = ETT[i];
+      std::vector<typename DerivedE::Scalar>& r2 = ETT[i+1];
       EV(En,0)     = r1[0];
       EV(En,0)     = r1[0];
       EV(En,1)     = r1[1];
       EV(En,1)     = r1[1];
       EF(En,0)    = r1[2];
       EF(En,0)    = r1[2];
@@ -84,7 +84,7 @@ IGL_INLINE void igl::edge_topology(
   // the first one is the face on the left of the edge
   // the first one is the face on the left of the edge
   for(unsigned i=0; i<EF.rows(); ++i)
   for(unsigned i=0; i<EF.rows(); ++i)
   {
   {
-    int fid = EF(i,0);
+    typename DerivedE::Scalar fid = EF(i,0);
     bool flip = true;
     bool flip = true;
     // search for edge EV.row(i)
     // search for edge EV.row(i)
     for (unsigned j=0; j<3; ++j)
     for (unsigned j=0; j<3; ++j)
@@ -105,6 +105,6 @@ IGL_INLINE void igl::edge_topology(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::edge_topology<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
-template void igl::edge_topology<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::Matrix<int, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
+template void igl::edge_topology<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -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>>&);
+template void igl::edge_topology<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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::PlainObjectBase<Eigen::Matrix<int, -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
 #endif

+ 6 - 6
include/igl/edge_topology.h

@@ -34,13 +34,13 @@ namespace igl
   //   - FE uses non-standard and ambiguous order: FE(f,c) is merely an edge
   //   - FE uses non-standard and ambiguous order: FE(f,c) is merely an edge
   //     incident on corner c of face f. In contrast, edge_flaps's EMAP(f,c)
   //     incident on corner c of face f. In contrast, edge_flaps's EMAP(f,c)
   //     reveals the edge _opposite_ corner c of face f
   //     reveals the edge _opposite_ corner c of face f
-template <typename DerivedV, typename DerivedF>
+template <typename DerivedV, typename DerivedF, typename DerivedE>
   IGL_INLINE void edge_topology(
   IGL_INLINE void edge_topology(
-    const Eigen::PlainObjectBase<DerivedV>& V,
-    const Eigen::PlainObjectBase<DerivedF>& F, 
-    Eigen::MatrixXi& EV, 
-    Eigen::MatrixXi& FE, 
-    Eigen::MatrixXi& EF);
+    const Eigen::MatrixBase<DerivedV>& V,
+    const Eigen::MatrixBase<DerivedF>& F, 
+    Eigen::PlainObjectBase<DerivedE>& EV, 
+    Eigen::PlainObjectBase<DerivedE>& FE, 
+    Eigen::PlainObjectBase<DerivedE>& EF);
 }
 }
 
 
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 3 - 3
include/igl/euler_characteristic.cpp

@@ -12,8 +12,8 @@
 
 
 template <typename Scalar, typename Index>
 template <typename Scalar, typename Index>
 IGL_INLINE int igl::euler_characteristic(
 IGL_INLINE int igl::euler_characteristic(
-  const Eigen::PlainObjectBase<Scalar> & V,
-  const Eigen::PlainObjectBase<Index> & F)
+  const Eigen::MatrixBase<Scalar> & V,
+  const Eigen::MatrixBase<Index> & F)
 {
 {
 
 
   int euler_v = V.rows();
   int euler_v = V.rows();
@@ -41,6 +41,6 @@ IGL_INLINE int igl::euler_characteristic(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template int igl::euler_characteristic<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&);
+template int igl::euler_characteristic<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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&);
 template int igl::euler_characteristic<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
 template int igl::euler_characteristic<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
 #endif
 #endif

+ 2 - 2
include/igl/euler_characteristic.h

@@ -34,8 +34,8 @@ namespace igl
   // Returns An int containing the Euler characteristic
   // Returns An int containing the Euler characteristic
   template <typename Scalar, typename Index>
   template <typename Scalar, typename Index>
   IGL_INLINE int euler_characteristic(
   IGL_INLINE int euler_characteristic(
-    const Eigen::PlainObjectBase<Scalar> & V,
-    const Eigen::PlainObjectBase<Index> & F);
+    const Eigen::MatrixBase<Scalar> & V,
+    const Eigen::MatrixBase<Index> & F);
 
 
 }
 }
 
 

+ 4 - 4
include/igl/exact_geodesic.cpp

@@ -3193,20 +3193,20 @@ IGL_INLINE void igl::exact_geodesic(
   std::vector<igl::geodesic::SurfacePoint> target(VT.rows() + FT.rows());
   std::vector<igl::geodesic::SurfacePoint> target(VT.rows() + FT.rows());
   for (int i = 0; i < VS.rows(); i++)
   for (int i = 0; i < VS.rows(); i++)
   {
   {
-    source[i] = (igl::geodesic::SurfacePoint(&mesh.vertices()[VS(i)]));
+    source[i] = (igl::geodesic::SurfacePoint(&mesh.vertices()[VS(i, 0)]));
   }
   }
   for (int i = 0; i < FS.rows(); i++)
   for (int i = 0; i < FS.rows(); i++)
   {
   {
-    source[i] = (igl::geodesic::SurfacePoint(&mesh.faces()[FS(i)]));
+    source[i] = (igl::geodesic::SurfacePoint(&mesh.faces()[FS(i, 0)]));
   }
   }
 
 
   for (int i = 0; i < VT.rows(); i++)
   for (int i = 0; i < VT.rows(); i++)
   {
   {
-    target[i] = (igl::geodesic::SurfacePoint(&mesh.vertices()[VT(i)]));
+    target[i] = (igl::geodesic::SurfacePoint(&mesh.vertices()[VT(i, 0)]));
   }
   }
   for (int i = 0; i < FT.rows(); i++)
   for (int i = 0; i < FT.rows(); i++)
   {
   {
-    target[i] = (igl::geodesic::SurfacePoint(&mesh.faces()[FT(i)]));
+    target[i] = (igl::geodesic::SurfacePoint(&mesh.faces()[FT(i, 0)]));
   }
   }
 
 
   exact_algorithm.propagate(source);
   exact_algorithm.propagate(source);

+ 2 - 2
include/igl/facet_components.cpp

@@ -11,7 +11,7 @@
 #include <queue>
 #include <queue>
 template <typename DerivedF, typename DerivedC>
 template <typename DerivedF, typename DerivedC>
 IGL_INLINE void igl::facet_components(
 IGL_INLINE void igl::facet_components(
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedC> & C)
   Eigen::PlainObjectBase<DerivedC> & C)
 {
 {
   using namespace std;
   using namespace std;
@@ -88,7 +88,7 @@ IGL_INLINE void igl::facet_components(
 // Explicit template instantiation
 // Explicit template instantiation
 template void igl::facet_components<long, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<long, -1, 1, 0, -1, 1> >(std::vector<std::vector<std::vector<long, std::allocator<long> >, std::allocator<std::vector<long, std::allocator<long> > > >, std::allocator<std::vector<std::vector<long, std::allocator<long> >, std::allocator<std::vector<long, std::allocator<long> > > > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&);
 template void igl::facet_components<long, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<long, -1, 1, 0, -1, 1> >(std::vector<std::vector<std::vector<long, std::allocator<long> >, std::allocator<std::vector<long, std::allocator<long> > > >, std::allocator<std::vector<std::vector<long, std::allocator<long> >, std::allocator<std::vector<long, std::allocator<long> > > > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&);
 template void igl::facet_components<int, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(std::vector<std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >, std::allocator<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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 template void igl::facet_components<int, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(std::vector<std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >, std::allocator<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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template void igl::facet_components<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::facet_components<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #ifdef WIN32
 #ifdef WIN32
 template void igl::facet_components<__int64,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix<__int64,-1,1,0,-1,1> >(class std::vector<class std::vector<class std::vector<__int64,class std::allocator<__int64> >,class std::allocator<class std::vector<__int64,class std::allocator<__int64> > > >,class std::allocator<class std::vector<class std::vector<__int64,class std::allocator<__int64> >,class std::allocator<class std::vector<__int64,class std::allocator<__int64> > > > > > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &);
 template void igl::facet_components<__int64,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix<__int64,-1,1,0,-1,1> >(class std::vector<class std::vector<class std::vector<__int64,class std::allocator<__int64> >,class std::allocator<class std::vector<__int64,class std::allocator<__int64> > > >,class std::allocator<class std::vector<class std::vector<__int64,class std::allocator<__int64> >,class std::allocator<class std::vector<__int64,class std::allocator<__int64> > > > > > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &);
 #endif
 #endif

+ 1 - 1
include/igl/facet_components.h

@@ -22,7 +22,7 @@ namespace igl
   //   C  #F list of connected component ids
   //   C  #F list of connected component ids
   template <typename DerivedF, typename DerivedC>
   template <typename DerivedF, typename DerivedC>
   IGL_INLINE void facet_components(
   IGL_INLINE void facet_components(
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedF> & F,
     Eigen::PlainObjectBase<DerivedC> & C);
     Eigen::PlainObjectBase<DerivedC> & C);
 
 
   // Compute connected components of facets based on edge-edge adjacency.
   // Compute connected components of facets based on edge-edge adjacency.

+ 4 - 4
include/igl/gaussian_curvature.cpp

@@ -11,8 +11,8 @@
 #include <iostream>
 #include <iostream>
 template <typename DerivedV, typename DerivedF, typename DerivedK>
 template <typename DerivedV, typename DerivedF, typename DerivedK>
 IGL_INLINE void igl::gaussian_curvature(
 IGL_INLINE void igl::gaussian_curvature(
-  const Eigen::PlainObjectBase<DerivedV>& V,
-  const Eigen::PlainObjectBase<DerivedF>& F,
+  const Eigen::MatrixBase<DerivedV>& V,
+  const Eigen::MatrixBase<DerivedF>& F,
   Eigen::PlainObjectBase<DerivedK> & K)
   Eigen::PlainObjectBase<DerivedK> & K)
 {
 {
   using namespace Eigen;
   using namespace Eigen;
@@ -51,6 +51,6 @@ IGL_INLINE void igl::gaussian_curvature(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::gaussian_curvature<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::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> >&);
-template void igl::gaussian_curvature<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::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> >&);
+template void igl::gaussian_curvature<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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::gaussian_curvature<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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 #endif
 #endif

+ 2 - 2
include/igl/gaussian_curvature.h

@@ -22,8 +22,8 @@ namespace igl
   //
   //
   template <typename DerivedV, typename DerivedF, typename DerivedK>
   template <typename DerivedV, typename DerivedF, typename DerivedK>
   IGL_INLINE void gaussian_curvature(
   IGL_INLINE void gaussian_curvature(
-    const Eigen::PlainObjectBase<DerivedV>& V,
-    const Eigen::PlainObjectBase<DerivedF>& F,
+    const Eigen::MatrixBase<DerivedV>& V,
+    const Eigen::MatrixBase<DerivedF>& F,
     Eigen::PlainObjectBase<DerivedK> & K);
     Eigen::PlainObjectBase<DerivedK> & K);
 }
 }
 
 

+ 13 - 12
include/igl/harmonic.cpp

@@ -77,8 +77,8 @@ template <
   typename Derivedbc,
   typename Derivedbc,
   typename DerivedW>
   typename DerivedW>
 IGL_INLINE bool igl::harmonic(
 IGL_INLINE bool igl::harmonic(
-  const Eigen::SparseMatrix<DerivedL> & L,
-  const Eigen::SparseMatrix<DerivedM> & M,
+  const Eigen::SparseCompressedBase<DerivedL> & L,
+  const Eigen::SparseCompressedBase<DerivedM> & M,
   const Eigen::MatrixBase<Derivedb> & b,
   const Eigen::MatrixBase<Derivedb> & b,
   const Eigen::MatrixBase<Derivedbc> & bc,
   const Eigen::MatrixBase<Derivedbc> & bc,
   const int k,
   const int k,
@@ -89,15 +89,16 @@ IGL_INLINE bool igl::harmonic(
   assert((k==1 || n == M.cols() ) && "M must be same size as L");
   assert((k==1 || n == M.cols() ) && "M must be same size as L");
   assert((k==1 || n == M.rows() ) && "M must be square");
   assert((k==1 || n == M.rows() ) && "M must be square");
   assert((k==1 || igl::isdiag(M))  && "Mass matrix should be diagonal");
   assert((k==1 || igl::isdiag(M))  && "Mass matrix should be diagonal");
+  typedef typename DerivedL::Scalar Scalar;
 
 
-  Eigen::SparseMatrix<DerivedL> Q;
+  Eigen::SparseMatrix<Scalar> Q;
   igl::harmonic(L,M,k,Q);
   igl::harmonic(L,M,k,Q);
 
 
-  typedef DerivedL Scalar;
+
   min_quad_with_fixed_data<Scalar> data;
   min_quad_with_fixed_data<Scalar> data;
   min_quad_with_fixed_precompute(Q,b,Eigen::SparseMatrix<Scalar>(),true,data);
   min_quad_with_fixed_precompute(Q,b,Eigen::SparseMatrix<Scalar>(),true,data);
   W.resize(n,bc.cols());
   W.resize(n,bc.cols());
-  typedef Eigen::Matrix<Scalar,Eigen::Dynamic,1> VectorXS;
+  typedef Eigen::Matrix<typename Derivedbc::Scalar,Eigen::Dynamic,1> VectorXS;
   const VectorXS B = VectorXS::Zero(n,1);
   const VectorXS B = VectorXS::Zero(n,1);
   for(int w = 0;w<bc.cols();w++)
   for(int w = 0;w<bc.cols();w++)
   {
   {
@@ -117,17 +118,17 @@ template <
   typename DerivedM,
   typename DerivedM,
   typename DerivedQ>
   typename DerivedQ>
 IGL_INLINE void igl::harmonic(
 IGL_INLINE void igl::harmonic(
-  const Eigen::SparseMatrix<DerivedL> & L,
-  const Eigen::SparseMatrix<DerivedM> & M,
+  const Eigen::SparseCompressedBase<DerivedL> & L,
+  const Eigen::SparseCompressedBase<DerivedM> & M,
   const int k,
   const int k,
-  Eigen::SparseMatrix<DerivedQ> & Q)
+  DerivedQ & Q)
 {
 {
   assert(L.rows() == L.cols()&&"L should be square");
   assert(L.rows() == L.cols()&&"L should be square");
   Q = -L;
   Q = -L;
   if(k == 1) return;
   if(k == 1) return;
   assert(L.rows() == M.rows()&&"L should match M's dimensions");
   assert(L.rows() == M.rows()&&"L should match M's dimensions");
   assert(M.rows() == M.cols()&&"M should be square");
   assert(M.rows() == M.cols()&&"M should be square");
-  Eigen::SparseMatrix<DerivedM> Mi;
+  Eigen::SparseMatrix<typename DerivedM::Scalar> Mi;
   invert_diag(M,Mi);
   invert_diag(M,Mi);
   // This is **not** robust for k>2. See KKT system in [Jacobson et al. 2010]
   // This is **not** robust for k>2. See KKT system in [Jacobson et al. 2010]
   // of the kharmonic function in gptoolbox
   // of the kharmonic function in gptoolbox
@@ -146,9 +147,9 @@ IGL_INLINE void igl::harmonic(
   const Eigen::MatrixBase<DerivedV> & V,
   const Eigen::MatrixBase<DerivedV> & V,
   const Eigen::MatrixBase<DerivedF> & F,
   const Eigen::MatrixBase<DerivedF> & F,
   const int k,
   const int k,
-  Eigen::SparseMatrix<DerivedQ> & Q)
+  DerivedQ & Q)
 {
 {
-  Eigen::SparseMatrix<DerivedQ> L,M;
+  DerivedQ L,M;
   cotmatrix(V,F,L);
   cotmatrix(V,F,L);
   if(k>1)
   if(k>1)
   {
   {
@@ -166,7 +167,7 @@ template bool igl::harmonic<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Mat
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
 template bool igl::harmonic<Eigen::Matrix<int, -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> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 template bool igl::harmonic<Eigen::Matrix<int, -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> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template void igl::harmonic<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&, int, Eigen::SparseMatrix<double, 0, int>&);
+template void igl::harmonic<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::SparseMatrix<double, 0, int> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, int, Eigen::SparseMatrix<double, 0, int>&);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
 template bool igl::harmonic<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 template bool igl::harmonic<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh

+ 6 - 6
include/igl/harmonic.h

@@ -75,8 +75,8 @@ namespace igl
     typename Derivedbc,
     typename Derivedbc,
     typename DerivedW>
     typename DerivedW>
   IGL_INLINE bool harmonic(
   IGL_INLINE bool harmonic(
-    const Eigen::SparseMatrix<DerivedL> & L,
-    const Eigen::SparseMatrix<DerivedM> & M,
+    const Eigen::SparseCompressedBase<DerivedL> & L,
+    const Eigen::SparseCompressedBase<DerivedM> & M,
     const Eigen::MatrixBase<Derivedb> & b,
     const Eigen::MatrixBase<Derivedb> & b,
     const Eigen::MatrixBase<Derivedbc> & bc,
     const Eigen::MatrixBase<Derivedbc> & bc,
     const int k,
     const int k,
@@ -95,10 +95,10 @@ namespace igl
     typename DerivedM,
     typename DerivedM,
     typename DerivedQ>
     typename DerivedQ>
   IGL_INLINE void harmonic(
   IGL_INLINE void harmonic(
-    const Eigen::SparseMatrix<DerivedL> & L,
-    const Eigen::SparseMatrix<DerivedM> & M,
+    const Eigen::SparseCompressedBase<DerivedL> & L,
+    const Eigen::SparseCompressedBase<DerivedM> & M,
     const int k,
     const int k,
-    Eigen::SparseMatrix<DerivedQ> & Q);
+    DerivedQ & Q);
   // Inputs:
   // Inputs:
   //   V  #V by dim vertex positions
   //   V  #V by dim vertex positions
   //   F  #F by simplex-size list of element indices
   //   F  #F by simplex-size list of element indices
@@ -113,7 +113,7 @@ namespace igl
     const Eigen::MatrixBase<DerivedV> & V,
     const Eigen::MatrixBase<DerivedV> & V,
     const Eigen::MatrixBase<DerivedF> & F,
     const Eigen::MatrixBase<DerivedF> & F,
     const int k,
     const int k,
-    Eigen::SparseMatrix<DerivedQ> & Q);
+    DerivedQ & Q);
 };
 };
 
 
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 13 - 13
include/igl/hausdorff.cpp

@@ -1,24 +1,24 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2015 Alec Jacobson <[email protected]>
 // Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "hausdorff.h"
 #include "hausdorff.h"
 #include "point_mesh_squared_distance.h"
 #include "point_mesh_squared_distance.h"
 
 
 template <
 template <
-  typename DerivedVA, 
+  typename DerivedVA,
   typename DerivedFA,
   typename DerivedFA,
   typename DerivedVB,
   typename DerivedVB,
   typename DerivedFB,
   typename DerivedFB,
   typename Scalar>
   typename Scalar>
 IGL_INLINE void igl::hausdorff(
 IGL_INLINE void igl::hausdorff(
-  const Eigen::PlainObjectBase<DerivedVA> & VA, 
-  const Eigen::PlainObjectBase<DerivedFA> & FA,
-  const Eigen::PlainObjectBase<DerivedVB> & VB, 
-  const Eigen::PlainObjectBase<DerivedFB> & FB,
+  const Eigen::MatrixBase<DerivedVA> & VA,
+  const Eigen::MatrixBase<DerivedFA> & FA,
+  const Eigen::MatrixBase<DerivedVB> & VB,
+  const Eigen::MatrixBase<DerivedFB> & FB,
   Scalar & d)
   Scalar & d)
 {
 {
   using namespace Eigen;
   using namespace Eigen;
@@ -26,7 +26,7 @@ IGL_INLINE void igl::hausdorff(
   assert(FA.cols() == 3 && "FA should contain triangles");
   assert(FA.cols() == 3 && "FA should contain triangles");
   assert(VB.cols() == 3 && "VB should contain 3d points");
   assert(VB.cols() == 3 && "VB should contain 3d points");
   assert(FB.cols() == 3 && "FB should contain triangles");
   assert(FB.cols() == 3 && "FB should contain triangles");
-  Matrix<Scalar,Dynamic,1> sqr_DBA,sqr_DAB;
+  Matrix<typename DerivedVA::Scalar, Dynamic, 1> sqr_DBA, sqr_DAB;
   Matrix<typename DerivedVA::Index,Dynamic,1> I;
   Matrix<typename DerivedVA::Index,Dynamic,1> I;
   Matrix<typename DerivedVA::Scalar,Dynamic,3> C;
   Matrix<typename DerivedVA::Scalar,Dynamic,3> C;
   point_mesh_squared_distance(VB,VA,FA,sqr_DBA,I,C);
   point_mesh_squared_distance(VB,VA,FA,sqr_DBA,I,C);
@@ -73,18 +73,18 @@ IGL_INLINE void igl::hausdorff(
     d(i) = dist_to_B(V(i,0),V(i,1),V(i,2));
     d(i) = dist_to_B(V(i,0),V(i,1),V(i,2));
     // Lower bound is simply the max over vertex distances
     // Lower bound is simply the max over vertex distances
     l = std::max(d(i),l);
     l = std::max(d(i),l);
-    // u1 is the minimum of corner distances + maximum adjacent edge 
+    // u1 is the minimum of corner distances + maximum adjacent edge
     u1 = std::min(u1,d(i) + std::max(e((i+1)%3),e((i+2)%3)));
     u1 = std::min(u1,d(i) + std::max(e((i+1)%3),e((i+2)%3)));
     // u2 first takes the maximum over corner distances
     // u2 first takes the maximum over corner distances
     u2 = std::max(u2,d(i));
     u2 = std::max(u2,d(i));
   }
   }
   // u2 is the distance from the circumcenter/midpoint of obtuse edge plus the
   // u2 is the distance from the circumcenter/midpoint of obtuse edge plus the
-  // largest corner distance 
+  // largest corner distance
   u2 += (s-r>2.*R ? R : 0.5*e_max);
   u2 += (s-r>2.*R ? R : 0.5*e_max);
   u = std::min(u1,u2);
   u = std::min(u1,u2);
 }
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
-template void igl::hausdorff<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>, double>(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> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, double&);
+template void igl::hausdorff<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>, double>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, double&);
 template void igl::hausdorff<Eigen::Matrix<double, -1, -1, 0, -1, -1>, double>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, std::function<double (double const&, double const&, double const&)> const&, double&, double&);
 template void igl::hausdorff<Eigen::Matrix<double, -1, -1, 0, -1, -1>, double>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, std::function<double (double const&, double const&, double const&)> const&, double&, double&);
 #endif
 #endif

+ 13 - 13
include/igl/hausdorff.h

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2015 Alec Jacobson <[email protected]>
 // Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_HAUSDORFF_H
 #ifndef IGL_HAUSDORFF_H
 #define IGL_HAUSDORFF_H
 #define IGL_HAUSDORFF_H
@@ -12,10 +12,10 @@
 #include <Eigen/Dense>
 #include <Eigen/Dense>
 #include <functional>
 #include <functional>
 
 
-namespace igl 
+namespace igl
 {
 {
   // HAUSDORFF compute the Hausdorff distance between mesh (VA,FA) and mesh
   // HAUSDORFF compute the Hausdorff distance between mesh (VA,FA) and mesh
-  // (VB,FB). This is the 
+  // (VB,FB). This is the
   //
   //
   // d(A,B) = max ( max min d(a,b) , max min d(b,a) )
   // d(A,B) = max ( max min d(a,b) , max min d(b,a) )
   //                a∈A b∈B          b∈B a∈A
   //                a∈A b∈B          b∈B a∈A
@@ -29,7 +29,7 @@ namespace igl
   // the midpoint in the middle of the segment across the concavity and some
   // the midpoint in the middle of the segment across the concavity and some
   // non-vertex point _on the edge_ of the V.
   // non-vertex point _on the edge_ of the V.
   // Known issue: due to the issue above, this also means that unreferenced
   // Known issue: due to the issue above, this also means that unreferenced
-  // vertices can give unexpected results. Therefore, we assume the inputs have 
+  // vertices can give unexpected results. Therefore, we assume the inputs have
   // no unreferenced vertices.
   // no unreferenced vertices.
   //
   //
   // Inputs:
   // Inputs:
@@ -43,16 +43,16 @@ namespace igl
   //   //  and pair(2,:) is from B
   //   //  and pair(2,:) is from B
   //
   //
   template <
   template <
-    typename DerivedVA, 
+    typename DerivedVA,
     typename DerivedFA,
     typename DerivedFA,
     typename DerivedVB,
     typename DerivedVB,
     typename DerivedFB,
     typename DerivedFB,
     typename Scalar>
     typename Scalar>
   IGL_INLINE void hausdorff(
   IGL_INLINE void hausdorff(
-    const Eigen::PlainObjectBase<DerivedVA> & VA, 
-    const Eigen::PlainObjectBase<DerivedFA> & FA,
-    const Eigen::PlainObjectBase<DerivedVB> & VB, 
-    const Eigen::PlainObjectBase<DerivedFB> & FB,
+    const Eigen::MatrixBase<DerivedVA> & VA,
+    const Eigen::MatrixBase<DerivedFA> & FA,
+    const Eigen::MatrixBase<DerivedVB> & VB,
+    const Eigen::MatrixBase<DerivedFB> & FB,
     Scalar & d);
     Scalar & d);
   // Compute lower and upper bounds (l,u) on the Hausdorff distance between a triangle
   // Compute lower and upper bounds (l,u) on the Hausdorff distance between a triangle
   // (V) and a pointset (e.g., mesh, triangle soup) given by a distance function
   // (V) and a pointset (e.g., mesh, triangle soup) given by a distance function
@@ -64,7 +64,7 @@ namespace igl
   //   dist_to_B  function taking the x,y,z coordinate of a query position and
   //   dist_to_B  function taking the x,y,z coordinate of a query position and
   //     outputting the closest-point distance to some point-set B
   //     outputting the closest-point distance to some point-set B
   // Outputs:
   // Outputs:
-  //   l  lower bound on Hausdorff distance 
+  //   l  lower bound on Hausdorff distance
   //   u  upper bound on Hausdorff distance
   //   u  upper bound on Hausdorff distance
   //
   //
   template <
   template <

+ 6 - 6
include/igl/in_element.cpp

@@ -9,9 +9,9 @@
 
 
 template <typename DerivedV, typename DerivedQ, int DIM>
 template <typename DerivedV, typename DerivedQ, int DIM>
 IGL_INLINE void igl::in_element(
 IGL_INLINE void igl::in_element(
-  const Eigen::PlainObjectBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedV> & V,
   const Eigen::MatrixXi & Ele,
   const Eigen::MatrixXi & Ele,
-  const Eigen::PlainObjectBase<DerivedQ> & Q,
+  const Eigen::MatrixBase<DerivedQ> & Q,
   const AABB<DerivedV,DIM> & aabb,
   const AABB<DerivedV,DIM> & aabb,
   Eigen::VectorXi & I)
   Eigen::VectorXi & I)
 {
 {
@@ -33,9 +33,9 @@ IGL_INLINE void igl::in_element(
 
 
 template <typename DerivedV, typename DerivedQ, int DIM, typename Scalar>
 template <typename DerivedV, typename DerivedQ, int DIM, typename Scalar>
 IGL_INLINE void igl::in_element(
 IGL_INLINE void igl::in_element(
-  const Eigen::PlainObjectBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedV> & V,
   const Eigen::MatrixXi & Ele,
   const Eigen::MatrixXi & Ele,
-  const Eigen::PlainObjectBase<DerivedQ> & Q,
+  const Eigen::MatrixBase<DerivedQ> & Q,
   const AABB<DerivedV,DIM> & aabb,
   const AABB<DerivedV,DIM> & aabb,
   Eigen::SparseMatrix<Scalar> & I)
   Eigen::SparseMatrix<Scalar> & I)
 {
 {
@@ -60,6 +60,6 @@ IGL_INLINE void igl::in_element(
 }
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
-template void igl::in_element<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>(Eigen::PlainObjectBase<Eigen::Matrix<double, -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> > const&, igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
-template void igl::in_element<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>(Eigen::PlainObjectBase<Eigen::Matrix<double, -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> > const&, igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
+template void igl::in_element<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
+template void igl::in_element<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
 #endif
 #endif

+ 4 - 4
include/igl/in_element.h

@@ -30,9 +30,9 @@ namespace igl
   //     containing element)
   //     containing element)
   template <typename DerivedV, typename DerivedQ, int DIM>
   template <typename DerivedV, typename DerivedQ, int DIM>
   IGL_INLINE void in_element(
   IGL_INLINE void in_element(
-    const Eigen::PlainObjectBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedV> & V,
     const Eigen::MatrixXi & Ele,
     const Eigen::MatrixXi & Ele,
-    const Eigen::PlainObjectBase<DerivedQ> & Q,
+    const Eigen::MatrixBase<DerivedQ> & Q,
     const AABB<DerivedV,DIM> & aabb,
     const AABB<DerivedV,DIM> & aabb,
     Eigen::VectorXi & I);
     Eigen::VectorXi & I);
   // Outputs:
   // Outputs:
@@ -40,9 +40,9 @@ namespace igl
   //     point: I(q,e) means point q is in element e
   //     point: I(q,e) means point q is in element e
   template <typename DerivedV, typename DerivedQ, int DIM, typename Scalar>
   template <typename DerivedV, typename DerivedQ, int DIM, typename Scalar>
   IGL_INLINE void in_element(
   IGL_INLINE void in_element(
-    const Eigen::PlainObjectBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedV> & V,
     const Eigen::MatrixXi & Ele,
     const Eigen::MatrixXi & Ele,
-    const Eigen::PlainObjectBase<DerivedQ> & Q,
+    const Eigen::MatrixBase<DerivedQ> & Q,
     const AABB<DerivedV,DIM> & aabb,
     const AABB<DerivedV,DIM> & aabb,
     Eigen::SparseMatrix<Scalar> & I);
     Eigen::SparseMatrix<Scalar> & I);
 };
 };

+ 14 - 10
include/igl/invert_diag.cpp

@@ -7,18 +7,22 @@
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "invert_diag.h"
 #include "invert_diag.h"
 
 
-template <typename T>
+template <typename DerivedX, typename MatY>
 IGL_INLINE void igl::invert_diag(
 IGL_INLINE void igl::invert_diag(
-  const Eigen::SparseMatrix<T>& X, 
-  Eigen::SparseMatrix<T>& Y)
+  const Eigen::SparseCompressedBase<DerivedX>& X,
+  MatY& Y)
 {
 {
+  typedef typename DerivedX::Scalar Scalar;
 #ifndef NDEBUG
 #ifndef NDEBUG
-  typename Eigen::SparseVector<T> dX = X.diagonal().sparseView();
+  Eigen::SparseMatrix<Scalar> tmp = X;
+  Eigen::SparseVector<Scalar> dX = tmp.diagonal().sparseView();
   // Check that there are no zeros along the diagonal
   // Check that there are no zeros along the diagonal
   assert(dX.nonZeros() == dX.size());
   assert(dX.nonZeros() == dX.size());
 #endif
 #endif
   // http://www.alecjacobson.com/weblog/?p=2552
   // http://www.alecjacobson.com/weblog/?p=2552
-  if(&Y != &X)
+
+
+  if((void *)&Y != (void *)&X)
   {
   {
     Y = X;
     Y = X;
   }
   }
@@ -26,13 +30,13 @@ IGL_INLINE void igl::invert_diag(
   for(int k=0; k<Y.outerSize(); ++k)
   for(int k=0; k<Y.outerSize(); ++k)
   {
   {
     // Iterate over inside
     // Iterate over inside
-    for(typename Eigen::SparseMatrix<T>::InnerIterator it (Y,k); it; ++it)
+    for(typename MatY::InnerIterator it (Y,k); it; ++it)
     {
     {
       if(it.col() == it.row())
       if(it.col() == it.row())
       {
       {
-        T v = it.value();
+        Scalar v = it.value();
         assert(v != 0);
         assert(v != 0);
-        v = ((T)1.0)/v;
+        v = ((Scalar)1.0)/v;
         Y.coeffRef(it.row(),it.col()) = v;
         Y.coeffRef(it.row(),it.col()) = v;
       }
       }
     }
     }
@@ -41,6 +45,6 @@ IGL_INLINE void igl::invert_diag(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::invert_diag<double>(Eigen::SparseMatrix<double, 0, int> const&, Eigen::SparseMatrix<double, 0, int>&);
-template void igl::invert_diag<float>(Eigen::SparseMatrix<float, 0, int> const&, Eigen::SparseMatrix<float, 0, int>&);
+template void igl::invert_diag<Eigen::SparseMatrix<double, 0, int>, Eigen::SparseMatrix<double, 0, int> >(Eigen::SparseCompressedBase<Eigen::SparseMatrix<double, 0, int>> const&, Eigen::SparseMatrix<double, 0, int>&);
+template void igl::invert_diag<Eigen::SparseMatrix<float, 0, int>, Eigen::SparseMatrix<float, 0, int> >(Eigen::SparseCompressedBase<Eigen::SparseMatrix<float, 0, int>> const&, Eigen::SparseMatrix<float, 0, int>&);
 #endif
 #endif

+ 3 - 3
include/igl/invert_diag.h

@@ -22,10 +22,10 @@ namespace igl
   //   X  an m by n sparse matrix
   //   X  an m by n sparse matrix
   // Outputs:
   // Outputs:
   //   Y  an m by n sparse matrix
   //   Y  an m by n sparse matrix
-  template <typename T>
+  template <typename DerivedX, typename MatY>
   IGL_INLINE void invert_diag(
   IGL_INLINE void invert_diag(
-    const Eigen::SparseMatrix<T>& X, 
-    Eigen::SparseMatrix<T>& Y);
+    const Eigen::SparseCompressedBase<DerivedX>& X,
+    MatY& Y);
 }
 }
 
 
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 1 - 1
include/igl/is_border_vertex.cpp

@@ -14,7 +14,7 @@ template <typename DerivedF>
 IGL_INLINE std::vector<bool> igl::is_border_vertex(
 IGL_INLINE std::vector<bool> igl::is_border_vertex(
   const Eigen::MatrixBase<DerivedF> &F)
   const Eigen::MatrixBase<DerivedF> &F)
 {
 {
-  DerivedF FF;
+  Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, Eigen::Dynamic> FF;
   igl::triangle_triangle_adjacency(F,FF);
   igl::triangle_triangle_adjacency(F,FF);
   std::vector<bool> ret(F.maxCoeff()+1);
   std::vector<bool> ret(F.maxCoeff()+1);
   for(unsigned i=0; i<ret.size();++i)
   for(unsigned i=0; i<ret.size();++i)

+ 0 - 1
include/igl/is_edge_manifold.h

@@ -16,7 +16,6 @@ namespace igl
   // check if the mesh is edge-manifold
   // check if the mesh is edge-manifold
   //
   //
   // Inputs:
   // Inputs:
-  //   V  #V by dim list of mesh vertex positions **unneeded**
   //   F  #F by 3 list of triangle indices
   //   F  #F by 3 list of triangle indices
   // Returns whether mesh is edge manifold.
   // Returns whether mesh is edge manifold.
   //
   //

+ 3 - 3
include/igl/is_irregular_vertex.cpp

@@ -11,7 +11,7 @@
 #include "is_border_vertex.h"
 #include "is_border_vertex.h"
 
 
 template <typename DerivedV, typename DerivedF>
 template <typename DerivedV, typename DerivedF>
-IGL_INLINE std::vector<bool> igl::is_irregular_vertex(const Eigen::PlainObjectBase<DerivedV> &V, const Eigen::PlainObjectBase<DerivedF> &F)
+IGL_INLINE std::vector<bool> igl::is_irregular_vertex(const Eigen::MatrixBase<DerivedV> &V, const Eigen::MatrixBase<DerivedF> &F)
 {
 {
   Eigen::VectorXi count = Eigen::VectorXi::Zero(F.maxCoeff()+1);
   Eigen::VectorXi count = Eigen::VectorXi::Zero(F.maxCoeff()+1);
 
 
@@ -39,6 +39,6 @@ IGL_INLINE std::vector<bool> igl::is_irregular_vertex(const Eigen::PlainObjectBa
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template std::vector<bool, std::allocator<bool> > igl::is_irregular_vertex<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&);
-template std::vector<bool, std::allocator<bool> > igl::is_irregular_vertex<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&);
+template std::vector<bool, std::allocator<bool> > igl::is_irregular_vertex<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&);
+template std::vector<bool, std::allocator<bool> > igl::is_irregular_vertex<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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&);
 #endif
 #endif

+ 1 - 1
include/igl/is_irregular_vertex.h

@@ -23,7 +23,7 @@ namespace igl
   // Returns #V vector of bools revealing whether vertices are singular
   // Returns #V vector of bools revealing whether vertices are singular
   //
   //
   template <typename DerivedV, typename DerivedF>
   template <typename DerivedV, typename DerivedF>
-  IGL_INLINE std::vector<bool> is_irregular_vertex(const Eigen::PlainObjectBase<DerivedV> &V, const Eigen::PlainObjectBase<DerivedF> &F);
+  IGL_INLINE std::vector<bool> is_irregular_vertex(const Eigen::MatrixBase<DerivedV> &V, const Eigen::MatrixBase<DerivedF> &F);
 }
 }
 
 
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 4 - 4
include/igl/isdiag.cpp

@@ -7,14 +7,14 @@
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "isdiag.h"
 #include "isdiag.h"
 
 
-template <typename Scalar>
-IGL_INLINE bool igl::isdiag(const Eigen::SparseMatrix<Scalar> & A)
+template <typename Derived>
+IGL_INLINE bool igl::isdiag(const Eigen::SparseCompressedBase<Derived> & A)
 {
 {
   // Iterate over outside of A
   // Iterate over outside of A
   for(int k=0; k<A.outerSize(); ++k)
   for(int k=0; k<A.outerSize(); ++k)
   {
   {
     // Iterate over inside
     // Iterate over inside
-    for(typename Eigen::SparseMatrix<Scalar>::InnerIterator it (A,k); it; ++it)
+    for(typename Derived::InnerIterator it (A,k); it; ++it)
     {
     {
       if(it.row() != it.col() && it.value()!=0)
       if(it.row() != it.col() && it.value()!=0)
       {
       {
@@ -28,5 +28,5 @@ IGL_INLINE bool igl::isdiag(const Eigen::SparseMatrix<Scalar> & A)
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template bool igl::isdiag<double>(class Eigen::SparseMatrix<double,0,int> const &);
+template bool igl::isdiag<Eigen::SparseMatrix<double,0,int>>(Eigen::SparseCompressedBase<Eigen::SparseMatrix<double,0,int>> const &);
 #endif
 #endif

+ 2 - 2
include/igl/isdiag.h

@@ -17,8 +17,8 @@ namespace igl
   // Inputs:
   // Inputs:
   //   A  m by n sparse matrix
   //   A  m by n sparse matrix
   // Returns true iff and only if the matrix is diagonal.
   // Returns true iff and only if the matrix is diagonal.
-  template <typename Scalar>
-  IGL_INLINE bool isdiag(const Eigen::SparseMatrix<Scalar> & A);
+  template <typename Derived>
+  IGL_INLINE bool isdiag(const Eigen::SparseCompressedBase<Derived> & A);
 };
 };
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY
 #  include "isdiag.cpp"
 #  include "isdiag.cpp"

+ 10 - 10
include/igl/isolines.cpp

@@ -38,21 +38,21 @@ IGL_INLINE void igl::isolines(
     const int nFaces = F.rows();
     const int nFaces = F.rows();
     const int np1 = n+1;
     const int np1 = n+1;
     const double min = z.minCoeff(), max = z.maxCoeff();
     const double min = z.minCoeff(), max = z.maxCoeff();
-    
-    
+
+
     //Following http://www.alecjacobson.com/weblog/?p=2529
     //Following http://www.alecjacobson.com/weblog/?p=2529
     typedef typename DerivedZ::Scalar Scalar;
     typedef typename DerivedZ::Scalar Scalar;
     typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1> Vec;
     typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1> Vec;
     Vec iso(np1);
     Vec iso(np1);
     for(int i=0; i<np1; ++i)
     for(int i=0; i<np1; ++i)
         iso(i) = Scalar(i)/Scalar(n)*(max-min) + min;
         iso(i) = Scalar(i)/Scalar(n)*(max-min) + min;
-    
+
     typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> Matrix;
     typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> Matrix;
     std::array<Matrix,3> t{{Matrix(nFaces, np1),
     std::array<Matrix,3> t{{Matrix(nFaces, np1),
         Matrix(nFaces, np1), Matrix(nFaces, np1)}};
         Matrix(nFaces, np1), Matrix(nFaces, np1)}};
     for(int i=0; i<nFaces; ++i) {
     for(int i=0; i<nFaces; ++i) {
         for(int k=0; k<3; ++k) {
         for(int k=0; k<3; ++k) {
-            const Scalar z1=z(F(i,k)), z2=z(F(i,(k+1)%3));
+            const Scalar z1=z(F(i,k), 0), z2=z(F(i,(k+1)%3), 0);
             for(int j=0; j<np1; ++j) {
             for(int j=0; j<np1; ++j) {
                 t[k](i,j) = (iso(j)-z1) / (z2-z1);
                 t[k](i,j) = (iso(j)-z1) / (z2-z1);
                 if(t[k](i,j)<0 || t[k](i,j)>1)
                 if(t[k](i,j)<0 || t[k](i,j)>1)
@@ -60,7 +60,7 @@ IGL_INLINE void igl::isolines(
             }
             }
         }
         }
     }
     }
-    
+
     std::array<std::vector<int>,3> Fij, Iij;
     std::array<std::vector<int>,3> Fij, Iij;
     for(int i=0; i<nFaces; ++i) {
     for(int i=0; i<nFaces; ++i) {
         for(int j=0; j<np1; ++j) {
         for(int j=0; j<np1; ++j) {
@@ -73,7 +73,7 @@ IGL_INLINE void igl::isolines(
             }
             }
         }
         }
     }
     }
-    
+
     const int K = Fij[0].size()+Fij[1].size()+Fij[2].size();
     const int K = Fij[0].size()+Fij[1].size()+Fij[2].size();
     isoV.resize(2*K, dim);
     isoV.resize(2*K, dim);
     int b = 0;
     int b = 0;
@@ -89,12 +89,12 @@ IGL_INLINE void igl::isolines(
         }
         }
         b += Fij[k].size();
         b += Fij[k].size();
     }
     }
-    
+
     isoE.resize(K,2);
     isoE.resize(K,2);
     for(int i=0; i<K; ++i)
     for(int i=0; i<K; ++i)
         isoE.row(i) << i, K+i;
         isoE.row(i) << i, K+i;
-    
-    
+
+
     //Remove double entries
     //Remove double entries
     typedef typename DerivedIsoV::Scalar LScalar;
     typedef typename DerivedIsoV::Scalar LScalar;
     typedef typename DerivedIsoE::Scalar LInt;
     typedef typename DerivedIsoE::Scalar LInt;
@@ -104,7 +104,7 @@ IGL_INLINE void igl::isolines(
     LIVec dummy1, dummy2;
     LIVec dummy1, dummy2;
     igl::remove_duplicate_vertices(LMat(isoV), LIMat(isoE),
     igl::remove_duplicate_vertices(LMat(isoV), LIMat(isoE),
                                    2.2204e-15, isoV, dummy1, dummy2, isoE);
                                    2.2204e-15, isoV, dummy1, dummy2, isoE);
-    
+
 }
 }
 
 
 
 

+ 4 - 4
include/igl/local_basis.cpp

@@ -17,8 +17,8 @@
 
 
 template <typename DerivedV, typename DerivedF>
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::local_basis(
 IGL_INLINE void igl::local_basis(
-  const Eigen::PlainObjectBase<DerivedV>& V,
-  const Eigen::PlainObjectBase<DerivedF>& F,
+  const Eigen::MatrixBase<DerivedV>& V,
+  const Eigen::MatrixBase<DerivedF>& F,
   Eigen::PlainObjectBase<DerivedV>& B1,
   Eigen::PlainObjectBase<DerivedV>& B1,
   Eigen::PlainObjectBase<DerivedV>& B2,
   Eigen::PlainObjectBase<DerivedV>& B2,
   Eigen::PlainObjectBase<DerivedV>& B3
   Eigen::PlainObjectBase<DerivedV>& B3
@@ -46,6 +46,6 @@ IGL_INLINE void igl::local_basis(
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template void igl::local_basis<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
-template void igl::local_basis<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> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::local_basis<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
+template void igl::local_basis<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 2 - 2
include/igl/local_basis.h

@@ -30,8 +30,8 @@ namespace igl
   // See also: adjacency_matrix
   // See also: adjacency_matrix
   template <typename DerivedV, typename DerivedF>
   template <typename DerivedV, typename DerivedF>
   IGL_INLINE void local_basis(
   IGL_INLINE void local_basis(
-    const Eigen::PlainObjectBase<DerivedV>& V,
-    const Eigen::PlainObjectBase<DerivedF>& F,
+    const Eigen::MatrixBase<DerivedV>& V,
+    const Eigen::MatrixBase<DerivedF>& F,
     Eigen::PlainObjectBase<DerivedV>& B1,
     Eigen::PlainObjectBase<DerivedV>& B1,
     Eigen::PlainObjectBase<DerivedV>& B2,
     Eigen::PlainObjectBase<DerivedV>& B2,
     Eigen::PlainObjectBase<DerivedV>& B3
     Eigen::PlainObjectBase<DerivedV>& B3

+ 28 - 28
include/igl/loop.cpp

@@ -20,21 +20,21 @@ template <
   typename DerivedNF>
   typename DerivedNF>
 IGL_INLINE void igl::loop(
 IGL_INLINE void igl::loop(
   const int n_verts,
   const int n_verts,
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::SparseMatrix<SType>& S,
   Eigen::SparseMatrix<SType>& S,
   Eigen::PlainObjectBase<DerivedNF> & NF)
   Eigen::PlainObjectBase<DerivedNF> & NF)
 {
 {
   typedef Eigen::SparseMatrix<SType> SparseMat;
   typedef Eigen::SparseMatrix<SType> SparseMat;
   typedef Eigen::Triplet<SType> Triplet_t;
   typedef Eigen::Triplet<SType> Triplet_t;
-  
+
   //Ref. https://graphics.stanford.edu/~mdfisher/subdivision.html
   //Ref. https://graphics.stanford.edu/~mdfisher/subdivision.html
   //Heavily borrowing from igl::upsample
   //Heavily borrowing from igl::upsample
-  
-  DerivedF FF, FFi;
+
+  Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, Eigen::Dynamic> FF, FFi;
   triangle_triangle_adjacency(F, FF, FFi);
   triangle_triangle_adjacency(F, FF, FFi);
   std::vector<std::vector<typename DerivedF::Scalar>> adjacencyList;
   std::vector<std::vector<typename DerivedF::Scalar>> adjacencyList;
   adjacency_list(F, adjacencyList, true);
   adjacency_list(F, adjacencyList, true);
-  
+
   //Compute the number and positions of the vertices to insert (on edges)
   //Compute the number and positions of the vertices to insert (on edges)
   Eigen::MatrixXi NI = Eigen::MatrixXi::Constant(FF.rows(), FF.cols(), -1);
   Eigen::MatrixXi NI = Eigen::MatrixXi::Constant(FF.rows(), FF.cols(), -1);
   Eigen::MatrixXi NIdoubles = Eigen::MatrixXi::Zero(FF.rows(), FF.cols());
   Eigen::MatrixXi NIdoubles = Eigen::MatrixXi::Zero(FF.rows(), FF.cols());
@@ -48,12 +48,12 @@ IGL_INLINE void igl::loop(
       {
       {
         NI(i,j) = counter;
         NI(i,j) = counter;
         NIdoubles(i,j) = 0;
         NIdoubles(i,j) = 0;
-        if (FF(i,j) != -1) 
+        if (FF(i,j) != -1)
         {
         {
           //If it is not a boundary
           //If it is not a boundary
           NI(FF(i,j), FFi(i,j)) = counter;
           NI(FF(i,j), FFi(i,j)) = counter;
           NIdoubles(i,j) = 1;
           NIdoubles(i,j) = 1;
-        } else 
+        } else
         {
         {
           //Mark boundary vertices for later
           //Mark boundary vertices for later
           vertIsOnBdry(F(i,j)) = 1;
           vertIsOnBdry(F(i,j)) = 1;
@@ -63,24 +63,24 @@ IGL_INLINE void igl::loop(
       }
       }
     }
     }
   }
   }
-  
+
   const int& n_odd = n_verts;
   const int& n_odd = n_verts;
   const int& n_even = counter;
   const int& n_even = counter;
   const int n_newverts = n_odd + n_even;
   const int n_newverts = n_odd + n_even;
-  
+
   //Construct vertex positions
   //Construct vertex positions
   std::vector<Triplet_t> tripletList;
   std::vector<Triplet_t> tripletList;
-  for(int i=0; i<n_odd; ++i) 
+  for(int i=0; i<n_odd; ++i)
   {
   {
     //Old vertices
     //Old vertices
-    const std::vector<int>& localAdjList = adjacencyList[i];
-    if(vertIsOnBdry(i)==1) 
+    const auto& localAdjList = adjacencyList[i];
+    if(vertIsOnBdry(i)==1)
     {
     {
       //Boundary vertex
       //Boundary vertex
       tripletList.emplace_back(i, localAdjList.front(), 1./8.);
       tripletList.emplace_back(i, localAdjList.front(), 1./8.);
       tripletList.emplace_back(i, localAdjList.back(), 1./8.);
       tripletList.emplace_back(i, localAdjList.back(), 1./8.);
       tripletList.emplace_back(i, i, 3./4.);
       tripletList.emplace_back(i, i, 3./4.);
-    } else 
+    } else
     {
     {
       const int n = localAdjList.size();
       const int n = localAdjList.size();
       const SType dn = n;
       const SType dn = n;
@@ -99,19 +99,19 @@ IGL_INLINE void igl::loop(
       tripletList.emplace_back(i, i, 1.-dn*beta);
       tripletList.emplace_back(i, i, 1.-dn*beta);
     }
     }
   }
   }
-  for(int i=0; i<FF.rows(); ++i) 
+  for(int i=0; i<FF.rows(); ++i)
   {
   {
     //New vertices
     //New vertices
-    for(int j=0; j<3; ++j) 
+    for(int j=0; j<3; ++j)
     {
     {
-      if(NIdoubles(i,j)==0) 
+      if(NIdoubles(i,j)==0)
       {
       {
-        if(FF(i,j)==-1) 
+        if(FF(i,j)==-1)
         {
         {
           //Boundary vertex
           //Boundary vertex
           tripletList.emplace_back(NI(i,j) + n_odd, F(i,j), 1./2.);
           tripletList.emplace_back(NI(i,j) + n_odd, F(i,j), 1./2.);
           tripletList.emplace_back(NI(i,j) + n_odd, F(i, (j+1)%3), 1./2.);
           tripletList.emplace_back(NI(i,j) + n_odd, F(i, (j+1)%3), 1./2.);
-        } else 
+        } else
         {
         {
           tripletList.emplace_back(NI(i,j) + n_odd, F(i,j), 3./8.);
           tripletList.emplace_back(NI(i,j) + n_odd, F(i,j), 3./8.);
           tripletList.emplace_back(NI(i,j) + n_odd, F(i, (j+1)%3), 3./8.);
           tripletList.emplace_back(NI(i,j) + n_odd, F(i, (j+1)%3), 3./8.);
@@ -123,20 +123,20 @@ IGL_INLINE void igl::loop(
   }
   }
   S.resize(n_newverts, n_verts);
   S.resize(n_newverts, n_verts);
   S.setFromTriplets(tripletList.begin(), tripletList.end());
   S.setFromTriplets(tripletList.begin(), tripletList.end());
-  
+
   // Build the new topology (Every face is replaced by four)
   // Build the new topology (Every face is replaced by four)
   NF.resize(F.rows()*4, 3);
   NF.resize(F.rows()*4, 3);
   for(int i=0; i<F.rows();++i)
   for(int i=0; i<F.rows();++i)
   {
   {
-    Eigen::VectorXi VI(6);
+    Eigen::Matrix<typename DerivedF::Scalar, 6, 1> VI(6);
     VI << F(i,0), F(i,1), F(i,2), NI(i,0) + n_odd, NI(i,1) + n_odd, NI(i,2) + n_odd;
     VI << F(i,0), F(i,1), F(i,2), NI(i,0) + n_odd, NI(i,1) + n_odd, NI(i,2) + n_odd;
-    
-    Eigen::VectorXi f0(3), f1(3), f2(3), f3(3);
+
+    Eigen::Matrix<typename DerivedF::Scalar, 3, 1> f0(3), f1(3), f2(3), f3(3);
     f0 << VI(0), VI(3), VI(5);
     f0 << VI(0), VI(3), VI(5);
     f1 << VI(1), VI(4), VI(3);
     f1 << VI(1), VI(4), VI(3);
     f2 << VI(3), VI(4), VI(5);
     f2 << VI(3), VI(4), VI(5);
     f3 << VI(4), VI(2), VI(5);
     f3 << VI(4), VI(2), VI(5);
-    
+
     NF.row((i*4)+0) = f0;
     NF.row((i*4)+0) = f0;
     NF.row((i*4)+1) = f1;
     NF.row((i*4)+1) = f1;
     NF.row((i*4)+2) = f2;
     NF.row((i*4)+2) = f2;
@@ -145,20 +145,20 @@ IGL_INLINE void igl::loop(
 }
 }
 
 
 template <
 template <
-  typename DerivedV, 
+  typename DerivedV,
   typename DerivedF,
   typename DerivedF,
   typename DerivedNV,
   typename DerivedNV,
   typename DerivedNF>
   typename DerivedNF>
 IGL_INLINE void igl::loop(
 IGL_INLINE void igl::loop(
-  const Eigen::PlainObjectBase<DerivedV>& V,
-  const Eigen::PlainObjectBase<DerivedF>& F,
+  const Eigen::MatrixBase<DerivedV>& V,
+  const Eigen::MatrixBase<DerivedF>& F,
   Eigen::PlainObjectBase<DerivedNV>& NV,
   Eigen::PlainObjectBase<DerivedNV>& NV,
   Eigen::PlainObjectBase<DerivedNF>& NF,
   Eigen::PlainObjectBase<DerivedNF>& NF,
   const int number_of_subdivs)
   const int number_of_subdivs)
 {
 {
   NV = V;
   NV = V;
   NF = F;
   NF = F;
-  for(int i=0; i<number_of_subdivs; ++i) 
+  for(int i=0; i<number_of_subdivs; ++i)
   {
   {
     DerivedNF tempF = NF;
     DerivedNF tempF = NF;
     Eigen::SparseMatrix<typename DerivedV::Scalar> S;
     Eigen::SparseMatrix<typename DerivedV::Scalar> S;
@@ -169,5 +169,5 @@ IGL_INLINE void igl::loop(
 }
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
-template void igl::loop<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> >(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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, int);
+template void igl::loop<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>>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>> &, int);
 #endif
 #endif

+ 4 - 4
include/igl/loop.h

@@ -31,7 +31,7 @@ namespace igl
     typename DerivedNF>
     typename DerivedNF>
   IGL_INLINE void loop(
   IGL_INLINE void loop(
     const int n_verts,
     const int n_verts,
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedF> & F,
     Eigen::SparseMatrix<SType>& S,
     Eigen::SparseMatrix<SType>& S,
     Eigen::PlainObjectBase<DerivedNF> & NF);
     Eigen::PlainObjectBase<DerivedNF> & NF);
   // LOOP Given the triangle mesh [V, F], computes number_of_subdivs steps of loop subdivision and outputs the new mesh [newV, newF]
   // LOOP Given the triangle mesh [V, F], computes number_of_subdivs steps of loop subdivision and outputs the new mesh [newV, newF]
@@ -44,13 +44,13 @@ namespace igl
   //  NV a matrix containing the new vertices
   //  NV a matrix containing the new vertices
   //  NF a matrix containing the new faces
   //  NF a matrix containing the new faces
   template <
   template <
-    typename DerivedV, 
+    typename DerivedV,
     typename DerivedF,
     typename DerivedF,
     typename DerivedNV,
     typename DerivedNV,
     typename DerivedNF>
     typename DerivedNF>
   IGL_INLINE void loop(
   IGL_INLINE void loop(
-    const Eigen::PlainObjectBase<DerivedV>& V,
-    const Eigen::PlainObjectBase<DerivedF>& F,
+    const Eigen::MatrixBase<DerivedV>& V,
+    const Eigen::MatrixBase<DerivedF>& F,
     Eigen::PlainObjectBase<DerivedNV>& NV,
     Eigen::PlainObjectBase<DerivedNV>& NV,
     Eigen::PlainObjectBase<DerivedNF>& NF,
     Eigen::PlainObjectBase<DerivedNF>& NF,
     const int number_of_subdivs = 1);
     const int number_of_subdivs = 1);

+ 2 - 2
include/igl/massmatrix.cpp

@@ -48,8 +48,8 @@ IGL_INLINE void igl::massmatrix(
     return massmatrix_intrinsic(l,F,type,M);
     return massmatrix_intrinsic(l,F,type,M);
   }else if(simplex_size == 4)
   }else if(simplex_size == 4)
   {
   {
-    Matrix<int,Dynamic,1> MI;
-    Matrix<int,Dynamic,1> MJ;
+    Matrix<typename DerivedF::Scalar,Dynamic,1> MI;
+    Matrix<typename DerivedF::Scalar,Dynamic,1> MJ;
     Matrix<Scalar,Dynamic,1> MV;
     Matrix<Scalar,Dynamic,1> MV;
     assert(V.cols() == 3);
     assert(V.cols() == 3);
     assert(eff_type == MASSMATRIX_TYPE_BARYCENTRIC);
     assert(eff_type == MASSMATRIX_TYPE_BARYCENTRIC);

+ 2 - 2
include/igl/massmatrix_intrinsic.cpp

@@ -47,8 +47,8 @@ IGL_INLINE void igl::massmatrix_intrinsic(
   assert(F.cols() == 3 && "only triangles supported");
   assert(F.cols() == 3 && "only triangles supported");
   Matrix<Scalar,Dynamic,1> dblA;
   Matrix<Scalar,Dynamic,1> dblA;
   doublearea(l,0.,dblA);
   doublearea(l,0.,dblA);
-  Matrix<int,Dynamic,1> MI;
-  Matrix<int,Dynamic,1> MJ;
+  Matrix<typename DerivedF::Scalar,Dynamic,1> MI;
+  Matrix<typename DerivedF::Scalar,Dynamic,1> MJ;
   Matrix<Scalar,Dynamic,1> MV;
   Matrix<Scalar,Dynamic,1> MV;
 
 
   switch(eff_type)
   switch(eff_type)

+ 2 - 2
include/igl/mat_min.cpp

@@ -19,8 +19,8 @@ IGL_INLINE void igl::mat_min(
   // output size
   // output size
   int n = (dim==1?X.cols():X.rows());
   int n = (dim==1?X.cols():X.rows());
   // resize output
   // resize output
-  Y.resize(n);
-  I.resize(n);
+  Y.resize(n,1);
+  I.resize(n,1);
 
 
   // loop over dimension opposite of dim
   // loop over dimension opposite of dim
   for(int j = 0;j<n;j++)
   for(int j = 0;j<n;j++)

+ 17 - 19
include/igl/matrix_to_list.cpp

@@ -11,7 +11,7 @@
 
 
 template <typename DerivedM>
 template <typename DerivedM>
 IGL_INLINE void igl::matrix_to_list(
 IGL_INLINE void igl::matrix_to_list(
-  const Eigen::DenseBase<DerivedM> & M,
+  const Eigen::MatrixBase<DerivedM> & M,
   std::vector<std::vector<typename DerivedM::Scalar > > & V)
   std::vector<std::vector<typename DerivedM::Scalar > > & V)
 {
 {
   using namespace std;
   using namespace std;
@@ -29,7 +29,7 @@ IGL_INLINE void igl::matrix_to_list(
 
 
 template <typename DerivedM>
 template <typename DerivedM>
 IGL_INLINE void igl::matrix_to_list(
 IGL_INLINE void igl::matrix_to_list(
-  const Eigen::DenseBase<DerivedM> & M,
+  const Eigen::MatrixBase<DerivedM> & M,
   std::vector<typename DerivedM::Scalar > & V)
   std::vector<typename DerivedM::Scalar > & V)
 {
 {
   using namespace std;
   using namespace std;
@@ -46,7 +46,7 @@ IGL_INLINE void igl::matrix_to_list(
 
 
 template <typename DerivedM>
 template <typename DerivedM>
 IGL_INLINE std::vector<typename DerivedM::Scalar > igl::matrix_to_list(
 IGL_INLINE std::vector<typename DerivedM::Scalar > igl::matrix_to_list(
-    const Eigen::DenseBase<DerivedM> & M)
+    const Eigen::MatrixBase<DerivedM> & M)
 {
 {
   std::vector<typename DerivedM::Scalar> V;
   std::vector<typename DerivedM::Scalar> V;
   matrix_to_list(M,V);
   matrix_to_list(M,V);
@@ -56,26 +56,24 @@ IGL_INLINE std::vector<typename DerivedM::Scalar > igl::matrix_to_list(
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template void igl::matrix_to_list<Eigen::Block<Eigen::Matrix<float, -1, -1, 0, -1, -1>, -1, 1, true> >(Eigen::DenseBase<Eigen::Block<Eigen::Matrix<float, -1, -1, 0, -1, -1>, -1, 1, true> > const&, std::vector<Eigen::Block<Eigen::Matrix<float, -1, -1, 0, -1, -1>, -1, 1, true>::Scalar, std::allocator<Eigen::Block<Eigen::Matrix<float, -1, -1, 0, -1, -1>, -1, 1, true>::Scalar> >&);
+template void igl::matrix_to_list<Eigen::Block<Eigen::Matrix<float, -1, -1, 0, -1, -1>, -1, 1, true> >(Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<float, -1, -1, 0, -1, -1>, -1, 1, true> > const&, std::vector<Eigen::Block<Eigen::Matrix<float, -1, -1, 0, -1, -1>, -1, 1, true>::Scalar, std::allocator<Eigen::Block<Eigen::Matrix<float, -1, -1, 0, -1, -1>, -1, 1, true>::Scalar> >&);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template void igl::matrix_to_list<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true> >(Eigen::DenseBase<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true> > const&, std::vector<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true>::Scalar, std::allocator<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true>::Scalar> >&);
+template void igl::matrix_to_list<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true> >(Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true> > const&, std::vector<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true>::Scalar, std::allocator<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true>::Scalar> >&);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template void igl::matrix_to_list<Eigen::Matrix<int, -1, 2, 0, -1, 2> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, std::vector<Eigen::Matrix<int, -1, 2, 0, -1, 2>::Scalar, std::allocator<Eigen::Matrix<int, -1, 2, 0, -1, 2>::Scalar> >&);
+template void igl::matrix_to_list<Eigen::Matrix<int, -1, 2, 0, -1, 2> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, std::vector<Eigen::Matrix<int, -1, 2, 0, -1, 2>::Scalar, std::allocator<Eigen::Matrix<int, -1, 2, 0, -1, 2>::Scalar> >&);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template std::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1>::Scalar> > igl::matrix_to_list<Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&);
+template std::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1>::Scalar> > igl::matrix_to_list<Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> > igl::matrix_to_list<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&);
+template std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> > igl::matrix_to_list<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&);
 //template void igl::matrix_to_list<Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, double>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&);
 //template void igl::matrix_to_list<Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, double>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&);
 //template void igl::matrix_to_list<Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >, int>(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> > > >&);
 //template void igl::matrix_to_list<Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >, int>(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> > > >&);
-template void igl::matrix_to_list<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar> >, std::allocator<std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar> > > >&);
-template void igl::matrix_to_list<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar> >, std::allocator<std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar> > > >&);
-template void igl::matrix_to_list<Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, std::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1>::Scalar> >&);
-template void igl::matrix_to_list<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar> >&);
-template void igl::matrix_to_list<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> >&);
-template void igl::matrix_to_list<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> >, std::allocator<std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> > > >&);
-template void igl::matrix_to_list<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar> >&);
-template void igl::matrix_to_list<Eigen::Matrix<int, 1, -1, 1, 1, -1> >(Eigen::DenseBase<Eigen::Matrix<int, 1, -1, 1, 1, -1> > const&, std::vector<Eigen::Matrix<int, 1, -1, 1, 1, -1>::Scalar, std::allocator<Eigen::Matrix<int, 1, -1, 1, 1, -1>::Scalar> >&);
-template std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar> > igl::matrix_to_list<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
-template void igl::matrix_to_list<Eigen::Block<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 1, -1, false> >(Eigen::DenseBase<Eigen::Block<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 1, -1, false> > const&, std::vector<Eigen::Block<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 1, -1, false>::Scalar, std::allocator<Eigen::Block<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 1, -1, false>::Scalar> >&);
-template std::vector<Eigen::Block<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 1, -1, false>::Scalar, std::allocator<Eigen::Block<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 1, -1, false>::Scalar> > igl::matrix_to_list<Eigen::Block<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 1, -1, false> >(Eigen::DenseBase<Eigen::Block<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 1, -1, false> > const&);
+template void igl::matrix_to_list<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar> >, std::allocator<std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar> > > >&);
+template void igl::matrix_to_list<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar> >, std::allocator<std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar> > > >&);
+template void igl::matrix_to_list<Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, std::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1>::Scalar> >&);
+template void igl::matrix_to_list<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar> >&);
+template void igl::matrix_to_list<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> >&);
+template void igl::matrix_to_list<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> >, std::allocator<std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> > > >&);
+template void igl::matrix_to_list<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar> >&);
+template void igl::matrix_to_list<Eigen::Matrix<int, 1, -1, 1, 1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, 1, -1, 1, 1, -1> > const&, std::vector<Eigen::Matrix<int, 1, -1, 1, 1, -1>::Scalar, std::allocator<Eigen::Matrix<int, 1, -1, 1, 1, -1>::Scalar> >&);
+template std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar> > igl::matrix_to_list<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
 #endif
 #endif

+ 3 - 3
include/igl/matrix_to_list.h

@@ -28,7 +28,7 @@ namespace igl
   // See also: list_to_matrix
   // See also: list_to_matrix
   template <typename DerivedM>
   template <typename DerivedM>
   IGL_INLINE void matrix_to_list(
   IGL_INLINE void matrix_to_list(
-    const Eigen::DenseBase<DerivedM> & M, 
+    const Eigen::MatrixBase<DerivedM> & M, 
     std::vector<std::vector<typename DerivedM::Scalar > > & V);
     std::vector<std::vector<typename DerivedM::Scalar > > & V);
   // Convert a matrix to a list (std::vector) of elements in column-major
   // Convert a matrix to a list (std::vector) of elements in column-major
   // ordering.
   // ordering.
@@ -39,12 +39,12 @@ namespace igl
   //    V  an m*n list of elements
   //    V  an m*n list of elements
   template <typename DerivedM>
   template <typename DerivedM>
   IGL_INLINE void matrix_to_list(
   IGL_INLINE void matrix_to_list(
-    const Eigen::DenseBase<DerivedM> & M, 
+    const Eigen::MatrixBase<DerivedM> & M, 
     std::vector<typename DerivedM::Scalar > & V);
     std::vector<typename DerivedM::Scalar > & V);
   // Return wrapper
   // Return wrapper
   template <typename DerivedM>
   template <typename DerivedM>
   IGL_INLINE std::vector<typename DerivedM::Scalar > matrix_to_list(
   IGL_INLINE std::vector<typename DerivedM::Scalar > matrix_to_list(
-      const Eigen::DenseBase<DerivedM> & M);
+      const Eigen::MatrixBase<DerivedM> & M);
 }
 }
 
 
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 5 - 2
include/igl/min_quad_with_fixed.cpp

@@ -51,6 +51,7 @@ IGL_INLINE bool igl::min_quad_with_fixed_precompute(
     assert(n == Aeq.cols() && "#Aeq.cols() should match A.rows()");
     assert(n == Aeq.cols() && "#Aeq.cols() should match A.rows()");
   }
   }
 
 
+  assert(known.cols() == 1 && "known should be a vector");
   assert(A.rows() == n && "A should be square");
   assert(A.rows() == n && "A should be square");
   assert(A.cols() == n && "A should be square");
   assert(A.cols() == n && "A should be square");
 
 
@@ -63,14 +64,16 @@ IGL_INLINE bool igl::min_quad_with_fixed_precompute(
 
 
 
 
   // cache known
   // cache known
-  data.known = known;
+  // FIXME: This is *NOT* generic and introduces a copy.
+  data.known = known.template cast<int>();
+
   // get list of unknown indices
   // get list of unknown indices
   data.unknown.resize(n-kr);
   data.unknown.resize(n-kr);
   std::vector<bool> unknown_mask;
   std::vector<bool> unknown_mask;
   unknown_mask.resize(n,true);
   unknown_mask.resize(n,true);
   for(int i = 0;i<kr;i++)
   for(int i = 0;i<kr;i++)
   {
   {
-    unknown_mask[known(i)] = false;
+    unknown_mask[known(i, 0)] = false;
   }
   }
   int u = 0;
   int u = 0;
   for(int i = 0;i<n;i++)
   for(int i = 0;i<n;i++)

+ 5 - 5
include/igl/orientable_patches.cpp

@@ -14,7 +14,7 @@
 
 
 template <typename DerivedF, typename DerivedC, typename AScalar>
 template <typename DerivedF, typename DerivedC, typename AScalar>
 IGL_INLINE void igl::orientable_patches(
 IGL_INLINE void igl::orientable_patches(
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedC> & C,
   Eigen::PlainObjectBase<DerivedC> & C,
   Eigen::SparseMatrix<AScalar> & A)
   Eigen::SparseMatrix<AScalar> & A)
 {
 {
@@ -27,7 +27,7 @@ IGL_INLINE void igl::orientable_patches(
   // List of all "half"-edges: 3*#F by 2
   // List of all "half"-edges: 3*#F by 2
   Matrix<typename DerivedF::Scalar, Dynamic, 2> allE,sortallE,uE;
   Matrix<typename DerivedF::Scalar, Dynamic, 2> allE,sortallE,uE;
   allE.resize(F.rows()*3,2);
   allE.resize(F.rows()*3,2);
-  Matrix<int,Dynamic,2> IX;
+  Matrix<typename DerivedF::Scalar,Dynamic,2> IX;
   VectorXi IA,IC;
   VectorXi IA,IC;
   allE.block(0*F.rows(),0,F.rows(),1) = F.col(1);
   allE.block(0*F.rows(),0,F.rows(),1) = F.col(1);
   allE.block(0*F.rows(),1,F.rows(),1) = F.col(2);
   allE.block(0*F.rows(),1,F.rows(),1) = F.col(2);
@@ -91,7 +91,7 @@ IGL_INLINE void igl::orientable_patches(
 
 
 template <typename DerivedF, typename DerivedC>
 template <typename DerivedF, typename DerivedC>
 IGL_INLINE void igl::orientable_patches(
 IGL_INLINE void igl::orientable_patches(
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedC> & C)
   Eigen::PlainObjectBase<DerivedC> & C)
 {
 {
   Eigen::SparseMatrix<typename DerivedF::Scalar> A;
   Eigen::SparseMatrix<typename DerivedF::Scalar> A;
@@ -100,6 +100,6 @@ IGL_INLINE void igl::orientable_patches(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::orientable_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, int>(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::SparseMatrix<int, 0, int>&);
-template void igl::orientable_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::orientable_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, int>(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::SparseMatrix<int, 0, int>&);
+template void igl::orientable_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 2 - 2
include/igl/orientable_patches.h

@@ -27,12 +27,12 @@ namespace igl
   // 
   // 
   template <typename DerivedF, typename DerivedC, typename AScalar>
   template <typename DerivedF, typename DerivedC, typename AScalar>
   IGL_INLINE void orientable_patches(
   IGL_INLINE void orientable_patches(
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedF> & F,
     Eigen::PlainObjectBase<DerivedC> & C,
     Eigen::PlainObjectBase<DerivedC> & C,
     Eigen::SparseMatrix<AScalar> & A);
     Eigen::SparseMatrix<AScalar> & A);
   template <typename DerivedF, typename DerivedC>
   template <typename DerivedF, typename DerivedC>
   IGL_INLINE void orientable_patches(
   IGL_INLINE void orientable_patches(
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedF> & F,
     Eigen::PlainObjectBase<DerivedC> & C);
     Eigen::PlainObjectBase<DerivedC> & C);
 };
 };
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 4 - 4
include/igl/per_edge_normals.cpp

@@ -36,10 +36,10 @@ IGL_INLINE void igl::per_edge_normals(
   // number of faces
   // number of faces
   const int m = F.rows();
   const int m = F.rows();
   // All occurrences of directed edges
   // All occurrences of directed edges
-  MatrixXi allE;
+  Matrix<typename DerivedF::Scalar, Dynamic, Dynamic> allE;
   oriented_facets(F,allE);
   oriented_facets(F,allE);
   // Find unique undirected edges and mapping
   // Find unique undirected edges and mapping
-  VectorXi _;
+  Matrix<typename DerivedF::Scalar, Dynamic, 1> _;
   unique_simplices(allE,E,_,EMAP);
   unique_simplices(allE,E,_,EMAP);
   // now sort(allE,2) == E(EMAP,:), that is, if EMAP(i) = j, then E.row(j) is
   // now sort(allE,2) == E(EMAP,:), that is, if EMAP(i) = j, then E.row(j) is
   // the undirected edge corresponding to the directed edge allE.row(i).
   // the undirected edge corresponding to the directed edge allE.row(i).
@@ -67,10 +67,10 @@ IGL_INLINE void igl::per_edge_normals(
     {
     {
       if(weighting == PER_EDGE_NORMALS_WEIGHTING_TYPE_UNIFORM)
       if(weighting == PER_EDGE_NORMALS_WEIGHTING_TYPE_UNIFORM)
       {
       {
-        N.row(EMAP(f+c*m)) += FN.row(f);
+        N.row(EMAP(f+c*m, 0)) += FN.row(f);
       }else
       }else
       {
       {
-        N.row(EMAP(f+c*m)) += W(f) * FN.row(f);
+        N.row(EMAP(f+c*m, 0)) += W(f) * FN.row(f);
       }
       }
     }
     }
   }
   }

+ 3 - 3
include/igl/per_vertex_attribute_smoothing.cpp

@@ -10,8 +10,8 @@
 
 
 template <typename DerivedV, typename DerivedF>
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::per_vertex_attribute_smoothing(
 IGL_INLINE void igl::per_vertex_attribute_smoothing(
-    const Eigen::PlainObjectBase<DerivedV>& Ain,
-    const Eigen::PlainObjectBase<DerivedF>& F,
+    const Eigen::MatrixBase<DerivedV>& Ain,
+    const Eigen::MatrixBase<DerivedF>& F,
     Eigen::PlainObjectBase<DerivedV> & Aout)
     Eigen::PlainObjectBase<DerivedV> & Aout)
 {
 {
     std::vector<double> denominator(Ain.rows(), 0);
     std::vector<double> denominator(Ain.rows(), 0);
@@ -29,5 +29,5 @@ IGL_INLINE void igl::per_vertex_attribute_smoothing(
 }
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
-template void igl::per_vertex_attribute_smoothing<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> >&);
+template void igl::per_vertex_attribute_smoothing<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 2 - 2
include/igl/per_vertex_attribute_smoothing.h

@@ -20,8 +20,8 @@ namespace igl
   //   Aout #V by #A eigen Matrix of mesh vertex attributes
   //   Aout #V by #A eigen Matrix of mesh vertex attributes
   template <typename DerivedV, typename DerivedF>
   template <typename DerivedV, typename DerivedF>
   IGL_INLINE void per_vertex_attribute_smoothing(
   IGL_INLINE void per_vertex_attribute_smoothing(
-    const Eigen::PlainObjectBase<DerivedV>& Ain,
-    const Eigen::PlainObjectBase<DerivedF>& F,
+    const Eigen::MatrixBase<DerivedV>& Ain,
+    const Eigen::MatrixBase<DerivedF>& F,
     Eigen::PlainObjectBase<DerivedV> & Aout);
     Eigen::PlainObjectBase<DerivedV> & Aout);
 }
 }
 
 

+ 9 - 9
include/igl/planarize_quad_mesh.cpp

@@ -20,8 +20,8 @@ namespace igl
     // number of faces, number of vertices
     // number of faces, number of vertices
     long numV, numF;
     long numV, numF;
     // references to the input faces and vertices
     // references to the input faces and vertices
-    const Eigen::PlainObjectBase<DerivedV> &Vin;
-    const Eigen::PlainObjectBase<DerivedF> &Fin;
+    const Eigen::MatrixBase<DerivedV> &Vin;
+    const Eigen::MatrixBase<DerivedF> &Fin;
     
     
     // vector consisting of the vertex positions stacked: [x;y;z;x;y;z...]
     // vector consisting of the vertex positions stacked: [x;y;z;x;y;z...]
     // vector consisting of a weight per face (currently all set to 1)
     // vector consisting of a weight per face (currently all set to 1)
@@ -50,8 +50,8 @@ namespace igl
     
     
   public:
   public:
     // Init - assemble stacked vector and lhs matrix, factorize
     // Init - assemble stacked vector and lhs matrix, factorize
-    inline PlanarizerShapeUp(const Eigen::PlainObjectBase<DerivedV> &V_,
-                             const Eigen::PlainObjectBase<DerivedF> &F_,
+    inline PlanarizerShapeUp(const Eigen::MatrixBase<DerivedV> &V_,
+                             const Eigen::MatrixBase<DerivedF> &F_,
                              const int maxIter_,
                              const int maxIter_,
                              const double &threshold_);
                              const double &threshold_);
     // Planarization - output to Vout
     // Planarization - output to Vout
@@ -62,8 +62,8 @@ namespace igl
 //Implementation
 //Implementation
 
 
 template <typename DerivedV, typename DerivedF>
 template <typename DerivedV, typename DerivedF>
-inline igl::PlanarizerShapeUp<DerivedV, DerivedF>::PlanarizerShapeUp(const Eigen::PlainObjectBase<DerivedV> &V_,
-                                                                     const Eigen::PlainObjectBase<DerivedF> &F_,
+inline igl::PlanarizerShapeUp<DerivedV, DerivedF>::PlanarizerShapeUp(const Eigen::MatrixBase<DerivedV> &V_,
+                                                                     const Eigen::MatrixBase<DerivedF> &F_,
                                                                      const int maxIter_,
                                                                      const int maxIter_,
                                                                      const double &threshold_):
                                                                      const double &threshold_):
 numV(V_.rows()),
 numV(V_.rows()),
@@ -229,8 +229,8 @@ inline void igl::PlanarizerShapeUp<DerivedV, DerivedF>::planarize(Eigen::PlainOb
   
   
 
 
 template <typename DerivedV, typename DerivedF>
 template <typename DerivedV, typename DerivedF>
-IGL_INLINE void igl::planarize_quad_mesh(const Eigen::PlainObjectBase<DerivedV> &Vin,
-                                    const Eigen::PlainObjectBase<DerivedF> &Fin,
+IGL_INLINE void igl::planarize_quad_mesh(const Eigen::MatrixBase<DerivedV> &Vin,
+                                    const Eigen::MatrixBase<DerivedF> &Fin,
                                     const int maxIter,
                                     const int maxIter,
                                     const double &threshold,
                                     const double &threshold,
                                     Eigen::PlainObjectBase<DerivedV> &Vout)
                                     Eigen::PlainObjectBase<DerivedV> &Vout)
@@ -241,5 +241,5 @@ IGL_INLINE void igl::planarize_quad_mesh(const Eigen::PlainObjectBase<DerivedV>
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::planarize_quad_mesh<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&, int, double const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::planarize_quad_mesh<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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&, int, double const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 2 - 2
include/igl/planarize_quad_mesh.h

@@ -33,8 +33,8 @@ namespace igl
   //
   //
   
   
   template <typename DerivedV, typename DerivedF>
   template <typename DerivedV, typename DerivedF>
-  IGL_INLINE void planarize_quad_mesh(const Eigen::PlainObjectBase<DerivedV> &Vin,
-                                      const Eigen::PlainObjectBase<DerivedF> &F,
+  IGL_INLINE void planarize_quad_mesh(const Eigen::MatrixBase<DerivedV> &Vin,
+                                      const Eigen::MatrixBase<DerivedF> &F,
                                       const int maxIter,
                                       const int maxIter,
                                       const double &threshold,
                                       const double &threshold,
                                       Eigen::PlainObjectBase<DerivedV> &Vout);
                                       Eigen::PlainObjectBase<DerivedV> &Vout);

+ 12 - 8
include/igl/point_mesh_squared_distance.cpp

@@ -12,13 +12,14 @@
 template <
 template <
   typename DerivedP,
   typename DerivedP,
   typename DerivedV,
   typename DerivedV,
+  typename DerivedEle,
   typename DerivedsqrD,
   typename DerivedsqrD,
   typename DerivedI,
   typename DerivedI,
   typename DerivedC>
   typename DerivedC>
 IGL_INLINE void igl::point_mesh_squared_distance(
 IGL_INLINE void igl::point_mesh_squared_distance(
-  const Eigen::PlainObjectBase<DerivedP> & P,
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::MatrixXi & Ele,
+  const Eigen::MatrixBase<DerivedP> & P,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedEle> & Ele,
   Eigen::PlainObjectBase<DerivedsqrD> & sqrD,
   Eigen::PlainObjectBase<DerivedsqrD> & sqrD,
   Eigen::PlainObjectBase<DerivedI> & I,
   Eigen::PlainObjectBase<DerivedI> & I,
   Eigen::PlainObjectBase<DerivedC> & C)
   Eigen::PlainObjectBase<DerivedC> & C)
@@ -48,11 +49,14 @@ IGL_INLINE void igl::point_mesh_squared_distance(
 }
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
-template void igl::point_mesh_squared_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
-template void igl::point_mesh_squared_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
-template void igl::point_mesh_squared_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -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> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
-template void igl::point_mesh_squared_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::point_mesh_squared_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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>, Eigen::Matrix<double, -1, -1, 0, -1, -1>>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>> &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> &);
+template void igl::point_mesh_squared_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::point_mesh_squared_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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<long, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
+template void igl::point_mesh_squared_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::point_mesh_squared_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+
 #ifdef WIN32
 #ifdef WIN32
-template void igl::point_mesh_squared_distance<class Eigen::Matrix<double,-1,-1,0,-1,-1>,class Eigen::Matrix<double,-1,-1,0,-1,-1>,class Eigen::Matrix<double,-1,1,0,-1,1>,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix<double,-1,3,0,-1,3> >(class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::Matrix<int,-1,-1,0,-1,-1> const &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,3,0,-1,3> > &);
+template void igl::point_mesh_squared_distance<class Eigen::Matrix<double, -1, -1, 0, -1, -1>, class Eigen::Matrix<double, -1, -1, 0, -1, -1>, class Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix<double, -1, 3, 0, -1, 3>>(class Eigen::MatrixBase<class Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, class Eigen::MatrixBase<class Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<double, -1, 1, 0, -1, 1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<double, -1, 3, 0, -1, 3>> &);
+template void igl::point_mesh_squared_distance<class Eigen::Matrix<double, -1, -1, 0, -1, -1>, class Eigen::Matrix<double, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<double, -1, 1, 0, -1, 1>, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix<double, -1, 3, 0, -1, 3>>(class Eigen::MatrixBase<class Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, class Eigen::MatrixBase<class Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<double, -1, 1, 0, -1, 1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<double, -1, 3, 0, -1, 3>> &);
 #endif
 #endif
 #endif
 #endif

+ 13 - 12
include/igl/point_mesh_squared_distance.h

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2014 Alec Jacobson <[email protected]>
 // Copyright (C) 2014 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_POINT_MESH_SQUARED_DISTANCE_H
 #ifndef IGL_POINT_MESH_SQUARED_DISTANCE_H
 #define IGL_POINT_MESH_SQUARED_DISTANCE_H
 #define IGL_POINT_MESH_SQUARED_DISTANCE_H
@@ -30,19 +30,20 @@ namespace igl
   // triangle [1 1 1] is treated as a point. So one _could_ add extra
   // triangle [1 1 1] is treated as a point. So one _could_ add extra
   // combinatorially degenerate rows to Ele for all unreferenced vertices to
   // combinatorially degenerate rows to Ele for all unreferenced vertices to
   // also get distances to points.
   // also get distances to points.
-  template <
+template <
     typename DerivedP,
     typename DerivedP,
     typename DerivedV,
     typename DerivedV,
+    typename DerivedEle,
     typename DerivedsqrD,
     typename DerivedsqrD,
     typename DerivedI,
     typename DerivedI,
     typename DerivedC>
     typename DerivedC>
-  IGL_INLINE void point_mesh_squared_distance(
-    const Eigen::PlainObjectBase<DerivedP> & P,
-    const Eigen::PlainObjectBase<DerivedV> & V,
-    const Eigen::MatrixXi & Ele, 
-    Eigen::PlainObjectBase<DerivedsqrD> & sqrD,
-    Eigen::PlainObjectBase<DerivedI> & I,
-    Eigen::PlainObjectBase<DerivedC> & C);
+IGL_INLINE void point_mesh_squared_distance(
+    const Eigen::MatrixBase<DerivedP> &P,
+    const Eigen::MatrixBase<DerivedV> &V,
+    const Eigen::MatrixBase<DerivedEle> &Ele,
+    Eigen::PlainObjectBase<DerivedsqrD> &sqrD,
+    Eigen::PlainObjectBase<DerivedI> &I,
+    Eigen::PlainObjectBase<DerivedC> &C);
 }
 }
 
 
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 8 - 6
include/igl/point_simplex_squared_distance.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2016 Alec Jacobson <[email protected]>
 // Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "point_simplex_squared_distance.h"
 #include "point_simplex_squared_distance.h"
 #include "project_to_line_segment.h"
 #include "project_to_line_segment.h"
@@ -42,8 +42,8 @@ IGL_INLINE void igl::point_simplex_squared_distance(
     return a.dot(b);
     return a.dot(b);
   };
   };
   // Real-time collision detection, Ericson, Chapter 5
   // Real-time collision detection, Ericson, Chapter 5
-  const auto & ClosestBaryPtPointTriangle = 
-    [&Dot](Point p, Point a, Point b, Point c, BaryPoint& bary_out )->Point 
+  const auto & ClosestBaryPtPointTriangle =
+    [&Dot](Point p, Point a, Point b, Point c, BaryPoint& bary_out )->Point
   {
   {
     // Check if P in vertex region outside A
     // Check if P in vertex region outside A
     Vector ab = b - a;
     Vector ab = b - a;
@@ -178,4 +178,6 @@ template void igl::point_simplex_squared_distance<3, Eigen::Matrix<double, 1, 3,
 template void igl::point_simplex_squared_distance<3, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, double&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 1, 1, 3> >&);
 template void igl::point_simplex_squared_distance<3, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, double&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 1, 1, 3> >&);
 template void igl::point_simplex_squared_distance<2, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double, Eigen::Matrix<double, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, double&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&);
 template void igl::point_simplex_squared_distance<2, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double, Eigen::Matrix<double, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, double&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&);
 template void igl::point_simplex_squared_distance<2, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double, Eigen::Matrix<double, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, double&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 1, 1, 2> >&);
 template void igl::point_simplex_squared_distance<2, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double, Eigen::Matrix<double, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, double&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 1, 1, 2> >&);
+template void igl::point_simplex_squared_distance<2, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, double, Eigen::Matrix<double, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1>::Index, double&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&);
+template void igl::point_simplex_squared_distance<3, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1>::Index, double&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
 #endif
 #endif

Some files were not shown because too many files changed in this diff