Эх сурвалжийг харах

fixed many style issues, missing copyrights, inlines

Former-commit-id: e828dd4cf1f9c31badc37d6a8363c639eec4f255
Alec Jacobson 11 жил өмнө
parent
commit
c39ca7747a
72 өөрчлөгдсөн 650 нэмэгдсэн , 393 устгасан
  1. 2 2
      include/igl/C_STR.h
  2. 2 2
      include/igl/MCTables.hh
  3. 2 2
      include/igl/MouseController.h
  4. 2 2
      include/igl/OpenGL_convenience.h
  5. 2 2
      include/igl/STR.h
  6. 46 43
      include/igl/SortableRow.h
  7. 28 28
      include/igl/add_barycenter.cpp
  8. 18 17
      include/igl/barycentric2global.h
  9. 1 1
      include/igl/boost/bfs_orient.cpp
  10. 1 1
      include/igl/boost/bfs_orient.h
  11. 7 0
      include/igl/cgal/CGAL_includes.hpp
  12. 7 0
      include/igl/cgal/SelfIntersectMesh.h
  13. 7 0
      include/igl/cgal/intersect_other.cpp
  14. 7 0
      include/igl/cgal/intersect_other.h
  15. 7 0
      include/igl/cgal/mesh_to_cgal_triangle_list.cpp
  16. 7 0
      include/igl/cgal/mesh_to_cgal_triangle_list.h
  17. 7 0
      include/igl/cgal/selfintersect.cpp
  18. 7 0
      include/igl/cgal/selfintersect.h
  19. 7 0
      include/igl/dated_copy.cpp
  20. 7 0
      include/igl/dqs.cpp
  21. 7 0
      include/igl/dqs.h
  22. 2 2
      include/igl/embree/ambient_occlusion.cpp
  23. 2 2
      include/igl/embree/ambient_occlusion.h
  24. 3 3
      include/igl/embree/project_mesh.h
  25. 0 1
      include/igl/embree/reorient_facets_raycast.cpp
  26. 2 2
      include/igl/embree/reorient_facets_raycast.h
  27. 2 2
      include/igl/embree/unproject_in_mesh.cpp
  28. 2 2
      include/igl/embree/unproject_in_mesh.h
  29. 7 0
      include/igl/face_areas.cpp
  30. 24 23
      include/igl/fit_plane.cpp
  31. 1 1
      include/igl/flare_textures.h.REMOVED.git-id
  32. 7 0
      include/igl/harmonic.cpp
  33. 7 0
      include/igl/histc.cpp
  34. 7 0
      include/igl/is_planar.cpp
  35. 7 0
      include/igl/lbs_matrix.cpp
  36. 29 28
      include/igl/local_basis.cpp
  37. 7 0
      include/igl/local_basis.h
  38. 7 0
      include/igl/marching_cubes.h
  39. 6 0
      include/igl/matlab/mexErrMsgTxt.h
  40. 7 0
      include/igl/partition.cpp
  41. 7 0
      include/igl/partition.h
  42. 7 0
      include/igl/path_to_executable.cpp
  43. 7 0
      include/igl/png/texture_from_file.cpp
  44. 7 0
      include/igl/png/texture_from_file.h
  45. 7 0
      include/igl/png/texture_from_png.cpp
  46. 7 0
      include/igl/png/texture_from_png.h
  47. 2 2
      include/igl/pos.h
  48. 7 0
      include/igl/random_points_on_mesh.cpp
  49. 7 0
      include/igl/ray_sphere_intersect.cpp
  50. 7 0
      include/igl/readSTL.cpp
  51. 7 0
      include/igl/render_to_tga.cpp
  52. 7 0
      include/igl/render_to_tga.h
  53. 2 2
      include/igl/reorder.cpp
  54. 1 1
      include/igl/shine_textures.h.REMOVED.git-id
  55. 2 2
      include/igl/sort.cpp
  56. 2 2
      include/igl/svd3x3/arap_dof.h
  57. 8 4
      include/igl/svd3x3/polar_svd3x3.h
  58. 31 31
      include/igl/svd3x3/svd3x3.cpp
  59. 65 61
      include/igl/svd3x3/svd3x3_avx.cpp
  60. 68 62
      include/igl/svd3x3/svd3x3_sse.cpp
  61. 2 2
      include/igl/tetgen/mesh_with_skeleton.cpp
  62. 43 43
      include/igl/tetgen/mesh_with_skeleton.h
  63. 7 0
      include/igl/texture_from_tga.cpp
  64. 7 0
      include/igl/texture_from_tga.h
  65. 2 2
      include/igl/uniformly_sample_two_manifold.cpp
  66. 7 0
      include/igl/writeSTL.cpp
  67. 3 3
      include/igl/xml/XMLSerializable.h
  68. 3 3
      include/igl/xml/XMLSerialization.h
  69. 3 3
      include/igl/xml/XMLSerializationTest.h
  70. 1 1
      include/igl/xml/XMLSerializer.h.REMOVED.git-id
  71. 3 3
      style_guidelines.html
  72. 1 0
      todos.txt

+ 2 - 2
include/igl/C_STR.h

@@ -5,8 +5,8 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // 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 
 // 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 C_STR_H
-#define C_STR_H
+#ifndef IGL_C_STR_H
+#define IGL_C_STR_H
 // http://stackoverflow.com/a/2433143/148668
 // http://stackoverflow.com/a/2433143/148668
 // Suppose you have a function:
 // Suppose you have a function:
 //   void func(const char * c);
 //   void func(const char * c);

+ 2 - 2
include/igl/MCTables.hh

@@ -24,8 +24,8 @@
  \*===========================================================================*/
  \*===========================================================================*/
 
 
 //=============================================================================
 //=============================================================================
-#ifndef ISOEX_MC_TABLES_HH
-#define ISOEX_MC_TABLES_HH
+#ifndef IGL_ISOEX_MC_TABLES_HH
+#define IGL_ISOEX_MC_TABLES_HH
 //=============================================================================
 //=============================================================================
 
 
 
 

+ 2 - 2
include/igl/MouseController.h

@@ -5,8 +5,8 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // 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 
 // 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 MOUSECONTROLLER_H
-#define MOUSECONTROLLER_H
+#ifndef IGL_MOUSECONTROLLER_H
+#define IGL_MOUSECONTROLLER_H
 // Needs to be included before others
 // Needs to be included before others
 #include <Eigen/StdVector>
 #include <Eigen/StdVector>
 #include <igl/RotateWidget.h>
 #include <igl/RotateWidget.h>

+ 2 - 2
include/igl/OpenGL_convenience.h

@@ -5,8 +5,8 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // 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 
 // 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 OPENGL_CONVENIENCE_H
-#define OPENGL_CONVENIENCE_H
+#ifndef IGL_OPENGL_CONVENIENCE_H
+#define IGL_OPENGL_CONVENIENCE_H
 #ifndef IGL_NO_OPENGL
 #ifndef IGL_NO_OPENGL
 
 
 // Always use this:
 // Always use this:

+ 2 - 2
include/igl/STR.h

@@ -5,8 +5,8 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // 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 
 // 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 STR_H
-#define STR_H
+#ifndef IGL_STR_H
+#define IGL_STR_H
 // http://stackoverflow.com/a/2433143/148668
 // http://stackoverflow.com/a/2433143/148668
 #include <string>
 #include <string>
 #include <sstream>
 #include <sstream>

+ 46 - 43
include/igl/SortableRow.h

@@ -12,56 +12,59 @@
 // reordering
 // reordering
 #include <Eigen/Core>
 #include <Eigen/Core>
 
 
-// Templates:
-//   T  should be a matrix that implments .size(), and operator(int i)
-template <typename T>
-class SortableRow
+namespace igl
 {
 {
-  public:
-    T data;
-  public:
-    SortableRow():data(){};
-    SortableRow(const T & data):data(data){};
-    bool operator<(const SortableRow & that) const
-    {
-      // Get reference so that I can use parenthesis
-      const SortableRow<T> & THIS = *this;
-      // Lexicographical
-      int minc = (THIS.data.size() < that.data.size()? 
-          THIS.data.size() : that.data.size());
-      // loop over columns
-      for(int i = 0;i<minc;i++)
+  // Templates:
+  //   T  should be a matrix that implments .size(), and operator(int i)
+  template <typename T>
+  class SortableRow
+  {
+    public:
+      T data;
+    public:
+      SortableRow():data(){};
+      SortableRow(const T & data):data(data){};
+      bool operator<(const SortableRow & that) const
       {
       {
-        if(THIS.data(i) == that.data(i))
+        // Get reference so that I can use parenthesis
+        const SortableRow<T> & THIS = *this;
+        // Lexicographical
+        int minc = (THIS.data.size() < that.data.size()? 
+            THIS.data.size() : that.data.size());
+        // loop over columns
+        for(int i = 0;i<minc;i++)
         {
         {
-          continue;
+          if(THIS.data(i) == that.data(i))
+          {
+            continue;
+          }
+          return THIS.data(i) < that.data(i);
         }
         }
-        return THIS.data(i) < that.data(i);
-      }
-      // All characters the same, comes done to length
-      return THIS.data.size()<that.data.size();
-    };
-    bool operator==(const SortableRow & that) const
-    {
-      // Get reference so that I can use parenthesis
-      const SortableRow<T> & THIS = *this;
-      if(THIS.data.size() != that.data.size())
+        // All characters the same, comes done to length
+        return THIS.data.size()<that.data.size();
+      };
+      bool operator==(const SortableRow & that) const
       {
       {
-        return false;
-      }
-      for(int i = 0;i<THIS.data.size();i++)
-      {
-        if(THIS.data(i) != that.data(i))
+        // Get reference so that I can use parenthesis
+        const SortableRow<T> & THIS = *this;
+        if(THIS.data.size() != that.data.size())
         {
         {
           return false;
           return false;
         }
         }
-      }
-      return true;
-    };
-    bool operator!=(const SortableRow & that) const
-    {
-      return !(*this == that);
-    };
-};
+        for(int i = 0;i<THIS.data.size();i++)
+        {
+          if(THIS.data(i) != that.data(i))
+          {
+            return false;
+          }
+        }
+        return true;
+      };
+      bool operator!=(const SortableRow & that) const
+      {
+        return !(*this == that);
+      };
+  };
+}
 
 
 #endif
 #endif

