Browse Source

Merge pull request #1274 from skoch9/python

Python Bindings Template Fixes 2.0
Alec Jacobson 6 years ago
parent
commit
1af9b9707f

+ 22 - 22
include/igl/copyleft/tetgen/tetgenio_to_tetmesh.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 "tetgenio_to_tetmesh.h"
 #include "tetgenio_to_tetmesh.h"
 
 
@@ -18,11 +18,11 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
   std::vector<std::vector<REAL > > & V,
   std::vector<std::vector<REAL > > & V,
   std::vector<std::vector<int> > & T,
   std::vector<std::vector<int> > & T,
   std::vector<std::vector<int > > & F,
   std::vector<std::vector<int > > & F,
-  std::vector<std::vector<REAL > >&  R, 
+  std::vector<std::vector<REAL > >&  R,
   std::vector<std::vector<int > >& N,
   std::vector<std::vector<int > >& N,
   std::vector<std::vector<int > >& PT,
   std::vector<std::vector<int > >& PT,
   std::vector<std::vector<int > >& FT,
   std::vector<std::vector<int > >& FT,
-  size_t & nR ) 
+  size_t & nR )
 {
 {
    using namespace std;
    using namespace std;
    // process points
    // process points
@@ -63,11 +63,11 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
        max_index = (max_index < index ? index : max_index);
        max_index = (max_index < index ? index : max_index);
      }
      }
    }
    }
-  
+
    assert(min_index >= 0);
    assert(min_index >= 0);
    assert(max_index >= 0);
    assert(max_index >= 0);
    assert(max_index < (int)V.size());
    assert(max_index < (int)V.size());
- 
+
    cout<<out.numberoftrifaces<<endl;
    cout<<out.numberoftrifaces<<endl;
 
 
    // When would this not be 4?
    // When would this not be 4?
@@ -96,30 +96,30 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
    // extract region marks
    // extract region marks
    nR = hashUniqueRegions.size();
    nR = hashUniqueRegions.size();
 
 
-   // extract neighbor list 
-   N.resize(out.numberoftetrahedra, vector<int>(4));   
+   // extract neighbor list
+   N.resize(out.numberoftetrahedra, vector<int>(4));
    for (size_t i = 0; i < out.numberoftetrahedra; i++)
    for (size_t i = 0; i < out.numberoftetrahedra; i++)
    {
    {
      for (size_t j = 0; j < 4; j++)
      for (size_t j = 0; j < 4; j++)
        N[i][j] = out.neighborlist[i * 4 + j];
        N[i][j] = out.neighborlist[i * 4 + j];
-   } 
-  
-   // extract point 2 tetrahedron list 
+   }
+
+   // extract point 2 tetrahedron list
    PT.resize(out.numberofpoints, vector<int>(1));
    PT.resize(out.numberofpoints, vector<int>(1));
    for (size_t i = 0; i < out.numberofpoints; i++)
    for (size_t i = 0; i < out.numberofpoints; i++)
    {
    {
-     PT[i][0] = out.point2tetlist[i]; 
-   }	
- 
+     PT[i][0] = out.point2tetlist[i];
+   }
+
    //extract face to tetrahedron list
    //extract face to tetrahedron list
-   FT.resize(out.numberoftrifaces, vector<int>(2)); 
+   FT.resize(out.numberoftrifaces, vector<int>(2));
    int triface;
    int triface;
-   
+
    for (size_t i = 0; i < out.numberoftrifaces; i++)
    for (size_t i = 0; i < out.numberoftrifaces; i++)
    {
    {
      for (size_t j = 0; j < 2; j++)
      for (size_t j = 0; j < 2; j++)
      {
      {
-       FT[i][j] = out.face2tetlist[0]; 
+       FT[i][j] = out.face2tetlist[0];
      }
      }
    }
    }
 
 
@@ -129,7 +129,7 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
 
 
 IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
 IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
   const tetgenio & out,
   const tetgenio & out,