+ 28 - 28
include/igl/add_barycenter.cpp

@@ -19,34 +19,34 @@ IGL_INLINE void igl::add_barycenter(
     Eigen::PlainObjectBase<Index> & FD)
     Eigen::PlainObjectBase<Index> & FD)
 {
 {
   using namespace Eigen;
   using namespace Eigen;
-	// Compute face barycenter
-	Eigen::MatrixXd BC;
-	igl::barycenter(V,F,BC);
-
-	// Add the barycenters to the vertices
-	VD.resize(V.rows()+F.rows(),3);
-	VD.block(0,0,V.rows(),3) = V;
-	VD.block(V.rows(),0,F.rows(),3) = BC;
-
-	// Each face is split four ways
-	FD.resize(F.rows()*3,3);
-
-	for (unsigned i=0; i<F.rows(); ++i)
-	{
-		int i0 = F(i,0);
-		int i1 = F(i,1);
-		int i2 = F(i,2);
-		int i3 = V.rows() + i;
-
-		Vector3i F0,F1,F2;
-		F0 << i0,i1,i3;
-		F1 << i1,i2,i3;
-		F2 << i2,i0,i3;
-
-		FD.row(i*3 + 0) = F0;
-		FD.row(i*3 + 1) = F1;
-		FD.row(i*3 + 2) = F2;
-	}
+  // Compute face barycenter
+  Eigen::MatrixXd BC;
+  igl::barycenter(V,F,BC);
+
+  // Add the barycenters to the vertices
+  VD.resize(V.rows()+F.rows(),3);
+  VD.block(0,0,V.rows(),3) = V;
+  VD.block(V.rows(),0,F.rows(),3) = BC;
+
+  // Each face is split four ways
+  FD.resize(F.rows()*3,3);
+
+  for (unsigned i=0; i<F.rows(); ++i)
+  {
+    int i0 = F(i,0);
+    int i1 = F(i,1);
+    int i2 = F(i,2);
+    int i3 = V.rows() + i;
+
+    Vector3i F0,F1,F2;
+    F0 << i0,i1,i3;
+    F1 << i1,i2,i3;
+    F2 << i2,i0,i3;
+
+    FD.row(i*3 + 0) = F0;
+    FD.row(i*3 + 1) = F1;
+    FD.row(i*3 + 2) = F2;
+  }
 
 
 
 
 }
 }

+ 18 - 17
include/igl/barycentric2global.h

@@ -14,24 +14,25 @@
 
 
 namespace igl 
 namespace igl 
 {
 {
-	// Converts barycentric coordinates in the embree form to 3D coordinates
-	// Embree stores barycentric coordinates as triples: fid, bc1, bc2
-	// fid is the id of a face, bc1 is the displacement of the point wrt the 
-	// first vertex v0 and the edge v1-v0. Similarly, bc2 is the displacement
-	// wrt v2-v0.
-  	// 
-  	// Input:
-  	// V:  #Vx3 Vertices of the mesh
-  	// F:  #Fxe Faces of the mesh
-  	// bc: #Xx3 Barycentric coordinates, one row per point
-  	//
-  	// Output:
-  	// #X: #Xx3 3D coordinates of all points in bc
+  // Converts barycentric coordinates in the embree form to 3D coordinates
+  // Embree stores barycentric coordinates as triples: fid, bc1, bc2
+  // fid is the id of a face, bc1 is the displacement of the point wrt the 
+  // first vertex v0 and the edge v1-v0. Similarly, bc2 is the displacement
+  // wrt v2-v0.
+  // 
+  // Input:
+  // V:  #Vx3 Vertices of the mesh
+  // F:  #Fxe Faces of the mesh
+  // bc: #Xx3 Barycentric coordinates, one row per point
+  //
+  // Output:
+  // #X: #Xx3 3D coordinates of all points in bc
   template <typename Scalar, typename Index>
   template <typename Scalar, typename Index>
-  IGL_INLINE Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic> barycentric2global(
-    const Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic> & V, 
-	  const Eigen::Matrix<Index,Eigen::Dynamic,Eigen::Dynamic>   & F, 
-    const Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>  & bc);
+  IGL_INLINE Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic> 
+    barycentric2global(
+      const Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic> & V, 
+      const Eigen::Matrix<Index,Eigen::Dynamic,Eigen::Dynamic>   & F, 
+      const Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>  & bc);
 }
 }
 
 
 #ifdef IGL_HEADER_ONLY
 #ifdef IGL_HEADER_ONLY

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

@@ -11,7 +11,7 @@
 #include <queue>
 #include <queue>
 
 
 template <typename DerivedF, typename DerivedFF, typename DerivedC>
 template <typename DerivedF, typename DerivedFF, typename DerivedC>
-void igl::bfs_orient(
+IGL_INLINE void igl::bfs_orient(
   const Eigen::PlainObjectBase<DerivedF> & F,
   const Eigen::PlainObjectBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedFF> & FF,
   Eigen::PlainObjectBase<DerivedFF> & FF,
   Eigen::PlainObjectBase<DerivedC> & C)
   Eigen::PlainObjectBase<DerivedC> & C)

+ 1 - 1
include/igl/boost/bfs_orient.h

@@ -24,7 +24,7 @@ namespace igl
   //
   //
   //
   //
   template <typename DerivedF, typename DerivedFF, typename DerivedC>
   template <typename DerivedF, typename DerivedFF, typename DerivedC>
-  void bfs_orient(
+  IGL_INLINE void bfs_orient(
     const Eigen::PlainObjectBase<DerivedF> & F,
     const Eigen::PlainObjectBase<DerivedF> & F,
     Eigen::PlainObjectBase<DerivedFF> & FF,
     Eigen::PlainObjectBase<DerivedFF> & FF,
     Eigen::PlainObjectBase<DerivedC> & C);
     Eigen::PlainObjectBase<DerivedC> & C);

+ 7 - 0
include/igl/cgal/CGAL_includes.hpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_CGAL_INCLUDES_H
 #ifndef IGL_CGAL_INCLUDES_H
 #define IGL_CGAL_INCLUDES_H
 #define IGL_CGAL_INCLUDES_H
 
 

+ 7 - 0
include/igl/cgal/SelfIntersectMesh.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_SELFINTERSECTMESH_H
 #ifndef IGL_SELFINTERSECTMESH_H
 #define IGL_SELFINTERSECTMESH_H
 #define IGL_SELFINTERSECTMESH_H
 
 

+ 7 - 0
include/igl/cgal/intersect_other.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "intersect_other.h"
 #include "intersect_other.h"
 #include "CGAL_includes.hpp"
 #include "CGAL_includes.hpp"
 #include "mesh_to_cgal_triangle_list.h"
 #include "mesh_to_cgal_triangle_list.h"

+ 7 - 0
include/igl/cgal/intersect_other.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_INTERSECT_OTHER_H
 #ifndef IGL_INTERSECT_OTHER_H
 #define IGL_INTERSECT_OTHER_H
 #define IGL_INTERSECT_OTHER_H
 #include <igl/igl_inline.h>
 #include <igl/igl_inline.h>

+ 7 - 0
include/igl/cgal/mesh_to_cgal_triangle_list.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "mesh_to_cgal_triangle_list.h"
 #include "mesh_to_cgal_triangle_list.h"
 
 
 #include <cassert>
 #include <cassert>

+ 7 - 0
include/igl/cgal/mesh_to_cgal_triangle_list.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_MESH_TO_CGAL_TRIANGLE_LIST_H
 #ifndef IGL_MESH_TO_CGAL_TRIANGLE_LIST_H
 #define IGL_MESH_TO_CGAL_TRIANGLE_LIST_H
 #define IGL_MESH_TO_CGAL_TRIANGLE_LIST_H
 #include <igl/igl_inline.h>
 #include <igl/igl_inline.h>

+ 7 - 0
include/igl/cgal/selfintersect.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "selfintersect.h"
 #include "selfintersect.h"
 #include "SelfIntersectMesh.h"
 #include "SelfIntersectMesh.h"
 #include <igl/C_STR.h>
 #include <igl/C_STR.h>

+ 7 - 0
include/igl/cgal/selfintersect.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_SELFINTERSECT_H
 #ifndef IGL_SELFINTERSECT_H
 #define IGL_SELFINTERSECT_H
 #define IGL_SELFINTERSECT_H
 #include <igl/igl_inline.h>
 #include <igl/igl_inline.h>

+ 7 - 0
include/igl/dated_copy.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "dated_copy.h"
 #include "dated_copy.h"
 #include "dirname.h"
 #include "dirname.h"
 #include "basename.h"
 #include "basename.h"

+ 7 - 0
include/igl/dqs.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "dqs.h"
 #include "dqs.h"
 #include <Eigen/Geometry>
 #include <Eigen/Geometry>
 template <
 template <

+ 7 - 0
include/igl/dqs.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_DQS_H
 #ifndef IGL_DQS_H
 #define IGL_DQS_H
 #define IGL_DQS_H
 #include "igl_inline.h"
 #include "igl_inline.h"

+ 2 - 2
include/igl/embree/ambient_occlusion.cpp

@@ -14,7 +14,7 @@ template <
   typename DerivedP,
   typename DerivedP,
   typename DerivedN,
   typename DerivedN,
   typename DerivedS >
   typename DerivedS >
-void igl::ambient_occlusion(
+IGL_INLINE void igl::ambient_occlusion(
   const igl::EmbreeIntersector & ei,
   const igl::EmbreeIntersector & ei,
   const Eigen::PlainObjectBase<DerivedP> & P,
   const Eigen::PlainObjectBase<DerivedP> & P,
   const Eigen::PlainObjectBase<DerivedN> & N,
   const Eigen::PlainObjectBase<DerivedN> & N,
@@ -61,7 +61,7 @@ template <
   typename DerivedP,
   typename DerivedP,
   typename DerivedN,
   typename DerivedN,
   typename DerivedS >
   typename DerivedS >
-void igl::ambient_occlusion(
+IGL_INLINE void igl::ambient_occlusion(
   const Eigen::PlainObjectBase<DerivedV> & V,
   const Eigen::PlainObjectBase<DerivedV> & V,
   const Eigen::PlainObjectBase<DerivedF> & F,
   const Eigen::PlainObjectBase<DerivedF> & F,
   const Eigen::PlainObjectBase<DerivedP> & P,
   const Eigen::PlainObjectBase<DerivedP> & P,

+ 2 - 2
include/igl/embree/ambient_occlusion.h

@@ -27,7 +27,7 @@ namespace igl
     typename DerivedP,
     typename DerivedP,
     typename DerivedN,
     typename DerivedN,
     typename DerivedS >
     typename DerivedS >
-  void ambient_occlusion(
+  IGL_INLINE void ambient_occlusion(
     const igl::EmbreeIntersector & ei,
     const igl::EmbreeIntersector & ei,
     const Eigen::PlainObjectBase<DerivedP> & P,
     const Eigen::PlainObjectBase<DerivedP> & P,
     const Eigen::PlainObjectBase<DerivedN> & N,
     const Eigen::PlainObjectBase<DerivedN> & N,
@@ -41,7 +41,7 @@ namespace igl
     typename DerivedP,
     typename DerivedP,
     typename DerivedN,
     typename DerivedN,
     typename DerivedS >
     typename DerivedS >
-  void ambient_occlusion(
+  IGL_INLINE void ambient_occlusion(
     const Eigen::PlainObjectBase<DerivedV> & V,
     const Eigen::PlainObjectBase<DerivedV> & V,
     const Eigen::PlainObjectBase<DerivedF> & F,
     const Eigen::PlainObjectBase<DerivedF> & F,
     const Eigen::PlainObjectBase<DerivedP> & P,
     const Eigen::PlainObjectBase<DerivedP> & P,

+ 3 - 3
include/igl/embree/project_mesh.h

@@ -35,11 +35,11 @@ namespace igl
   template <typename ScalarMatrix, typename IndexMatrix>
   template <typename ScalarMatrix, typename IndexMatrix>
   IGL_INLINE ScalarMatrix project_mesh
   IGL_INLINE ScalarMatrix project_mesh
   (
   (
-		const ScalarMatrix & V_source,
-  	const IndexMatrix  & F_source,
+    const ScalarMatrix & V_source,
+    const IndexMatrix  & F_source,
     const ScalarMatrix & V_target,
     const ScalarMatrix & V_target,
     const IndexMatrix  & F_target
     const IndexMatrix  & F_target
-	);
+  );
 
 
   // Project the point cloud V_source onto the triangle mesh
   // Project the point cloud V_source onto the triangle mesh
   // V_target,F_target. 
   // V_target,F_target. 

+ 0 - 1
include/igl/embree/reorient_facets_raycast.cpp

@@ -10,7 +10,6 @@
 #include "../doublearea.h"
 #include "../doublearea.h"
 #include "../random_dir.h"
 #include "../random_dir.h"
 #include "../boost/bfs_orient.h"
 #include "../boost/bfs_orient.h"
-#include "orient_outward_ao.h"
 #include "EmbreeIntersector.h"
 #include "EmbreeIntersector.h"
 #include <iostream>
 #include <iostream>
 #include <random>
 #include <random>

+ 2 - 2
include/igl/embree/reorient_facets_raycast.h

@@ -5,8 +5,8 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // 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 
 // 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_ORIENT_OUTWARD_AO_H
-#define IGL_ORIENT_OUTWARD_AO_H
+#ifndef IGL_REORIENT_FACETS_RAYCAST_H
+#define IGL_REORIENT_FACETS_RAYCAST_H
 #include "../igl_inline.h"
 #include "../igl_inline.h"
 #include <Eigen/Core>
 #include <Eigen/Core>
 namespace igl
 namespace igl

+ 2 - 2
include/igl/embree/unproject_in_mesh.cpp

@@ -12,7 +12,7 @@
 
 
 template <
 template <
   typename Derivedobj>
   typename Derivedobj>
-int igl::unproject_in_mesh(
+IGL_INLINE int igl::unproject_in_mesh(
   const int x,
   const int x,
   const int y,
   const int y,
   const igl::EmbreeIntersector & ei,
   const igl::EmbreeIntersector & ei,
@@ -24,7 +24,7 @@ int igl::unproject_in_mesh(
 
 
 template <
 template <
   typename Derivedobj>
   typename Derivedobj>
-int igl::unproject_in_mesh(
+IGL_INLINE int igl::unproject_in_mesh(
   const int x,
   const int x,
   const int y,
   const int y,
   const igl::EmbreeIntersector & ei,
   const igl::EmbreeIntersector & ei,

+ 2 - 2
include/igl/embree/unproject_in_mesh.h

@@ -30,7 +30,7 @@ namespace igl
   //
   //
   template <
   template <
     typename Derivedobj>
     typename Derivedobj>
-  int unproject_in_mesh(
+  IGL_INLINE int unproject_in_mesh(
     const int x,
     const int x,
     const int y,
     const int y,
     const igl::EmbreeIntersector & ei,
     const igl::EmbreeIntersector & ei,
@@ -38,7 +38,7 @@ namespace igl
 
 
   template <
   template <
     typename Derivedobj>
     typename Derivedobj>
-  int unproject_in_mesh(
+  IGL_INLINE int unproject_in_mesh(
     const int x,
     const int x,
     const int y,
     const int y,
     const igl::EmbreeIntersector & ei,
     const igl::EmbreeIntersector & ei,

+ 7 - 0
include/igl/face_areas.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "face_areas.h"
 #include "face_areas.h"
 #include "edge_lengths.h"
 #include "edge_lengths.h"
 #include "doublearea.h"
 #include "doublearea.h"

+ 24 - 23
include/igl/fit_plane.cpp

@@ -14,36 +14,37 @@ void igl::fit_plane(
     Eigen::RowVector3d & N,
     Eigen::RowVector3d & N,
     Eigen::RowVector3d & C)
     Eigen::RowVector3d & C)
 {
 {
-    assert(V.rows()>0);
+  assert(V.rows()>0);
 
 
-    Eigen::Vector3d sum = V.colwise().sum();
+  Eigen::Vector3d sum = V.colwise().sum();
 
 
-    Eigen::Vector3d center = sum.array()/(double(V.rows()));
+  Eigen::Vector3d center = sum.array()/(double(V.rows()));
 
 
-    C = center;
+  C = center;
 
 
-    double sumXX=0.0f,sumXY=0.0f,sumXZ=0.0f;
-    double sumYY=0.0f,sumYZ=0.0f;
-    double sumZZ=0.0f;
+  double sumXX=0.0f,sumXY=0.0f,sumXZ=0.0f;
+  double sumYY=0.0f,sumYZ=0.0f;
+  double sumZZ=0.0f;
 
 
-    for(int i=0;i<V.rows();i++){
-        double diffX=V(i,0)-center(0);
-        double diffY=V(i,1)-center(1);
-        double diffZ=V(i,2)-center(2);
-        sumXX+=diffX*diffX;
-        sumXY+=diffX*diffY;
-        sumXZ+=diffX*diffZ;
-        sumYY+=diffY*diffY;
-        sumYZ+=diffY*diffZ;
-        sumZZ+=diffZ*diffZ;
-    }
+  for(int i=0;i<V.rows();i++)
+  {
+    double diffX=V(i,0)-center(0);
+    double diffY=V(i,1)-center(1);
+    double diffZ=V(i,2)-center(2);
+    sumXX+=diffX*diffX;
+    sumXY+=diffX*diffY;
+    sumXZ+=diffX*diffZ;
+    sumYY+=diffY*diffY;
+    sumYZ+=diffY*diffZ;
+    sumZZ+=diffZ*diffZ;
+  }
 
 
-    Eigen::MatrixXd m(3,3);
-    m << sumXX,sumXY,sumXZ,
-        sumXY,sumYY,sumYZ,
-        sumXZ,sumYZ,sumZZ;
+  Eigen::MatrixXd m(3,3);
+  m << sumXX,sumXY,sumXZ,
+    sumXY,sumYY,sumYZ,
+    sumXZ,sumYZ,sumZZ;
 
 
-	Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> es(m);
+  Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> es(m);
   
   
   N = es.eigenvectors().col(0);
   N = es.eigenvectors().col(0);
 }
 }

+ 1 - 1
include/igl/flare_textures.h.REMOVED.git-id

@@ -1 +1 @@
-d92e8438dc4ccf21c1064a9ccd2b87fa58e99862
+d7410116de836a2f96c3de72373ca1d089065867

+ 7 - 0
include/igl/harmonic.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "harmonic.h"
 #include "harmonic.h"
 #include "cotmatrix.h"
 #include "cotmatrix.h"
 #include "massmatrix.h"
 #include "massmatrix.h"

+ 7 - 0
include/igl/histc.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "histc.h"
 #include "histc.h"
 #include "matlab_format.h"
 #include "matlab_format.h"
 #include <cassert>
 #include <cassert>

+ 7 - 0
include/igl/is_planar.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "is_planar.h"
 #include "is_planar.h"
 IGL_INLINE bool igl::is_planar(const Eigen::MatrixXd & V)
 IGL_INLINE bool igl::is_planar(const Eigen::MatrixXd & V)
 {
 {

+ 7 - 0
include/igl/lbs_matrix.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "lbs_matrix.h"
 #include "lbs_matrix.h"
 
 
 IGL_INLINE void igl::lbs_matrix(
 IGL_INLINE void igl::lbs_matrix(

+ 29 - 28
include/igl/local_basis.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "local_basis.h"
 #include "local_basis.h"
 
 
 #include <sstream>
 #include <sstream>
@@ -7,39 +14,33 @@
 #include <vector>
 #include <vector>
 #include <Eigen/Geometry>
 #include <Eigen/Geometry>
 
 
-using namespace Eigen;
-using namespace std;
 
 
-namespace igl
+template <typename DerivedV, typename DerivedF>
+IGL_INLINE void igl::local_basis(
+  const Eigen::PlainObjectBase<DerivedV>& V,
+  const Eigen::PlainObjectBase<DerivedF>& F,
+  Eigen::PlainObjectBase<DerivedV>& B1,
+  Eigen::PlainObjectBase<DerivedV>& B2,
+  Eigen::PlainObjectBase<DerivedV>& B3
+  )
 {
 {
+  using namespace Eigen;
+  using namespace std;
+  B1.resize(F.rows(),3);
+  B2.resize(F.rows(),3);
+  B3.resize(F.rows(),3);
 
 
-  template <typename DerivedV, typename DerivedF>
-  IGL_INLINE void local_basis(
-    const Eigen::PlainObjectBase<DerivedV>& V,
-    const Eigen::PlainObjectBase<DerivedF>& F,
-    Eigen::PlainObjectBase<DerivedV>& B1,
-    Eigen::PlainObjectBase<DerivedV>& B2,
-    Eigen::PlainObjectBase<DerivedV>& B3
-    )
+  for (unsigned i=0;i<F.rows();++i)
   {
   {
-    B1.resize(F.rows(),3);
-    B2.resize(F.rows(),3);
-    B3.resize(F.rows(),3);
-
-    for (unsigned i=0;i<F.rows();++i)
-    {
-      RowVector3d v1 = (V.row(F(i,1)) - V.row(F(i,0))).normalized();
-      RowVector3d t = V.row(F(i,2)) - V.row(F(i,0));
-      RowVector3d v3 = v1.cross(t).normalized();
-      RowVector3d v2 = v1.cross(v3).normalized();
-
-      B1.row(i) = v1;
-      B2.row(i) = v2;
-      B3.row(i) = v3;
-    }
-
+    RowVector3d v1 = (V.row(F(i,1)) - V.row(F(i,0))).normalized();
+    RowVector3d t = V.row(F(i,2)) - V.row(F(i,0));
+    RowVector3d v3 = v1.cross(t).normalized();
+    RowVector3d v2 = v1.cross(v3).normalized();
+
+    B1.row(i) = v1;
+    B2.row(i) = v2;
+    B3.row(i) = v3;
   }
   }
-
 }
 }
 
 
 #ifndef IGL_HEADER_ONLY
 #ifndef IGL_HEADER_ONLY

+ 7 - 0
include/igl/local_basis.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_LOCALBASIS_H
 #ifndef IGL_LOCALBASIS_H
 #define IGL_LOCALBASIS_H
 #define IGL_LOCALBASIS_H
 
 

+ 7 - 0
include/igl/marching_cubes.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_MARCHINGCUBES_H
 #ifndef IGL_MARCHINGCUBES_H
 #define IGL_MARCHINGCUBES_H
 #define IGL_MARCHINGCUBES_H
 #include "igl_inline.h"
 #include "igl_inline.h"

+ 6 - 0
include/igl/matlab/mexErrMsgTxt.h

@@ -5,9 +5,15 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // 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 
 // 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_MEXERRMSGTXT_H
+#define IGL_MEXERRMSGTXT_H
 #include "../igl_inline.h"
 #include "../igl_inline.h"
 namespace igl
 namespace igl
 {
 {
   // Wrapper for mexErrMsgTxt that only calls error if test fails
   // Wrapper for mexErrMsgTxt that only calls error if test fails
   IGL_INLINE void mexErrMsgTxt(bool test, const char * message);
   IGL_INLINE void mexErrMsgTxt(bool test, const char * message);
 }
 }
+#ifdef IGL_HEADER_ONLY
+#  include "mexErrMsgTxt.cpp"
+#endif
+#endif

+ 7 - 0
include/igl/partition.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "partition.h"
 #include "partition.h"
 #include "mat_min.h"
 #include "mat_min.h"
 
 

+ 7 - 0
include/igl/partition.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_PARTITION_H
 #ifndef IGL_PARTITION_H
 #define IGL_PARTITION_H
 #define IGL_PARTITION_H
 #include "igl_inline.h"
 #include "igl_inline.h"

+ 7 - 0
include/igl/path_to_executable.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "path_to_executable.h"
 #include "path_to_executable.h"
 #ifdef __APPLE__
 #ifdef __APPLE__
 #  include <mach-o/dyld.h>
 #  include <mach-o/dyld.h>

+ 7 - 0
include/igl/png/texture_from_file.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "texture_from_file.h"
 #include "texture_from_file.h"
 #ifndef IGL_NO_OPENGL
 #ifndef IGL_NO_OPENGL
 
 

+ 7 - 0
include/igl/png/texture_from_file.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_TEXTURE_FROM_FILE_H
 #ifndef IGL_TEXTURE_FROM_FILE_H
 #define IGL_TEXTURE_FROM_FILE_H
 #define IGL_TEXTURE_FROM_FILE_H
 #ifndef IGL_NO_OPENGL
 #ifndef IGL_NO_OPENGL

+ 7 - 0
include/igl/png/texture_from_png.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "texture_from_png.h"
 #include "texture_from_png.h"
 #ifndef IGL_NO_OPENGL
 #ifndef IGL_NO_OPENGL
 
 

+ 7 - 0
include/igl/png/texture_from_png.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_TEXTURE_FROM_PNG_H
 #ifndef IGL_TEXTURE_FROM_PNG_H
 #define IGL_TEXTURE_FROM_PNG_H
 #define IGL_TEXTURE_FROM_PNG_H
 #ifndef IGL_NO_OPENGL
 #ifndef IGL_NO_OPENGL

+ 2 - 2
include/igl/pos.h

@@ -85,8 +85,8 @@ template <typename S>
       {
       {
         do
         do
         {
         {
-					flipF();
-					flipE();
+          flipF();
+          flipE();
         } while (!isBorder());
         } while (!isBorder());
         flipE();
         flipE();
         return false;
         return false;

+ 7 - 0
include/igl/random_points_on_mesh.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "random_points_on_mesh.h"
 #include "random_points_on_mesh.h"
 #include "doublearea.h"
 #include "doublearea.h"
 #include "cumsum.h"
 #include "cumsum.h"

+ 7 - 0
include/igl/ray_sphere_intersect.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "ray_sphere_intersect.h"
 #include "ray_sphere_intersect.h"
 
 
 template <
 template <

+ 7 - 0
include/igl/readSTL.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "readSTL.h"
 #include "readSTL.h"
 #include "list_to_matrix.h"
 #include "list_to_matrix.h"
 
 

+ 7 - 0
include/igl/render_to_tga.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "render_to_tga.h"
 #include "render_to_tga.h"
 #ifndef IGL_NO_OPENGL
 #ifndef IGL_NO_OPENGL
 #include "tga.h"
 #include "tga.h"

+ 7 - 0
include/igl/render_to_tga.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_RENDER_TO_TGA_H
 #ifndef IGL_RENDER_TO_TGA_H
 #define IGL_RENDER_TO_TGA_H
 #define IGL_RENDER_TO_TGA_H
 #include "igl_inline.h"
 #include "igl_inline.h"

+ 2 - 2
include/igl/reorder.cpp

@@ -34,7 +34,7 @@ IGL_INLINE void igl::reorder(
 template void igl::reorder<double>(std::vector<double, std::allocator<double> > const&, std::vector<size_t, std::allocator<size_t> > const&, std::vector<double, std::allocator<double> >&);
 template void igl::reorder<double>(std::vector<double, std::allocator<double> > const&, std::vector<size_t, std::allocator<size_t> > const&, std::vector<double, std::allocator<double> >&);
 template void igl::reorder<int>(std::vector<int, std::allocator<int> > const&, std::vector<size_t, std::allocator<size_t> > const&, std::vector<int, std::allocator<int> >&);
 template void igl::reorder<int>(std::vector<int, std::allocator<int> > const&, std::vector<size_t, std::allocator<size_t> > const&, std::vector<int, std::allocator<int> >&);
 #  ifndef IGL_NO_EIGEN
 #  ifndef IGL_NO_EIGEN
-  template void igl::reorder<SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > >(std::vector<SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> >, std::allocator<SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > > > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> >, std::allocator<SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > > >&);
-  template void igl::reorder<SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >(std::vector<SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> >, std::allocator<SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> >, std::allocator<SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > >&);
+  template void igl::reorder<igl::SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > >(std::vector<igl::SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> >, std::allocator<igl::SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > > > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<igl::SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> >, std::allocator<igl::SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > > >&);
+  template void igl::reorder<igl::SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >(std::vector<igl::SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> >, std::allocator<igl::SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<igl::SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> >, std::allocator<igl::SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > >&);
 #  endif
 #  endif
 #endif
 #endif

+ 1 - 1
include/igl/shine_textures.h.REMOVED.git-id

@@ -1 +1 @@
-11b49f50d620e2129b86410e169b00478cf71802
+0d5fca3720af7a84eac998513a77ff1ef619d5f0

+ 2 - 2
include/igl/sort.cpp

@@ -221,9 +221,9 @@ template void igl::sort<Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<in
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
 template void igl::sort<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&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 template void igl::sort<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&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 template void igl::sort<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&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 template void igl::sort<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&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
-template void igl::sort<SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > >(std::vector<SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> >, std::allocator<SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > > > const&, bool, std::vector<SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> >, std::allocator<SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > > >&, std::vector<unsigned long, std::allocator<unsigned long> >&);
+template void igl::sort<igl::SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > >(std::vector<igl::SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> >, std::allocator<igl::SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > > > const&, bool, std::vector<igl::SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> >, std::allocator<igl::SortableRow<Eigen::Matrix<int, -1, 1, 0, -1, 1> > > >&, std::vector<unsigned long, std::allocator<unsigned long> >&);
 template void igl::sort<int>(std::vector<int, std::allocator<int> > const&, bool, std::vector<int, std::allocator<int> >&, std::vector<unsigned long, std::allocator<unsigned long> >&);
 template void igl::sort<int>(std::vector<int, std::allocator<int> > const&, bool, std::vector<int, std::allocator<int> >&, std::vector<unsigned long, std::allocator<unsigned long> >&);
-template void igl::sort<SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >(std::vector<SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> >, std::allocator<SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > > const&, bool, std::vector<SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> >, std::allocator<SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > >&, std::vector<unsigned long, std::allocator<unsigned long> >&);
+template void igl::sort<igl::SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >(std::vector<igl::SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> >, std::allocator<igl::SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > > const&, bool, std::vector<igl::SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> >, std::allocator<igl::SortableRow<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > >&, std::vector<unsigned long, std::allocator<unsigned long> >&);
 template void igl::sort2<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&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 template void igl::sort2<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&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 template void igl::sort2<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&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 template void igl::sort2<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&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 template void igl::sort_new<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&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 template void igl::sort_new<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&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);

+ 2 - 2
include/igl/svd3x3/arap_dof.h

@@ -98,8 +98,8 @@ namespace igl
   // Inputs:
   // Inputs:
   //   fixed_dim  list of transformation element indices for fixed (or partailly
   //   fixed_dim  list of transformation element indices for fixed (or partailly
   //   fixed) handles: not necessarily the complement of 'free'
   //   fixed) handles: not necessarily the complement of 'free'
-  //	  NOTE: the constraints for fixed transformations still need to be
-  //	  present in A_eq
+  //    NOTE: the constraints for fixed transformations still need to be
+  //    present in A_eq
   //   A_eq  dim*#constraint_points by m*dim*(dim+1)  matrix of linear equality
   //   A_eq  dim*#constraint_points by m*dim*(dim+1)  matrix of linear equality
   //     constraint coefficients. Each row corresponds to a linear constraint,
   //     constraint coefficients. Each row corresponds to a linear constraint,
   //     so that A_eq * L = Beq says that the linear transformation entries in
   //     so that A_eq * L = Beq says that the linear transformation entries in

+ 8 - 4
include/igl/svd3x3/polar_svd3x3.h

@@ -11,14 +11,18 @@
 #include <igl/igl_inline.h>
 #include <igl/igl_inline.h>
 namespace igl
 namespace igl
 {
 {
-  // Computes the closest rotation to input matrix A using specialized 3x3 SVD singular value decomposition (WunderSVD3x3)
+  // Computes the closest rotation to input matrix A using specialized 3x3 SVD
+  // singular value decomposition (WunderSVD3x3)
+  //
   // Inputs:
   // Inputs:
   //   A  3 by 3 matrix to be decomposed
   //   A  3 by 3 matrix to be decomposed
   // Outputs:
   // Outputs:
-  //   R  3 by 3 closest element in SO(3) (closeness in terms of Frobenius metric)
+  //   R  3 by 3 closest element in SO(3) (closeness in terms of Frobenius
+  //   metric)
   //
   //
-  //	This means that det(R) = 1. Technically it's not polar decomposition which guarantees positive semidefinite
-  //   stretch factor (at the cost of having det(R) = -1).
+  //  This means that det(R) = 1. Technically it's not polar decomposition
+  //  which guarantees positive semidefinite stretch factor (at the cost of
+  //  having det(R) = -1).
   //
   //
   template<typename Mat>
   template<typename Mat>
   IGL_INLINE void polar_svd3x3(const Mat& A, Mat& R);
   IGL_INLINE void polar_svd3x3(const Mat& A, Mat& R);

+ 31 - 31
include/igl/svd3x3/svd3x3.cpp

@@ -21,45 +21,45 @@
 template<typename T>
 template<typename T>
 IGL_INLINE void igl::svd3x3(const Eigen::Matrix<T, 3, 3>& A, Eigen::Matrix<T, 3, 3> &U, Eigen::Matrix<T, 3, 1> &S, Eigen::Matrix<T, 3, 3>&V)
 IGL_INLINE void igl::svd3x3(const Eigen::Matrix<T, 3, 3>& A, Eigen::Matrix<T, 3, 3> &U, Eigen::Matrix<T, 3, 1> &S, Eigen::Matrix<T, 3, 3>&V)
 {
 {
-	// this code only supports the scalar version (otherwise we'd need to pass arrays of matrices)	
+  // this code only supports the scalar version (otherwise we'd need to pass arrays of matrices)  
 
 
 #include "Singular_Value_Decomposition_Kernel_Declarations.hpp"
 #include "Singular_Value_Decomposition_Kernel_Declarations.hpp"
 
 
-	ENABLE_SCALAR_IMPLEMENTATION(Sa11.f=A(0,0);)                                      ENABLE_SSE_IMPLEMENTATION(Va11=_mm_loadu_ps(a11);)                                  ENABLE_AVX_IMPLEMENTATION(Va11=_mm256_loadu_ps(a11);)
-		ENABLE_SCALAR_IMPLEMENTATION(Sa21.f=A(1,0);)                                      ENABLE_SSE_IMPLEMENTATION(Va21=_mm_loadu_ps(a21);)                                  ENABLE_AVX_IMPLEMENTATION(Va21=_mm256_loadu_ps(a21);)
-		ENABLE_SCALAR_IMPLEMENTATION(Sa31.f=A(2,0);)                                      ENABLE_SSE_IMPLEMENTATION(Va31=_mm_loadu_ps(a31);)                                  ENABLE_AVX_IMPLEMENTATION(Va31=_mm256_loadu_ps(a31);)
-		ENABLE_SCALAR_IMPLEMENTATION(Sa12.f=A(0,1);)                                      ENABLE_SSE_IMPLEMENTATION(Va12=_mm_loadu_ps(a12);)                                  ENABLE_AVX_IMPLEMENTATION(Va12=_mm256_loadu_ps(a12);)
-		ENABLE_SCALAR_IMPLEMENTATION(Sa22.f=A(1,1);)                                      ENABLE_SSE_IMPLEMENTATION(Va22=_mm_loadu_ps(a22);)                                  ENABLE_AVX_IMPLEMENTATION(Va22=_mm256_loadu_ps(a22);)
-		ENABLE_SCALAR_IMPLEMENTATION(Sa32.f=A(2,1);)                                      ENABLE_SSE_IMPLEMENTATION(Va32=_mm_loadu_ps(a32);)                                  ENABLE_AVX_IMPLEMENTATION(Va32=_mm256_loadu_ps(a32);)
-		ENABLE_SCALAR_IMPLEMENTATION(Sa13.f=A(0,2);)                                      ENABLE_SSE_IMPLEMENTATION(Va13=_mm_loadu_ps(a13);)                                  ENABLE_AVX_IMPLEMENTATION(Va13=_mm256_loadu_ps(a13);)
-		ENABLE_SCALAR_IMPLEMENTATION(Sa23.f=A(1,2);)                                      ENABLE_SSE_IMPLEMENTATION(Va23=_mm_loadu_ps(a23);)                                  ENABLE_AVX_IMPLEMENTATION(Va23=_mm256_loadu_ps(a23);)
-		ENABLE_SCALAR_IMPLEMENTATION(Sa33.f=A(2,2);)                                      ENABLE_SSE_IMPLEMENTATION(Va33=_mm_loadu_ps(a33);)                                  ENABLE_AVX_IMPLEMENTATION(Va33=_mm256_loadu_ps(a33);)
+  ENABLE_SCALAR_IMPLEMENTATION(Sa11.f=A(0,0);)                                      ENABLE_SSE_IMPLEMENTATION(Va11=_mm_loadu_ps(a11);)                                  ENABLE_AVX_IMPLEMENTATION(Va11=_mm256_loadu_ps(a11);)
+    ENABLE_SCALAR_IMPLEMENTATION(Sa21.f=A(1,0);)                                      ENABLE_SSE_IMPLEMENTATION(Va21=_mm_loadu_ps(a21);)                                  ENABLE_AVX_IMPLEMENTATION(Va21=_mm256_loadu_ps(a21);)
+    ENABLE_SCALAR_IMPLEMENTATION(Sa31.f=A(2,0);)                                      ENABLE_SSE_IMPLEMENTATION(Va31=_mm_loadu_ps(a31);)                                  ENABLE_AVX_IMPLEMENTATION(Va31=_mm256_loadu_ps(a31);)
+    ENABLE_SCALAR_IMPLEMENTATION(Sa12.f=A(0,1);)                                      ENABLE_SSE_IMPLEMENTATION(Va12=_mm_loadu_ps(a12);)                                  ENABLE_AVX_IMPLEMENTATION(Va12=_mm256_loadu_ps(a12);)
+    ENABLE_SCALAR_IMPLEMENTATION(Sa22.f=A(1,1);)                                      ENABLE_SSE_IMPLEMENTATION(Va22=_mm_loadu_ps(a22);)                                  ENABLE_AVX_IMPLEMENTATION(Va22=_mm256_loadu_ps(a22);)
+    ENABLE_SCALAR_IMPLEMENTATION(Sa32.f=A(2,1);)                                      ENABLE_SSE_IMPLEMENTATION(Va32=_mm_loadu_ps(a32);)                                  ENABLE_AVX_IMPLEMENTATION(Va32=_mm256_loadu_ps(a32);)
+    ENABLE_SCALAR_IMPLEMENTATION(Sa13.f=A(0,2);)                                      ENABLE_SSE_IMPLEMENTATION(Va13=_mm_loadu_ps(a13);)                                  ENABLE_AVX_IMPLEMENTATION(Va13=_mm256_loadu_ps(a13);)
+    ENABLE_SCALAR_IMPLEMENTATION(Sa23.f=A(1,2);)                                      ENABLE_SSE_IMPLEMENTATION(Va23=_mm_loadu_ps(a23);)                                  ENABLE_AVX_IMPLEMENTATION(Va23=_mm256_loadu_ps(a23);)
+    ENABLE_SCALAR_IMPLEMENTATION(Sa33.f=A(2,2);)                                      ENABLE_SSE_IMPLEMENTATION(Va33=_mm_loadu_ps(a33);)                                  ENABLE_AVX_IMPLEMENTATION(Va33=_mm256_loadu_ps(a33);)
 
 
 #include "Singular_Value_Decomposition_Main_Kernel_Body.hpp"
 #include "Singular_Value_Decomposition_Main_Kernel_Body.hpp"
 
 
-		ENABLE_SCALAR_IMPLEMENTATION(U(0,0)=Su11.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u11,Vu11);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u11,Vu11);)
-		ENABLE_SCALAR_IMPLEMENTATION(U(1,0)=Su21.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u21,Vu21);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u21,Vu21);)
-		ENABLE_SCALAR_IMPLEMENTATION(U(2,0)=Su31.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u31,Vu31);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u31,Vu31);)
-		ENABLE_SCALAR_IMPLEMENTATION(U(0,1)=Su12.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u12,Vu12);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u12,Vu12);)
-		ENABLE_SCALAR_IMPLEMENTATION(U(1,1)=Su22.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u22,Vu22);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u22,Vu22);)
-		ENABLE_SCALAR_IMPLEMENTATION(U(2,1)=Su32.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u32,Vu32);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u32,Vu32);)
-		ENABLE_SCALAR_IMPLEMENTATION(U(0,2)=Su13.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u13,Vu13);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u13,Vu13);)
-		ENABLE_SCALAR_IMPLEMENTATION(U(1,2)=Su23.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u23,Vu23);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u23,Vu23);)
-		ENABLE_SCALAR_IMPLEMENTATION(U(2,2)=Su33.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u33,Vu33);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u33,Vu33);)
+    ENABLE_SCALAR_IMPLEMENTATION(U(0,0)=Su11.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u11,Vu11);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u11,Vu11);)
+    ENABLE_SCALAR_IMPLEMENTATION(U(1,0)=Su21.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u21,Vu21);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u21,Vu21);)
+    ENABLE_SCALAR_IMPLEMENTATION(U(2,0)=Su31.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u31,Vu31);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u31,Vu31);)
+    ENABLE_SCALAR_IMPLEMENTATION(U(0,1)=Su12.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u12,Vu12);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u12,Vu12);)
+    ENABLE_SCALAR_IMPLEMENTATION(U(1,1)=Su22.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u22,Vu22);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u22,Vu22);)
+    ENABLE_SCALAR_IMPLEMENTATION(U(2,1)=Su32.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u32,Vu32);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u32,Vu32);)
+    ENABLE_SCALAR_IMPLEMENTATION(U(0,2)=Su13.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u13,Vu13);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u13,Vu13);)
+    ENABLE_SCALAR_IMPLEMENTATION(U(1,2)=Su23.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u23,Vu23);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u23,Vu23);)
+    ENABLE_SCALAR_IMPLEMENTATION(U(2,2)=Su33.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(u33,Vu33);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(u33,Vu33);)
 
 
-		ENABLE_SCALAR_IMPLEMENTATION(V(0,0)=Sv11.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v11,Vv11);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v11,Vv11);)
-		ENABLE_SCALAR_IMPLEMENTATION(V(1,0)=Sv21.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v21,Vv21);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v21,Vv21);)
-		ENABLE_SCALAR_IMPLEMENTATION(V(2,0)=Sv31.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v31,Vv31);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v31,Vv31);)
-		ENABLE_SCALAR_IMPLEMENTATION(V(0,1)=Sv12.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v12,Vv12);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v12,Vv12);)
-		ENABLE_SCALAR_IMPLEMENTATION(V(1,1)=Sv22.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v22,Vv22);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v22,Vv22);)
-		ENABLE_SCALAR_IMPLEMENTATION(V(2,1)=Sv32.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v32,Vv32);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v32,Vv32);)
-		ENABLE_SCALAR_IMPLEMENTATION(V(0,2)=Sv13.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v13,Vv13);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v13,Vv13);)
-		ENABLE_SCALAR_IMPLEMENTATION(V(1,2)=Sv23.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v23,Vv23);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v23,Vv23);)
-		ENABLE_SCALAR_IMPLEMENTATION(V(2,2)=Sv33.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v33,Vv33);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v33,Vv33);)
+    ENABLE_SCALAR_IMPLEMENTATION(V(0,0)=Sv11.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v11,Vv11);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v11,Vv11);)
+    ENABLE_SCALAR_IMPLEMENTATION(V(1,0)=Sv21.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v21,Vv21);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v21,Vv21);)
+    ENABLE_SCALAR_IMPLEMENTATION(V(2,0)=Sv31.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v31,Vv31);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v31,Vv31);)
+    ENABLE_SCALAR_IMPLEMENTATION(V(0,1)=Sv12.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v12,Vv12);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v12,Vv12);)
+    ENABLE_SCALAR_IMPLEMENTATION(V(1,1)=Sv22.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v22,Vv22);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v22,Vv22);)
+    ENABLE_SCALAR_IMPLEMENTATION(V(2,1)=Sv32.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v32,Vv32);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v32,Vv32);)
+    ENABLE_SCALAR_IMPLEMENTATION(V(0,2)=Sv13.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v13,Vv13);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v13,Vv13);)
+    ENABLE_SCALAR_IMPLEMENTATION(V(1,2)=Sv23.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v23,Vv23);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v23,Vv23);)
+    ENABLE_SCALAR_IMPLEMENTATION(V(2,2)=Sv33.f;)                                      ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(v33,Vv33);)                                 ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(v33,Vv33);)
 
 
-		ENABLE_SCALAR_IMPLEMENTATION(S(0,0)=Sa11.f;)                                   ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(sigma1,Va11);)                              ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(sigma1,Va11);)
-		ENABLE_SCALAR_IMPLEMENTATION(S(1,0)=Sa22.f;)                                   ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(sigma2,Va22);)                              ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(sigma2,Va22);)
-		ENABLE_SCALAR_IMPLEMENTATION(S(2,0)=Sa33.f;)                                   ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(sigma3,Va33);)                              ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(sigma3,Va33);)
+    ENABLE_SCALAR_IMPLEMENTATION(S(0,0)=Sa11.f;)                                   ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(sigma1,Va11);)                              ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(sigma1,Va11);)
+    ENABLE_SCALAR_IMPLEMENTATION(S(1,0)=Sa22.f;)                                   ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(sigma2,Va22);)                              ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(sigma2,Va22);)
+    ENABLE_SCALAR_IMPLEMENTATION(S(2,0)=Sa33.f;)                                   ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(sigma3,Va33);)                              ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(sigma3,Va33);)
 }
 }
 #pragma runtime_checks( "u", restore ) 
 #pragma runtime_checks( "u", restore ) 
 
 