-  std::vector<std::vector<REAL > > & V, 
+  std::vector<std::vector<REAL > > & V,
   std::vector<std::vector<int> > & T,
   std::vector<std::vector<int> > & T,
   std::vector<std::vector<int> > & F)
   std::vector<std::vector<int> > & F)
 {
 {
@@ -182,7 +182,7 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
   // loop over tetrahedra
   // loop over tetrahedra
   for(int i = 0; i < out.numberoftrifaces; i++)
   for(int i = 0; i < out.numberoftrifaces; i++)
   {
   {
-    if(out.trifacemarkerlist[i]>=0)
+    if (out.trifacemarkerlist && out.trifacemarkerlist[i] >= 0)
     {
     {
       vector<int> face(3);
       vector<int> face(3);
       for(int j = 0; j<3; j++)
       for(int j = 0; j<3; j++)
@@ -198,7 +198,7 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
 
 
 IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
 IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
   const tetgenio & out,
   const tetgenio & out,
-  std::vector<std::vector<REAL > > & V, 
+  std::vector<std::vector<REAL > > & V,
   std::vector<std::vector<int> > & T)
   std::vector<std::vector<int> > & T)
 {
 {
   std::vector<std::vector<int> > F;
   std::vector<std::vector<int> > F;

+ 7 - 7
include/igl/directed_edge_orientations.cpp

@@ -1,16 +1,16 @@
 // 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 "directed_edge_orientations.h"
 #include "directed_edge_orientations.h"
 
 
 template <typename DerivedC, typename DerivedE>
 template <typename DerivedC, typename DerivedE>
 IGL_INLINE void igl::directed_edge_orientations(
 IGL_INLINE void igl::directed_edge_orientations(
-  const Eigen::PlainObjectBase<DerivedC> & C,
-  const Eigen::PlainObjectBase<DerivedE> & E,
+  const Eigen::MatrixBase<DerivedC> & C,
+  const Eigen::MatrixBase<DerivedE> & E,
   std::vector<
   std::vector<
       Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & Q)
       Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & Q)
 {
 {
@@ -25,5 +25,5 @@ IGL_INLINE void igl::directed_edge_orientations(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::directed_edge_orientations<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&, std::vector<Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> > >&);
+template void igl::directed_edge_orientations<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&, std::vector<Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> > >&);
 #endif
 #endif

+ 7 - 7
include/igl/directed_edge_orientations.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_DIRECTED_EDGE_ORIENTATIONS_H
 #ifndef IGL_DIRECTED_EDGE_ORIENTATIONS_H
 #define IGL_DIRECTED_EDGE_ORIENTATIONS_H
 #define IGL_DIRECTED_EDGE_ORIENTATIONS_H
@@ -23,12 +23,12 @@ namespace igl
   //   C  #C by 3 list of edge vertex positions
   //   C  #C by 3 list of edge vertex positions
   //   E  #E by 2 list of directed edges
   //   E  #E by 2 list of directed edges
   // Outputs:
   // Outputs:
-  //   Q  #E list of quaternions 
+  //   Q  #E list of quaternions
   //
   //
   template <typename DerivedC, typename DerivedE>
   template <typename DerivedC, typename DerivedE>
   IGL_INLINE void directed_edge_orientations(
   IGL_INLINE void directed_edge_orientations(
-    const Eigen::PlainObjectBase<DerivedC> & C,
-    const Eigen::PlainObjectBase<DerivedE> & E,
+    const Eigen::MatrixBase<DerivedC> & C,
+    const Eigen::MatrixBase<DerivedE> & E,
     std::vector<
     std::vector<
       Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & Q);
       Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & Q);
 }
 }

+ 7 - 7
include/igl/dqs.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) 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/.
 #include "dqs.h"
 #include "dqs.h"
 #include <Eigen/Geometry>
 #include <Eigen/Geometry>
@@ -15,8 +15,8 @@ template <
   typename T,
   typename T,
   typename DerivedU>
   typename DerivedU>
 IGL_INLINE void igl::dqs(
 IGL_INLINE void igl::dqs(
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::PlainObjectBase<DerivedW> & W,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedW> & W,
   const std::vector<Q,QAlloc> & vQ,
   const std::vector<Q,QAlloc> & vQ,
   const std::vector<T> & vT,
   const std::vector<T> & vT,
   Eigen::PlainObjectBase<DerivedU> & U)
   Eigen::PlainObjectBase<DerivedU> & U)
@@ -70,5 +70,5 @@ IGL_INLINE void igl::dqs(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::dqs<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> >, Eigen::Matrix<double, 3, 1, 0, 3, 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&, std::vector<Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> > > const&, std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::dqs<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> >, Eigen::Matrix<double, 3, 1, 0, 3, 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&, std::vector<Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> > > const&, std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
 #endif

+ 7 - 7
include/igl/dqs.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_DQS_H
 #ifndef IGL_DQS_H
 #define IGL_DQS_H
 #define IGL_DQS_H
@@ -17,7 +17,7 @@ namespace igl
   // Inputs:
   // Inputs:
   //   V  #V by 3 list of rest positions
   //   V  #V by 3 list of rest positions
   //   W  #W by #C list of weights
   //   W  #W by #C list of weights
-  //   vQ  #C list of rotation quaternions 
+  //   vQ  #C list of rotation quaternions
   //   vT  #C list of translation vectors
   //   vT  #C list of translation vectors
   // Outputs:
   // Outputs:
   //   U  #V by 3 list of new positions
   //   U  #V by 3 list of new positions
@@ -29,8 +29,8 @@ namespace igl
     typename T,
     typename T,
     typename DerivedU>
     typename DerivedU>
   IGL_INLINE void dqs(
   IGL_INLINE void dqs(
-    const Eigen::PlainObjectBase<DerivedV> & V,
-    const Eigen::PlainObjectBase<DerivedW> & W,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedW> & W,
     const std::vector<Q,QAlloc> & vQ,
     const std::vector<Q,QAlloc> & vQ,
     const std::vector<T> & vT,
     const std::vector<T> & vT,
     Eigen::PlainObjectBase<DerivedU> & U);
     Eigen::PlainObjectBase<DerivedU> & U);

+ 14 - 14
include/igl/find_cross_field_singularities.cpp

@@ -16,9 +16,9 @@
 
 
 
 
 template <typename DerivedV, typename DerivedF, typename DerivedM, typename DerivedO>
 template <typename DerivedV, typename DerivedF, typename DerivedM, typename DerivedO>
-IGL_INLINE void igl::find_cross_field_singularities(const Eigen::PlainObjectBase<DerivedV> &V,
-                                                    const Eigen::PlainObjectBase<DerivedF> &F,
-                                                    const Eigen::PlainObjectBase<DerivedM> &Handle_MMatch,
+IGL_INLINE void igl::find_cross_field_singularities(const Eigen::MatrixBase<DerivedV> &V,
+                                                    const Eigen::MatrixBase<DerivedF> &F,
+                                                    const Eigen::MatrixBase<DerivedM> &Handle_MMatch,
                                                     Eigen::PlainObjectBase<DerivedO> &isSingularity,
                                                     Eigen::PlainObjectBase<DerivedO> &isSingularity,
                                                     Eigen::PlainObjectBase<DerivedO> &singularityIndex)
                                                     Eigen::PlainObjectBase<DerivedO> &singularityIndex)
 {
 {
@@ -59,10 +59,10 @@ IGL_INLINE void igl::find_cross_field_singularities(const Eigen::PlainObjectBase
 }
 }
 
 
 template <typename DerivedV, typename DerivedF, typename DerivedO>
 template <typename DerivedV, typename DerivedF, typename DerivedO>
-IGL_INLINE void igl::find_cross_field_singularities(const Eigen::PlainObjectBase<DerivedV> &V,
-                                                    const Eigen::PlainObjectBase<DerivedF> &F,
-                                                    const Eigen::PlainObjectBase<DerivedV> &PD1,
-                                                    const Eigen::PlainObjectBase<DerivedV> &PD2,
+IGL_INLINE void igl::find_cross_field_singularities(const Eigen::MatrixBase<DerivedV> &V,
+                                                    const Eigen::MatrixBase<DerivedF> &F,
+                                                    const Eigen::MatrixBase<DerivedV> &PD1,
+                                                    const Eigen::MatrixBase<DerivedV> &PD2,
                                                     Eigen::PlainObjectBase<DerivedO> &isSingularity,
                                                     Eigen::PlainObjectBase<DerivedO> &isSingularity,
                                                     Eigen::PlainObjectBase<DerivedO> &singularityIndex,
                                                     Eigen::PlainObjectBase<DerivedO> &singularityIndex,
                                                     bool isCombed)
                                                     bool isCombed)
@@ -75,11 +75,11 @@ IGL_INLINE void igl::find_cross_field_singularities(const Eigen::PlainObjectBase
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::find_cross_field_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, 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, 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> >&);
-template void igl::find_cross_field_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::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<int, -1, 1, 0, -1, 1> >&,
-Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, bool);
-template void igl::find_cross_field_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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template void igl::find_cross_field_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::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<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, bool);
-template void igl::find_cross_field_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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
-template void igl::find_cross_field_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, 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, 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> >&);
+template void igl::find_cross_field_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, 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, 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> >&);
+template void igl::find_cross_field_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::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<int, -1, 1, 0, -1, 1>> &,
+                                                                                                                                                                    Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1>> &, bool);
+template void igl::find_cross_field_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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::find_cross_field_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::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<int, -1, -1, 0, -1, -1>> &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>> &, bool);
+template void igl::find_cross_field_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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::find_cross_field_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, 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, 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> >&);
 #endif
 #endif