+ 65 - 61
include/igl/svd3x3/svd3x3_avx.cpp

@@ -20,78 +20,82 @@
 
 
 #pragma runtime_checks( "u", off )  // disable runtime asserts on xor eax,eax type of stuff (doesn't always work, disable explicitly in compiler settings)
 #pragma runtime_checks( "u", off )  // disable runtime asserts on xor eax,eax type of stuff (doesn't always work, disable explicitly in compiler settings)
 template<typename T>
 template<typename T>
-IGL_INLINE void igl::svd3x3_avx(const Eigen::Matrix<T, 3*8, 3>& A, Eigen::Matrix<T, 3*8, 3> &U, Eigen::Matrix<T, 3*8, 1> &S, Eigen::Matrix<T, 3*8, 3>&V)
+IGL_INLINE void igl::svd3x3_avx(
+  const Eigen::Matrix<T, 3*8, 3>& A, 
+  Eigen::Matrix<T, 3*8, 3> &U, 
+  Eigen::Matrix<T, 3*8, 1> &S, 
+  Eigen::Matrix<T, 3*8, 3>&V)
 {
 {
-	// this code assumes USE_AVX_IMPLEMENTATION is defined 
-	float Ashuffle[9][8], Ushuffle[9][8], Vshuffle[9][8], Sshuffle[3][8];
-	for (int i=0; i<3; i++)
-	{
-		for (int j=0; j<3; j++)
-		{
-			for (int k=0; k<8; k++)
-			{
-				Ashuffle[i + j*3][k] = A(i + 3*k, j);
-			}
-		}
-	}
+  // this code assumes USE_AVX_IMPLEMENTATION is defined 
+  float Ashuffle[9][8], Ushuffle[9][8], Vshuffle[9][8], Sshuffle[3][8];
+  for (int i=0; i<3; i++)
+  {
+    for (int j=0; j<3; j++)
+    {
+      for (int k=0; k<8; k++)
+      {
+        Ashuffle[i + j*3][k] = A(i + 3*k, j);
+      }
+    }
+  }
 
 
 #include "Singular_Value_Decomposition_Kernel_Declarations.hpp"
 #include "Singular_Value_Decomposition_Kernel_Declarations.hpp"
 
 
-		ENABLE_AVX_IMPLEMENTATION(Va11=_mm256_loadu_ps(Ashuffle[0]);)
-		ENABLE_AVX_IMPLEMENTATION(Va21=_mm256_loadu_ps(Ashuffle[1]);)
-		ENABLE_AVX_IMPLEMENTATION(Va31=_mm256_loadu_ps(Ashuffle[2]);)
-		ENABLE_AVX_IMPLEMENTATION(Va12=_mm256_loadu_ps(Ashuffle[3]);)
-		ENABLE_AVX_IMPLEMENTATION(Va22=_mm256_loadu_ps(Ashuffle[4]);)
-		ENABLE_AVX_IMPLEMENTATION(Va32=_mm256_loadu_ps(Ashuffle[5]);)
-		ENABLE_AVX_IMPLEMENTATION(Va13=_mm256_loadu_ps(Ashuffle[6]);)
-		ENABLE_AVX_IMPLEMENTATION(Va23=_mm256_loadu_ps(Ashuffle[7]);)
-		ENABLE_AVX_IMPLEMENTATION(Va33=_mm256_loadu_ps(Ashuffle[8]);)
+  ENABLE_AVX_IMPLEMENTATION(Va11=_mm256_loadu_ps(Ashuffle[0]);)
+  ENABLE_AVX_IMPLEMENTATION(Va21=_mm256_loadu_ps(Ashuffle[1]);)
+  ENABLE_AVX_IMPLEMENTATION(Va31=_mm256_loadu_ps(Ashuffle[2]);)
+  ENABLE_AVX_IMPLEMENTATION(Va12=_mm256_loadu_ps(Ashuffle[3]);)
+  ENABLE_AVX_IMPLEMENTATION(Va22=_mm256_loadu_ps(Ashuffle[4]);)
+  ENABLE_AVX_IMPLEMENTATION(Va32=_mm256_loadu_ps(Ashuffle[5]);)
+  ENABLE_AVX_IMPLEMENTATION(Va13=_mm256_loadu_ps(Ashuffle[6]);)
+  ENABLE_AVX_IMPLEMENTATION(Va23=_mm256_loadu_ps(Ashuffle[7]);)
+  ENABLE_AVX_IMPLEMENTATION(Va33=_mm256_loadu_ps(Ashuffle[8]);)
 
 
 #include "Singular_Value_Decomposition_Main_Kernel_Body.hpp"
 #include "Singular_Value_Decomposition_Main_Kernel_Body.hpp"
 
 
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[0],Vu11);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[1],Vu21);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[2],Vu31);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[3],Vu12);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[4],Vu22);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[5],Vu32);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[6],Vu13);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[7],Vu23);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[8],Vu33);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[0],Vu11);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[1],Vu21);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[2],Vu31);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[3],Vu12);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[4],Vu22);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[5],Vu32);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[6],Vu13);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[7],Vu23);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Ushuffle[8],Vu33);)
 
 
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[0],Vv11);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[1],Vv21);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[2],Vv31);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[3],Vv12);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[4],Vv22);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[5],Vv32);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[6],Vv13);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[7],Vv23);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[8],Vv33);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[0],Vv11);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[1],Vv21);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[2],Vv31);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[3],Vv12);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[4],Vv22);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[5],Vv32);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[6],Vv13);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[7],Vv23);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Vshuffle[8],Vv33);)
 
 
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Sshuffle[0],Va11);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Sshuffle[1],Va22);)
-		ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Sshuffle[2],Va33);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Sshuffle[0],Va11);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Sshuffle[1],Va22);)
+  ENABLE_AVX_IMPLEMENTATION(_mm256_storeu_ps(Sshuffle[2],Va33);)
 
 
-		for (int i=0; i<3; i++)
-		{
-			for (int j=0; j<3; j++)
-			{
-				for (int k=0; k<8; k++)
-				{
-					U(i + 3*k, j) = Ushuffle[i + j*3][k];
-					V(i + 3*k, j) = Vshuffle[i + j*3][k];
-				}
-			}
-		}
+  for (int i=0; i<3; i++)
+  {
+    for (int j=0; j<3; j++)
+    {
+      for (int k=0; k<8; k++)
+      {
+        U(i + 3*k, j) = Ushuffle[i + j*3][k];
+        V(i + 3*k, j) = Vshuffle[i + j*3][k];
+      }
+    }
+  }
 
 
-		for (int i=0; i<3; i++)
-		{
-			for (int k=0; k<8; k++)
-			{
-				S(i + 3*k, 0) = Sshuffle[i][k];
-			}
-		}
+  for (int i=0; i<3; i++)
+  {
+    for (int k=0; k<8; k++)
+    {
+      S(i + 3*k, 0) = Sshuffle[i][k];
+    }
+  }
 }
 }
 #pragma runtime_checks( "u", restore )
 #pragma runtime_checks( "u", restore )
 
 