+ 7 - 7
include/igl/find_cross_field_singularities.h

@@ -25,9 +25,9 @@ namespace igl
   //   singularityIndex #V by 1 integer eigen Vector containing the singularity indices
   //   singularityIndex #V by 1 integer eigen Vector containing the singularity indices
   //
   //
   template <typename DerivedV, typename DerivedF, typename DerivedM, typename DerivedO>
   template <typename DerivedV, typename DerivedF, typename DerivedM, typename DerivedO>
-  IGL_INLINE void find_cross_field_singularities(const Eigen::PlainObjectBase<DerivedV> &V,
-                                                 const Eigen::PlainObjectBase<DerivedF> &F,
-                                                 const Eigen::PlainObjectBase<DerivedM> &mismatch,
+  IGL_INLINE void find_cross_field_singularities(const Eigen::MatrixBase<DerivedV> &V,
+                                                 const Eigen::MatrixBase<DerivedF> &F,
+                                                 const Eigen::MatrixBase<DerivedM> &mismatch,
                                                  Eigen::PlainObjectBase<DerivedO> &isSingularity,
                                                  Eigen::PlainObjectBase<DerivedO> &isSingularity,
                                                  Eigen::PlainObjectBase<DerivedO> &singularityIndex);
                                                  Eigen::PlainObjectBase<DerivedO> &singularityIndex);
 
 