+ 68 - 62
include/igl/svd3x3/svd3x3_sse.cpp

@@ -18,80 +18,86 @@
 #define COMPUTE_V_AS_MATRIX
 #define COMPUTE_V_AS_MATRIX
 #include "Singular_Value_Decomposition_Preamble.hpp"
 #include "Singular_Value_Decomposition_Preamble.hpp"
 
 
-#pragma runtime_checks( "u", off )  // disable runtime asserts on xor eax,eax type of stuff (doesn't always work, disable explicitly in compiler settings)
+// disable runtime asserts on xor eax,eax type of stuff (doesn't always work,
+// disable explicitly in compiler settings)
+#pragma runtime_checks( "u", off )  
 template<typename T>
 template<typename T>
-IGL_INLINE void igl::svd3x3_sse(const Eigen::Matrix<T, 3*4, 3>& A, Eigen::Matrix<T, 3*4, 3> &U, Eigen::Matrix<T, 3*4, 1> &S, Eigen::Matrix<T, 3*4, 3>&V)
+IGL_INLINE void igl::svd3x3_sse(
+  const Eigen::Matrix<T, 3*4, 3>& A, 
+  Eigen::Matrix<T, 3*4, 3> &U, 
+  Eigen::Matrix<T, 3*4, 1> &S, 
+  Eigen::Matrix<T, 3*4, 3>&V)
 {
 {
-	// this code assumes USE_SSE_IMPLEMENTATION is defined 
-	float Ashuffle[9][4], Ushuffle[9][4], Vshuffle[9][4], Sshuffle[3][4];
-	for (int i=0; i<3; i++)
-	{
-		for (int j=0; j<3; j++)
-		{
-			for (int k=0; k<4; k++)
-			{
-				Ashuffle[i + j*3][k] = A(i + 3*k, j);
-			}
-		}
-	}
+  // this code assumes USE_SSE_IMPLEMENTATION is defined 
+  float Ashuffle[9][4], Ushuffle[9][4], Vshuffle[9][4], Sshuffle[3][4];
+  for (int i=0; i<3; i++)
+  {
+    for (int j=0; j<3; j++)
+    {
+      for (int k=0; k<4; k++)
+      {
+        Ashuffle[i + j*3][k] = A(i + 3*k, j);
+      }
+    }
+  }
 
 
 #include "Singular_Value_Decomposition_Kernel_Declarations.hpp"
 #include "Singular_Value_Decomposition_Kernel_Declarations.hpp"
 
 
-		ENABLE_SSE_IMPLEMENTATION(Va11=_mm_loadu_ps(Ashuffle[0]);)
-		ENABLE_SSE_IMPLEMENTATION(Va21=_mm_loadu_ps(Ashuffle[1]);)
-		ENABLE_SSE_IMPLEMENTATION(Va31=_mm_loadu_ps(Ashuffle[2]);)
-		ENABLE_SSE_IMPLEMENTATION(Va12=_mm_loadu_ps(Ashuffle[3]);)
-		ENABLE_SSE_IMPLEMENTATION(Va22=_mm_loadu_ps(Ashuffle[4]);)
-		ENABLE_SSE_IMPLEMENTATION(Va32=_mm_loadu_ps(Ashuffle[5]);)
-		ENABLE_SSE_IMPLEMENTATION(Va13=_mm_loadu_ps(Ashuffle[6]);)
-		ENABLE_SSE_IMPLEMENTATION(Va23=_mm_loadu_ps(Ashuffle[7]);)
-		ENABLE_SSE_IMPLEMENTATION(Va33=_mm_loadu_ps(Ashuffle[8]);)
+  ENABLE_SSE_IMPLEMENTATION(Va11=_mm_loadu_ps(Ashuffle[0]);)
+  ENABLE_SSE_IMPLEMENTATION(Va21=_mm_loadu_ps(Ashuffle[1]);)
+  ENABLE_SSE_IMPLEMENTATION(Va31=_mm_loadu_ps(Ashuffle[2]);)
+  ENABLE_SSE_IMPLEMENTATION(Va12=_mm_loadu_ps(Ashuffle[3]);)
+  ENABLE_SSE_IMPLEMENTATION(Va22=_mm_loadu_ps(Ashuffle[4]);)
+  ENABLE_SSE_IMPLEMENTATION(Va32=_mm_loadu_ps(Ashuffle[5]);)
+  ENABLE_SSE_IMPLEMENTATION(Va13=_mm_loadu_ps(Ashuffle[6]);)
+  ENABLE_SSE_IMPLEMENTATION(Va23=_mm_loadu_ps(Ashuffle[7]);)
+  ENABLE_SSE_IMPLEMENTATION(Va33=_mm_loadu_ps(Ashuffle[8]);)
 
 
 #include "Singular_Value_Decomposition_Main_Kernel_Body.hpp"
 #include "Singular_Value_Decomposition_Main_Kernel_Body.hpp"
 
 
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[0],Vu11);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[1],Vu21);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[2],Vu31);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[3],Vu12);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[4],Vu22);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[5],Vu32);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[6],Vu13);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[7],Vu23);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[8],Vu33);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[0],Vu11);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[1],Vu21);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[2],Vu31);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[3],Vu12);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[4],Vu22);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[5],Vu32);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[6],Vu13);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[7],Vu23);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Ushuffle[8],Vu33);)
 
 
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[0],Vv11);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[1],Vv21);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[2],Vv31);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[3],Vv12);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[4],Vv22);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[5],Vv32);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[6],Vv13);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[7],Vv23);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[8],Vv33);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[0],Vv11);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[1],Vv21);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[2],Vv31);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[3],Vv12);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[4],Vv22);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[5],Vv32);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[6],Vv13);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[7],Vv23);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Vshuffle[8],Vv33);)
 
 
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Sshuffle[0],Va11);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Sshuffle[1],Va22);)
-		ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Sshuffle[2],Va33);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Sshuffle[0],Va11);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Sshuffle[1],Va22);)
+  ENABLE_SSE_IMPLEMENTATION(_mm_storeu_ps(Sshuffle[2],Va33);)
 
 
-		for (int i=0; i<3; i++)
-		{
-			for (int j=0; j<3; j++)
-			{
-				for (int k=0; k<4; k++)
-				{
-					U(i + 3*k, j) = Ushuffle[i + j*3][k];
-					V(i + 3*k, j) = Vshuffle[i + j*3][k];
-				}
-			}
-		}
+  for (int i=0; i<3; i++)
+  {
+    for (int j=0; j<3; j++)
+    {
+      for (int k=0; k<4; k++)
+      {
+        U(i + 3*k, j) = Ushuffle[i + j*3][k];
+        V(i + 3*k, j) = Vshuffle[i + j*3][k];
+      }
+    }
+  }
 
 
-		for (int i=0; i<3; i++)
-		{
-			for (int k=0; k<4; k++)
-			{
-				S(i + 3*k, 0) = Sshuffle[i][k];
-			}
-		}
+  for (int i=0; i<3; i++)
+  {
+    for (int k=0; k<4; k++)
+    {
+      S(i + 3*k, 0) = Sshuffle[i][k];
+    }
+  }
 }
 }
 #pragma runtime_checks( "u", restore )
 #pragma runtime_checks( "u", restore )
 
 

+ 2 - 2
include/igl/tetgen/mesh_with_skeleton.cpp

@@ -17,7 +17,7 @@
 // to produce a graded tet mesh
 // to produce a graded tet mesh
 const static std::string DEFAULT_TETGEN_FLAGS = "pq2Y";
 const static std::string DEFAULT_TETGEN_FLAGS = "pq2Y";
 
 
-bool igl::mesh_with_skeleton(
+IGL_INLINE bool igl::mesh_with_skeleton(
   const Eigen::MatrixXd & V,
   const Eigen::MatrixXd & V,
   const Eigen::MatrixXi & F,
   const Eigen::MatrixXi & F,
   const Eigen::MatrixXd & C,
   const Eigen::MatrixXd & C,
@@ -86,7 +86,7 @@ bool igl::mesh_with_skeleton(
   return true;
   return true;
 }
 }
 
 
-bool igl::mesh_with_skeleton(
+IGL_INLINE bool igl::mesh_with_skeleton(
   const Eigen::MatrixXd & V,
   const Eigen::MatrixXd & V,
   const Eigen::MatrixXi & F,
   const Eigen::MatrixXi & F,
   const Eigen::MatrixXd & C,
   const Eigen::MatrixXd & C,

+ 43 - 43
include/igl/tetgen/mesh_with_skeleton.h

@@ -13,49 +13,49 @@
 
 
 namespace igl
 namespace igl
 {
 {
-// Mesh the interior of a given surface with tetrahedra which are graded (tend
-// to be small near the surface and large inside) and conform to the given
-// handles and samplings thereof.
-//
-// Inputs:
-//  V  #V by 3 list of mesh vertex positions
-//  F  #F by 3 list of triangle indices
-//  C  #C by 3 list of vertex positions
-//  P  #P list of point handle indices
-//  BE #BE by 2 list of bone-edge indices
-//  CE #CE by 2 list of cage-edge indices
-//  samples_per_bone  #samples to add per bone
-//  tetgen_flags  flags to pass to tetgen {""-->"pq2Y"} otherwise you're on
-//    your own and it's your funeral if you pass nonsense flags
-// Outputs:
-//  VV  #VV by 3 list of tet-mesh vertex positions
-//  TT  #TT by 4 list of tetrahedra indices
-//  FF  #FF by 3 list of surface triangle indices
-// Returns true only on success
-bool mesh_with_skeleton(
-  const Eigen::MatrixXd & V,
-  const Eigen::MatrixXi & F,
-  const Eigen::MatrixXd & C,
-  const Eigen::VectorXi & /*P*/,
-  const Eigen::MatrixXi & BE,
-  const Eigen::MatrixXi & CE,
-  const int samples_per_bone,
-  const std::string & tetgen_flags,
-  Eigen::MatrixXd & VV,
-  Eigen::MatrixXi & TT,
-  Eigen::MatrixXi & FF);
-// Wrapper using default tetgen_flags
-bool mesh_with_skeleton(
-  const Eigen::MatrixXd & V,
-  const Eigen::MatrixXi & F,
-  const Eigen::MatrixXd & C,
-  const Eigen::VectorXi & /*P*/,
-  const Eigen::MatrixXi & BE,
-  const Eigen::MatrixXi & CE,
-  const int samples_per_bone,
-  Eigen::MatrixXd & VV,
-  Eigen::MatrixXi & TT,
-  Eigen::MatrixXi & FF);
+  // Mesh the interior of a given surface with tetrahedra which are graded (tend
+  // to be small near the surface and large inside) and conform to the given
+  // handles and samplings thereof.
+  //
+  // Inputs:
+  //  V  #V by 3 list of mesh vertex positions
+  //  F  #F by 3 list of triangle indices
+  //  C  #C by 3 list of vertex positions
+  //  P  #P list of point handle indices
+  //  BE #BE by 2 list of bone-edge indices
+  //  CE #CE by 2 list of cage-edge indices
+  //  samples_per_bone  #samples to add per bone
+  //  tetgen_flags  flags to pass to tetgen {""-->"pq2Y"} otherwise you're on
+  //    your own and it's your funeral if you pass nonsense flags
+  // Outputs:
+  //  VV  #VV by 3 list of tet-mesh vertex positions
+  //  TT  #TT by 4 list of tetrahedra indices
+  //  FF  #FF by 3 list of surface triangle indices
+  // Returns true only on success
+  IGL_INLINE bool mesh_with_skeleton(
+    const Eigen::MatrixXd & V,
+    const Eigen::MatrixXi & F,
+    const Eigen::MatrixXd & C,
+    const Eigen::VectorXi & /*P*/,
+    const Eigen::MatrixXi & BE,
+    const Eigen::MatrixXi & CE,
+    const int samples_per_bone,
+    const std::string & tetgen_flags,
+    Eigen::MatrixXd & VV,
+    Eigen::MatrixXi & TT,
+    Eigen::MatrixXi & FF);
+  // Wrapper using default tetgen_flags
+  IGL_INLINE bool mesh_with_skeleton(
+    const Eigen::MatrixXd & V,
+    const Eigen::MatrixXi & F,
+    const Eigen::MatrixXd & C,
+    const Eigen::VectorXi & /*P*/,
+    const Eigen::MatrixXi & BE,
+    const Eigen::MatrixXi & CE,
+    const int samples_per_bone,
+    Eigen::MatrixXd & VV,
+    Eigen::MatrixXi & TT,
+    Eigen::MatrixXi & FF);
 }
 }
 
 
 
 

+ 7 - 0
include/igl/texture_from_tga.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "texture_from_tga.h"
 #include "texture_from_tga.h"
 #ifndef IGL_NO_OPENGL
 #ifndef IGL_NO_OPENGL
 
 

+ 7 - 0
include/igl/texture_from_tga.h

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #ifndef IGL_TEXTURE_FROM_TGA_H
 #ifndef IGL_TEXTURE_FROM_TGA_H
 #define IGL_TEXTURE_FROM_TGA_H
 #define IGL_TEXTURE_FROM_TGA_H
 #ifndef IGL_NO_OPENGL
 #ifndef IGL_NO_OPENGL

+ 2 - 2
include/igl/uniformly_sample_two_manifold.cpp

@@ -191,8 +191,8 @@ IGL_INLINE void igl::uniformly_sample_two_manifold(
         {
         {
           // Randomly sample unit square
           // Randomly sample unit square
           double u,v;
           double u,v;
-//		  double ru = fgenrand();
-//		  double rv = fgenrand();
+//      double ru = fgenrand();
+//      double rv = fgenrand();
           double ru = (double)rand() / RAND_MAX;
           double ru = (double)rand() / RAND_MAX;
           double rv = (double)rand() / RAND_MAX;
           double rv = (double)rand() / RAND_MAX;
           // Reflect to lower triangle if above
           // Reflect to lower triangle if above

+ 7 - 0
include/igl/writeSTL.cpp

@@ -1,3 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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/.
 #include "writeSTL.h"
 #include "writeSTL.h"
 #include <iostream>
 #include <iostream>
 
 

+ 3 - 3
include/igl/xml/XMLSerializable.h

@@ -12,8 +12,8 @@
  Inherit from this abstract class to have full control over the serialization
  Inherit from this abstract class to have full control over the serialization
  of your user defined class.
  of your user defined class.
  ----------------------------------------------------------------------------*/
  ----------------------------------------------------------------------------*/
-#ifndef XML_SERIALIZABLE_H
-#define XML_SERIALIZABLE_H
+#ifndef IGL_XML_SERIALIZABLE_H
+#define IGL_XML_SERIALIZABLE_H
 
 
 #include <iostream>
 #include <iostream>
 #include <tinyxml2.h>
 #include <tinyxml2.h>
@@ -48,4 +48,4 @@ namespace igl
   };
   };
 }
 }
 
 
-#endif
+#endif

+ 3 - 3
include/igl/xml/XMLSerialization.h

@@ -21,8 +21,8 @@
  Restrictions on Native C++ Expressions (Anonymous Namespaces):
  Restrictions on Native C++ Expressions (Anonymous Namespaces):
  http://msdn.microsoft.com/en-us/library/0888kc6a%28VS.80%29.aspx
  http://msdn.microsoft.com/en-us/library/0888kc6a%28VS.80%29.aspx
  ----------------------------------------------------------------------------*/
  ----------------------------------------------------------------------------*/
-#ifndef XML_SERIALIZATION_H
-#define XML_SERIALIZATION_H
+#ifndef IGL_XML_SERIALIZATION_H
+#define IGL_XML_SERIALIZATION_H
 
 
 #include <igl/xml/XMLSerializer.h>
 #include <igl/xml/XMLSerializer.h>
 
 
@@ -179,4 +179,4 @@ namespace igl
   }
   }
 }
 }
 
 