@@ -43,10 +43,10 @@ namespace igl
   //   singularityIndex #V by 1 integer eigen Vector containing the singularity indices
   //   singularityIndex #V by 1 integer eigen Vector containing the singularity indices
   //
   //
   template <typename DerivedV, typename DerivedF, typename DerivedO>
   template <typename DerivedV, typename DerivedF, typename DerivedO>
-  IGL_INLINE void find_cross_field_singularities(const Eigen::PlainObjectBase<DerivedV> &V,
-                                                 const Eigen::PlainObjectBase<DerivedF> &F,
-                                                 const Eigen::PlainObjectBase<DerivedV> &PD1,
-                                                 const Eigen::PlainObjectBase<DerivedV> &PD2,
+  IGL_INLINE void find_cross_field_singularities(const Eigen::MatrixBase<DerivedV> &V,
+                                                 const Eigen::MatrixBase<DerivedF> &F,
+                                                 const Eigen::MatrixBase<DerivedV> &PD1,
+                                                 const Eigen::MatrixBase<DerivedV> &PD2,
                                                  Eigen::PlainObjectBase<DerivedO> &isSingularity,
                                                  Eigen::PlainObjectBase<DerivedO> &isSingularity,
                                                  Eigen::PlainObjectBase<DerivedO> &singularityIndex,
                                                  Eigen::PlainObjectBase<DerivedO> &singularityIndex,
                                                  bool isCombed = false);
                                                  bool isCombed = false);

+ 7 - 7
include/igl/marching_tets.cpp

@@ -22,9 +22,9 @@ template <typename DerivedTV,
           typename DerivedJ,
           typename DerivedJ,
           typename BCType>
           typename BCType>
 void igl::marching_tets(
 void igl::marching_tets(
-    const Eigen::PlainObjectBase<DerivedTV>& TV,
-    const Eigen::PlainObjectBase<DerivedTT>& TT,
-    const Eigen::PlainObjectBase<DerivedS>& isovals,
+    const Eigen::MatrixBase<DerivedTV>& TV,
+    const Eigen::MatrixBase<DerivedTT>& TT,
+    const Eigen::MatrixBase<DerivedS>& isovals,
     double isovalue,
     double isovalue,
     Eigen::PlainObjectBase<DerivedSV>& outV,
     Eigen::PlainObjectBase<DerivedSV>& outV,
     Eigen::PlainObjectBase<DerivedSF>& outF,
     Eigen::PlainObjectBase<DerivedSF>& outF,
@@ -94,7 +94,7 @@ void igl::marching_tets(
     for (int v = 0; v < 4; v++)
     for (int v = 0; v < 4; v++)
     {
     {
       const int vid = TT(i, v);
       const int vid = TT(i, v);
-      const uint8_t flag = isovals[vid] > isovalue;
+      const uint8_t flag = isovals(vid, 0) > isovalue;
       key |= flag << v;
       key |= flag << v;
     }
     }
 
 
@@ -163,8 +163,8 @@ void igl::marching_tets(
         typedef Eigen::Matrix<typename DerivedTV::Scalar, 1, 3, Eigen::RowMajor, 1, 3> RowVector;
         typedef Eigen::Matrix<typename DerivedTV::Scalar, 1, 3, Eigen::RowMajor, 1, 3> RowVector;
         const RowVector v1 = TV.row(edge.first);
         const RowVector v1 = TV.row(edge.first);
         const RowVector v2 = TV.row(edge.second);
         const RowVector v2 = TV.row(edge.second);
-        const double a = fabs(isovals[edge.first] - isovalue);
-        const double b = fabs(isovals[edge.second] - isovalue);
+        const double a = fabs(isovals(edge.first, 0) - isovalue);
+        const double b = fabs(isovals(edge.second, 0) - isovalue);
         const double w = a / (a+b);
         const double w = a / (a+b);
 
 
         // Create a casted copy in case BCType is a float and we need to downcast
         // Create a casted copy in case BCType is a float and we need to downcast
@@ -191,5 +191,5 @@ void igl::marching_tets(
 
 
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
-template void igl::marching_tets<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::Matrix<int, -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&, double, 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::SparseMatrix<double, 0, int>&);
+template void igl::marching_tets<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::Matrix<int, -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&, double, 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::SparseMatrix<double, 0, int>&);
 #endif // IGL_STATIC_LIBRARY
 #endif // IGL_STATIC_LIBRARY

+ 15 - 15
include/igl/marching_tets.h

@@ -40,9 +40,9 @@ namespace igl {
             typename DerivedJ,
             typename DerivedJ,
             typename BCType>
             typename BCType>
   IGL_INLINE void marching_tets(
   IGL_INLINE void marching_tets(
-      const Eigen::PlainObjectBase<DerivedTV>& TV,
-      const Eigen::PlainObjectBase<DerivedTT>& TT,
-      const Eigen::PlainObjectBase<DerivedS>& S,
+      const Eigen::MatrixBase<DerivedTV>& TV,
+      const Eigen::MatrixBase<DerivedTT>& TT,
+      const Eigen::MatrixBase<DerivedS>& S,
       double isovalue,
       double isovalue,
       Eigen::PlainObjectBase<DerivedSV>& SV,
       Eigen::PlainObjectBase<DerivedSV>& SV,
       Eigen::PlainObjectBase<DerivedSF>& SF,
       Eigen::PlainObjectBase<DerivedSF>& SF,
@@ -74,9 +74,9 @@ namespace igl {
             typename DerivedJ,
             typename DerivedJ,
             typename BCType>
             typename BCType>
   IGL_INLINE void marching_tets(
   IGL_INLINE void marching_tets(
-      const Eigen::PlainObjectBase<DerivedTV>& TV,
-      const Eigen::PlainObjectBase<DerivedTT>& TT,
-      const Eigen::PlainObjectBase<DerivedS>& S,
+      const Eigen::MatrixBase<DerivedTV>& TV,
+      const Eigen::MatrixBase<DerivedTT>& TT,
+      const Eigen::MatrixBase<DerivedS>& S,
       Eigen::PlainObjectBase<DerivedSV>& SV,
       Eigen::PlainObjectBase<DerivedSV>& SV,
       Eigen::PlainObjectBase<DerivedSF>& SF,
       Eigen::PlainObjectBase<DerivedSF>& SF,
       Eigen::PlainObjectBase<DerivedJ>& J,
       Eigen::PlainObjectBase<DerivedJ>& J,
@@ -108,9 +108,9 @@ namespace igl {
             typename DerivedSF,
             typename DerivedSF,
             typename DerivedJ>
             typename DerivedJ>
   IGL_INLINE void marching_tets(
   IGL_INLINE void marching_tets(
-      const Eigen::PlainObjectBase<DerivedTV>& TV,
-      const Eigen::PlainObjectBase<DerivedTT>& TT,
-      const Eigen::PlainObjectBase<DerivedS>& S,
+      const Eigen::MatrixBase<DerivedTV>& TV,
+      const Eigen::MatrixBase<DerivedTT>& TT,
+      const Eigen::MatrixBase<DerivedS>& S,
       double isovalue,
       double isovalue,
       Eigen::PlainObjectBase<DerivedSV>& SV,
       Eigen::PlainObjectBase<DerivedSV>& SV,
       Eigen::PlainObjectBase<DerivedSF>& SF,
       Eigen::PlainObjectBase<DerivedSF>& SF,
@@ -143,9 +143,9 @@ namespace igl {
             typename DerivedSF,
             typename DerivedSF,
             typename BCType>
             typename BCType>
   IGL_INLINE void marching_tets(
   IGL_INLINE void marching_tets(
-      const Eigen::PlainObjectBase<DerivedTV>& TV,
-      const Eigen::PlainObjectBase<DerivedTT>& TT,
-      const Eigen::PlainObjectBase<DerivedS>& S,
+      const Eigen::MatrixBase<DerivedTV>& TV,
+      const Eigen::MatrixBase<DerivedTT>& TT,
+      const Eigen::MatrixBase<DerivedS>& S,
       double isovalue,
       double isovalue,
       Eigen::PlainObjectBase<DerivedSV>& SV,
       Eigen::PlainObjectBase<DerivedSV>& SV,
       Eigen::PlainObjectBase<DerivedSF>& SF,
       Eigen::PlainObjectBase<DerivedSF>& SF,
@@ -176,9 +176,9 @@ namespace igl {
             typename DerivedSV,
             typename DerivedSV,
             typename DerivedSF>
             typename DerivedSF>
   IGL_INLINE void marching_tets(
   IGL_INLINE void marching_tets(
-      const Eigen::PlainObjectBase<DerivedTV>& TV,
-      const Eigen::PlainObjectBase<DerivedTT>& TT,
-      const Eigen::PlainObjectBase<DerivedS>& S,
+      const Eigen::MatrixBase<DerivedTV>& TV,
+      const Eigen::MatrixBase<DerivedTT>& TT,
+      const Eigen::MatrixBase<DerivedS>& S,
       double isovalue,
       double isovalue,
       Eigen::PlainObjectBase<DerivedSV>& SV,
       Eigen::PlainObjectBase<DerivedSV>& SV,
       Eigen::PlainObjectBase<DerivedSF>& SF) {
       Eigen::PlainObjectBase<DerivedSF>& SF) {

+ 5 - 5
include/igl/signed_distance.cpp

@@ -148,7 +148,7 @@ IGL_INLINE void igl::signed_distance(
     }
     }
     typename DerivedV::Scalar s=1,sqrd=0;
     typename DerivedV::Scalar s=1,sqrd=0;
     Eigen::Matrix<typename DerivedV::Scalar,1,Eigen::Dynamic>  c;
     Eigen::Matrix<typename DerivedV::Scalar,1,Eigen::Dynamic>  c;
-    RowVector3S c3;
+    Eigen::Matrix<typename DerivedV::Scalar,1,3> c3;
     Eigen::Matrix<typename DerivedV::Scalar,1,2>  c2;
     Eigen::Matrix<typename DerivedV::Scalar,1,2>  c2;
     int i=-1;
     int i=-1;
     // in all cases compute squared unsiged distances
     // in all cases compute squared unsiged distances
@@ -193,15 +193,15 @@ IGL_INLINE void igl::signed_distance(
           dim==3 ?
           dim==3 ?
             pseudonormal_test(V,F,FN,VN,EN,EMAP,q3,i,c3,s,n3):
             pseudonormal_test(V,F,FN,VN,EN,EMAP,q3,i,c3,s,n3):
             pseudonormal_test(V,E,EN,VN,q2,i,c2,s,n2);
             pseudonormal_test(V,E,EN,VN,q2,i,c2,s,n2);
-          Eigen::Matrix<typename DerivedV::Scalar,1,Eigen::Dynamic>  n;
-          (dim==3 ? n = n3 : n = n2);
-          N.row(p) = n;
+          Eigen::Matrix<typename DerivedN::Scalar,1,Eigen::Dynamic>  n;
+          (dim==3 ? n = n3.template cast<typename DerivedN::Scalar>() : n = n2.template cast<typename DerivedN::Scalar>());
+          N.row(p) = n.template cast<typename DerivedN::Scalar>();
           break;
           break;
         }
         }
       }
       }
       I(p) = i;
       I(p) = i;
       S(p) = s*sqrt(sqrd);
       S(p) = s*sqrt(sqrd);
-      C.row(p) = (dim==3 ? c=c3 : c=c2);
+      C.row(p) = (dim==3 ? c=c3 : c=c2).template cast<typename DerivedC::Scalar>();
     }
     }
   }
   }
   ,10000);
   ,10000);

+ 8 - 7
include/igl/voxel_grid.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 "voxel_grid.h"
 #include "voxel_grid.h"
 #include "grid.h"
 #include "grid.h"
@@ -13,7 +13,7 @@ template <
   typename DerivedGV,
   typename DerivedGV,
   typename Derivedside>
   typename Derivedside>
 IGL_INLINE void igl::voxel_grid(
 IGL_INLINE void igl::voxel_grid(
-  const Eigen::AlignedBox<Scalar,3> & box, 
+  const Eigen::AlignedBox<Scalar,3> & box,
   const int in_s,
   const int in_s,
   const int pad_count,
   const int pad_count,
   Eigen::PlainObjectBase<DerivedGV> & GV,
   Eigen::PlainObjectBase<DerivedGV> & GV,
@@ -22,6 +22,7 @@ IGL_INLINE void igl::voxel_grid(
   using namespace Eigen;
   using namespace Eigen;
   using namespace std;
   using namespace std;
   typename DerivedGV::Index si = -1;
   typename DerivedGV::Index si = -1;
+  side.resize(1, 3);
   box.diagonal().maxCoeff(&si);
   box.diagonal().maxCoeff(&si);
   //DerivedGV::Index si = 0;
   //DerivedGV::Index si = 0;
   //assert(si>=0);
   //assert(si>=0);
@@ -45,7 +46,7 @@ IGL_INLINE void igl::voxel_grid(
   // A * (1-p/s) - A * p/s = max-min
   // A * (1-p/s) - A * p/s = max-min
   // A * (1-2p/s) = max-min
   // A * (1-2p/s) = max-min
   // A  = (max-min)/(1-2p/s)
   // A  = (max-min)/(1-2p/s)
-  const Array<Scalar,3,1> ps= 
+  const Array<Scalar,3,1> ps=
     (Scalar)(pad_count)/(side.transpose().template cast<Scalar>().array()-1.);
     (Scalar)(pad_count)/(side.transpose().template cast<Scalar>().array()-1.);
   const Array<Scalar,3,1> A = box.diagonal().array()/(1.0-2.*ps);
   const Array<Scalar,3,1> A = box.diagonal().array()/(1.0-2.*ps);
   //// This would result in an "anamorphic", but perfectly fit grid:
   //// This would result in an "anamorphic", but perfectly fit grid:
@@ -55,7 +56,7 @@ IGL_INLINE void igl::voxel_grid(
   // Instead scale by largest factor and move to match center
   // Instead scale by largest factor and move to match center
   typename Array<Scalar,3,1>::Index ai = -1;
   typename Array<Scalar,3,1>::Index ai = -1;
   Scalar a = A.maxCoeff(&ai);
   Scalar a = A.maxCoeff(&ai);
-  const Array<Scalar,1,3> ratio = 
+  const Array<Scalar,1,3> ratio =
     a*(side.template cast<Scalar>().array()-1.0)/(Scalar)(side(ai)-1.0);
     a*(side.template cast<Scalar>().array()-1.0)/(Scalar)(side(ai)-1.0);
   GV.array().rowwise() *= ratio;
   GV.array().rowwise() *= ratio;
   const Eigen::Matrix<Scalar,1,3> offset = (box.center().transpose()-GV.colwise().mean()).eval();
   const Eigen::Matrix<Scalar,1,3> offset = (box.center().transpose()-GV.colwise().mean()).eval();