-#endif
+#endif

+ 3 - 3
include/igl/xml/XMLSerializationTest.h

@@ -11,8 +11,8 @@
 ------------------------------------------------------------------------------
 ------------------------------------------------------------------------------
  Used to demonstrates howto use the XMLSerialization class.
  Used to demonstrates howto use the XMLSerialization class.
 ----------------------------------------------------------------------------*/
 ----------------------------------------------------------------------------*/
-#ifndef XML_SERIALIZABLE_H
-#define XML_SERIALIZABLE_H  
+#ifndef IGL_XML_SERIALIZATION_TEST_H
+#define IGL_XML_SERIALIZATION_TEST_H
 
 
 #include <igl/xml/XMLSerialization.h>
 #include <igl/xml/XMLSerialization.h>
 
 
@@ -50,4 +50,4 @@ namespace igl
   }
   }
 }
 }
 
 
-#endif
+#endif

+ 1 - 1
include/igl/xml/XMLSerializer.h.REMOVED.git-id

@@ -1 +1 @@
-b577b828733573555bafa81419328caa99598eb8
+56b335a3350589ce8d820073853621f7febb71f4

+ 3 - 3
style_guidelines.html

@@ -179,7 +179,7 @@ and outputs.
         <td>Find files that aren't using igl namespace</td>
         <td>Find files that aren't using igl namespace</td>
       </tr>
       </tr>
       <tr class=d0>
       <tr class=d0>
-        <td><code>grep -P '\t' *</code></td>
+        <td><code>grep -lP '\t' *</code></td>
         <td>Find files using [TAB] character</td>
         <td>Find files using [TAB] character</td>
       </tr>
       </tr>
       <tr class=d1>
       <tr class=d1>
@@ -191,7 +191,7 @@ and outputs.
         <td>Find files using asserts without identifier strings</td>
         <td>Find files using asserts without identifier strings</td>
       </tr>
       </tr>
       <tr class=d1>
       <tr class=d1>
-        <td><code>grep -l "ifndef IGL_.*[^H] *$" *</code></td>
+        <td><code>grep -l "ifndef IGL_.*[^H] *$" *.h</code></td>
         <td>Find .h files that contain ifndef IGL_*[^H]</td>
         <td>Find .h files that contain ifndef IGL_*[^H]</td>
       </tr>
       </tr>
       <tr class=d0>
       <tr class=d0>
@@ -199,7 +199,7 @@ and outputs.
         <td>Find files that don't contain #ifndef IGL_</td>
         <td>Find files that don't contain #ifndef IGL_</td>
       </tr>
       </tr>
       <tr class=d1>
       <tr class=d1>
-        <td><code>grep -L "^This file is part of libigl" *</code></td>
+        <td><code>grep -L "^// This file is part of libigl" *</code></td>
       </tr>
       </tr>
     </table>
     </table>
 
 

+ 1 - 0
todos.txt

@@ -1,3 +1,4 @@
+- reorient_facets_raycast depends on boost and embree
 - sort out `grad.*` vs `gradMat.*`
 - sort out `grad.*` vs `gradMat.*`
 - clean up externals
 - clean up externals
   - What's there for convenience?
   - What's there for convenience?