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

fixed static build for the tutorials

Former-commit-id: 93c3450eb55583f684e70b4e28401ddfb8f781fa
Daniele Panozzo 10 жил өмнө
parent
commit
f57dd67e59

+ 13 - 8
include/igl/biharmonic_coordinates.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2015 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 
+//
+// 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 "biharmonic_coordinates.h"
 #include "cotmatrix.h"
@@ -42,7 +42,7 @@ IGL_INLINE bool igl::biharmonic_coordinates(
   using namespace Eigen;
   using namespace std;
   // This is not the most efficient way to build A, but follows "Linear
-  // Subspace Design for Real-Time Shape Deformation" [Wang et al. 2015]. 
+  // Subspace Design for Real-Time Shape Deformation" [Wang et al. 2015].
   SparseMatrix<double> A;
   {
     SparseMatrix<double> N,Z,L,K,M;
@@ -75,7 +75,7 @@ IGL_INLINE bool igl::biharmonic_coordinates(
     massmatrix(V,T,MASSMATRIX_TYPE_DEFAULT,M);
     // normalize
     M /= ((VectorXd)M.diagonal()).array().abs().maxCoeff();
-    DiagonalMatrix<double,Dynamic> Minv = 
+    DiagonalMatrix<double,Dynamic> Minv =
       ((VectorXd)M.diagonal().array().inverse()).asDiagonal();
     switch(k)
     {
@@ -92,7 +92,7 @@ IGL_INLINE bool igl::biharmonic_coordinates(
     }
   }
   // Vertices in point handles
-  const size_t mp = 
+  const size_t mp =
     count_if(S.begin(),S.end(),[](const vector<int> & h){return h.size()==1;});
   // number of region handles
   const size_t r = S.size()-mp;
@@ -139,8 +139,13 @@ IGL_INLINE bool igl::biharmonic_coordinates(
       }
     }
   }
-  // minimize    ½ W' A W' 
+  // minimize    ½ W' A W'
   // subject to  W(b,:) = J
   return min_quad_with_fixed(
     A,VectorXd::Zero(A.rows()).eval(),b,J,{},VectorXd(),true,W);
 }
+
+#ifdef IGL_STATIC_LIBRARY
+// Explicit template specialization
+template bool igl::biharmonic_coordinates<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, int, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::__1::vector<std::__1::vector<int, std::__1::allocator<int> >, std::__1::allocator<std::__1::vector<int, std::__1::allocator<int> > > > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+#endif

+ 5 - 0
include/igl/eigs.cpp

@@ -149,3 +149,8 @@ IGL_INLINE bool igl::eigs(
   sU /= sqrt(rescale);
   return true;
 }
+
+#ifdef IGL_STATIC_LIBRARY
+// Explicit template specialization
+template bool igl::eigs<double, double, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::SparseMatrix<double, 0, int> const&, unsigned long, igl::EigsType, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+#endif

+ 2 - 0
include/igl/list_to_matrix.cpp

@@ -167,4 +167,6 @@ template bool igl::list_to_matrix<double, Eigen::PlainObjectBase<Eigen::Matrix<d
 template bool igl::list_to_matrix<double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >(std::vector<double, std::allocator<double> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 template bool igl::list_to_matrix<int, Eigen::Matrix<int, -1, 2, 0, -1, 2> >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::Matrix<int, -1, 2, 0, -1, 2>&);
 template bool igl::list_to_matrix<unsigned long long int,Eigen::PlainObjectBase<Eigen::Matrix<int,-1,1,0,-1,1> > >(std::vector<unsigned long long int,std::allocator<unsigned long long int> > const &,Eigen::PlainObjectBase<Eigen::Matrix<int,-1,1,0,-1,1> > &);
+template bool igl::list_to_matrix<bool, Eigen::PlainObjectBase<Eigen::Array<bool, -1, 1, 0, -1, 1> > >(std::vector<bool, std::allocator<bool> > const&, Eigen::PlainObjectBase<Eigen::Array<bool, -1, 1, 0, -1, 1> >&);
+template bool igl::list_to_matrix<bool, Eigen::PlainObjectBase<Eigen::Array<bool, -1, -1, 0, -1, -1> > >(std::vector<std::vector<bool, std::allocator<bool> >, std::allocator<std::vector<bool, std::allocator<bool> > > > const&, Eigen::PlainObjectBase<Eigen::Array<bool, -1, -1, 0, -1, -1> >&);
 #endif

+ 7 - 6
include/igl/matrix_to_list.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 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 
+//
+// 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 "matrix_to_list.h"
 
@@ -11,7 +11,7 @@
 
 template <typename DerivedM>
 IGL_INLINE void igl::matrix_to_list(
-  const Eigen::MatrixBase<DerivedM> & M, 
+  const Eigen::MatrixBase<DerivedM> & M,
   std::vector<std::vector<typename DerivedM::Scalar > > & V)
 {
   using namespace std;
@@ -29,7 +29,7 @@ IGL_INLINE void igl::matrix_to_list(
 
 template <typename DerivedM>
 IGL_INLINE void igl::matrix_to_list(
-  const Eigen::MatrixBase<DerivedM> & M, 
+  const Eigen::MatrixBase<DerivedM> & M,
   std::vector<typename DerivedM::Scalar > & V)
 {
   using namespace std;
@@ -66,4 +66,5 @@ template void igl::matrix_to_list<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen:
 template void igl::matrix_to_list<Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, std::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1>::Scalar> >&);
 template void igl::matrix_to_list<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Scalar> >&);
 template void igl::matrix_to_list<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> >&);
+template void igl::matrix_to_list<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> >, std::allocator<std::vector<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar, std::allocator<Eigen::Matrix<int, -1, 1, 0, -1, 1>::Scalar> > > >&);
 #endif

+ 13 - 10
include/igl/min_quad_with_fixed.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 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 
+//
+// 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 "min_quad_with_fixed.h"
 
@@ -107,7 +107,7 @@ IGL_INLINE bool igl::min_quad_with_fixed_precompute(
     data.Auu_sym = true;
     // This is an annoying assertion unless EPS can be chosen in a nicer way.
     //assert(is_symmetric(Auu,EPS<double>()));
-    assert(is_symmetric(Auu,1.0) && 
+    assert(is_symmetric(Auu,1.0) &&
       "Auu should be symmetric if positive definite");
   }else
   {
@@ -127,9 +127,9 @@ IGL_INLINE bool igl::min_quad_with_fixed_precompute(
 #endif
     // QR decomposition to determine row rank in Aequ
     slice(Aeq,data.unknown,2,data.Aequ);
-    assert(data.Aequ.rows() == neq && 
+    assert(data.Aequ.rows() == neq &&
       "#Rows in Aequ should match #constraints");
-    assert(data.Aequ.cols() == data.unknown.size() && 
+    assert(data.Aequ.cols() == data.unknown.size() &&
       "#cols in Aequ should match #unknowns");
     data.AeqTQR.compute(data.Aequ.transpose().eval());
 #ifdef MIN_QUAD_WITH_FIXED_CPP_DEBUG
@@ -150,7 +150,7 @@ IGL_INLINE bool igl::min_quad_with_fixed_precompute(
         return false;
     }
     nc = data.AeqTQR.rank();
-    assert(nc<=neq && 
+    assert(nc<=neq &&
       "Rank of reduced constraints should be <= #original constraints");
     data.Aeq_li = nc == neq;
     //cout<<"data.Aeq_li: "<<data.Aeq_li<<endl;
@@ -467,7 +467,7 @@ IGL_INLINE bool igl::min_quad_with_fixed_solve(
     assert(data.solver_type == min_quad_with_fixed_data<T>::QR_LLT);
     PlainObjectBase<DerivedBeq> eff_Beq;
     // Adjust Aeq rhs to include known parts
-    eff_Beq = 
+    eff_Beq =
       //data.AeqTQR.colsPermutation().transpose() * (-data.Aeqk * Y + Beq);
       data.AeqTET * (-data.Aeqk * Y + Beq);
     // Where did this -0.5 come from? Probably the same place as above.
@@ -571,5 +571,8 @@ template bool igl::min_quad_with_fixed_solve<double, Eigen::Matrix<double, -1, 1
 template bool igl::min_quad_with_fixed_precompute<double, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::SparseMatrix<double, 0, int> const&, bool, igl::min_quad_with_fixed_data<double>&);
 template bool igl::min_quad_with_fixed_solve<double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(igl::min_quad_with_fixed_data<double> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 template bool igl::min_quad_with_fixed_solve<double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(igl::min_quad_with_fixed_data<double> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::min_quad_with_fixed_solve<double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(igl::min_quad_with_fixed_data<double> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+template  bool igl::min_quad_with_fixed_solve<double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(igl::min_quad_with_fixed_data<double> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::min_quad_with_fixed_solve<double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(igl::min_quad_with_fixed_data<double> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::min_quad_with_fixed<double, 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<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<double, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif
-

+ 17 - 13
include/igl/normal_derivative.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2015 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 
+//
+// 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 "normal_derivative.h"
 #include "cotmatrix_entries.h"
@@ -11,8 +11,8 @@
 #include <cassert>
 
 template <
-  typename DerivedV, 
-  typename DerivedEle, 
+  typename DerivedV,
+  typename DerivedEle,
   typename Scalar>
 IGL_INLINE void igl::normal_derivative(
   const Eigen::PlainObjectBase<DerivedV> & V,
@@ -21,7 +21,7 @@ IGL_INLINE void igl::normal_derivative(
 {
   using namespace Eigen;
   using namespace std;
-  // Element simplex-size 
+  // Element simplex-size
   const size_t ss = Ele.cols();
   assert( ((ss==3) || (ss==4)) && "Only triangles or tets");
   // cotangents
@@ -39,7 +39,7 @@ IGL_INLINE void igl::normal_derivative(
       return;
     case 4:
     {
-      const MatrixXi DDJ = 
+      const MatrixXi DDJ =
         slice(
           Ele,
           (VectorXi(24)<<
@@ -54,9 +54,9 @@ IGL_INLINE void igl::normal_derivative(
           DDI.col(f*6+r) = I;
         }
       }
-      const DiagonalMatrix<Scalar,24,24> S = 
+      const DiagonalMatrix<Scalar,24,24> S =
         (Matrix<Scalar,2,1>(1,-1).template replicate<12,1>()).asDiagonal();
-      Matrix<Scalar,Dynamic,Dynamic> DDV = 
+      Matrix<Scalar,Dynamic,Dynamic> DDV =
         slice(
           C,
           (VectorXi(24)<<
@@ -78,7 +78,7 @@ IGL_INLINE void igl::normal_derivative(
     }
     case 3:
     {
-      const MatrixXi DDJ = 
+      const MatrixXi DDJ =
         slice(Ele,(VectorXi(12)<<2,0,1,0,0,1,2,1,1,2,0,2).finished(),2);
       MatrixXi DDI(m,12);
       for(size_t f = 0;f<3;f++)
@@ -89,9 +89,9 @@ IGL_INLINE void igl::normal_derivative(
           DDI.col(f*4+r) = I;
         }
       }
-      const DiagonalMatrix<Scalar,12,12> S = 
+      const DiagonalMatrix<Scalar,12,12> S =
         (Matrix<Scalar,2,1>(1,-1).template replicate<6,1>()).asDiagonal();
-      Matrix<Scalar,Dynamic,Dynamic> DDV = 
+      Matrix<Scalar,Dynamic,Dynamic> DDV =
         slice(C,(VectorXi(12)<<1,1,2,2,2,2,0,0,0,0,1,1).finished(),2);
       DDV *= S;
 
@@ -111,3 +111,7 @@ IGL_INLINE void igl::normal_derivative(
 
 }
 
+#ifdef IGL_STATIC_LIBRARY
+// Explicit template specialization
+template void igl::normal_derivative<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<double, 0, int>&);
+#endif

+ 5 - 6
include/igl/on_boundary.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 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 
+//
+// 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 "on_boundary.h"
 
@@ -137,6 +137,5 @@ IGL_INLINE void igl::on_boundary(
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
 template void igl::on_boundary<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::on_boundary<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Array<bool, -1, 1, 0, -1, 1>, Eigen::Array<bool, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Array<bool, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Array<bool, -1, -1, 0, -1, -1> >&);
 #endif
-
-

+ 9 - 1
include/igl/slice.cpp

@@ -80,7 +80,7 @@ IGL_INLINE void igl::slice(
   // handled here (although it's not clear if there is a performance gain when
   // the #removals >> #remains). If this is sufficiently faster than the
   // correct code above, one could test whether all entries in R and C are
-  // unique and apply the permutation version if appropriate. 
+  // unique and apply the permutation version if appropriate.
   //
 
   int xm = X.rows();
@@ -249,4 +249,12 @@ template Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > igl::sl
 template Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > igl::slice<Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
 template Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> > igl::slice<Eigen::Matrix<double, 1, -1, 1, 1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
 template Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > igl::slice<Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
+template void igl::slice<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::slice<Eigen::SparseMatrix<double, 0, int>, Eigen::SparseMatrix<double, 0, int> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int, Eigen::SparseMatrix<double, 0, int>&);
+template void igl::slice<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+template void igl::slice<Eigen::Matrix<float, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&);
+template void igl::slice<std::complex<double>, std::complex<double> >(Eigen::SparseMatrix<std::complex<double>, 0, int> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::SparseMatrix<std::complex<double>, 0, int>&);
+template void igl::slice<Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::slice<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int, Eigen::Matrix<double, -1, -1, 0, -1, -1>&);
+template Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > igl::slice<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
 #endif

+ 8 - 8
include/igl/snap_to_canonical_view_quat.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 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 
+//
+// 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 "snap_to_canonical_view_quat.h"
 
@@ -36,7 +36,7 @@ IGL_INLINE bool igl::snap_to_canonical_view_quat(
 
   // Normalize input quaternion
   Q_type qn[4];
-  bool valid_len = 
+  bool valid_len =
     igl::normalize_quat(q,qn);
   // If normalizing valid then don't bother
   if(!valid_len)
@@ -59,7 +59,7 @@ IGL_INLINE bool igl::snap_to_canonical_view_quat(
       for(int j = 0;j<4;j++)
       {
         // Double cast because of bug in llvm version 4.2 with -O3
-        distance += 
+        distance +=
           (qn[j]-sign*igl::CANONICAL_VIEW_QUAT<Q_type>(i,j))*
           (qn[j]-sign*igl::CANONICAL_VIEW_QUAT<Q_type>(i,j));
       }
@@ -102,7 +102,7 @@ IGL_INLINE bool igl::snap_to_canonical_view_quat(
   const double threshold,
   Eigen::Quaternion<Scalars> & s)
 {
-  return snap_to_canonical_view_quat<Scalars>( 
+  return snap_to_canonical_view_quat<Scalars>(
     q.coeffs().data(),threshold,s.coeffs().data());
 }
 
@@ -112,5 +112,5 @@ IGL_INLINE bool igl::snap_to_canonical_view_quat(
 template bool igl::snap_to_canonical_view_quat<double>(const double*, double, double*);
 // generated by autoexplicit.sh
 template bool igl::snap_to_canonical_view_quat<float>(const float*, float, float*);
+template bool igl::snap_to_canonical_view_quat<float, float>(Eigen::Quaternion<float, 0> const&, double, Eigen::Quaternion<float, 0>&);
 #endif
-

+ 7 - 6
include/igl/trackball.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 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 
+//
+// 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 "trackball.h"
 
@@ -52,9 +52,9 @@ IGL_INLINE void igl::trackball(
 {
   assert(speed_factor > 0);
 
-  double original_x = 
+  double original_x =
     _QuatIX<Q_type>(speed_factor*(down_mouse_x-w/2)+w/2, w, h);
-  double original_y = 
+  double original_y =
     _QuatIY<Q_type>(speed_factor*(down_mouse_y-h/2)+h/2, w, h);
 
   double x = _QuatIX<Q_type>(speed_factor*(mouse_x-w/2)+w/2, w, h);
@@ -163,4 +163,5 @@ IGL_INLINE void igl::trackball(
 template void igl::trackball<double>(double, double, double, double const*, double, double, double, double, double*);
 // generated by autoexplicit.sh
 template void igl::trackball<float>(double, double, float, float const*, double, double, double, double, float*);
+template void igl::trackball<float, float>(double, double, double, Eigen::Quaternion<float, 0> const&, double, double, double, double, Eigen::Quaternion<float, 0>&);
 #endif

+ 12 - 6
include/igl/two_axis_valuator_fixed_up.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 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 
+//
+// 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 "two_axis_valuator_fixed_up.h"
 #include "PI.h"
@@ -22,7 +22,7 @@ IGL_INLINE void igl::two_axis_valuator_fixed_up(
 {
   using namespace Eigen;
   Matrix<Scalarquat,3,1> axis(0,1,0);
-  quat = down_quat * 
+  quat = down_quat *
     Quaternion<Scalarquat>(
       AngleAxis<Scalarquat>(
         PI*((Scalarquat)(mouse_x-down_x))/(Scalarquat)w*speed/2.0,
@@ -32,7 +32,7 @@ IGL_INLINE void igl::two_axis_valuator_fixed_up(
     Matrix<Scalarquat,3,1> axis(1,0,0);
     if(axis.norm() != 0)
     {
-      quat = 
+      quat =
         Quaternion<Scalarquat>(
           AngleAxis<Scalarquat>(
             PI*(mouse_y-down_y)/(Scalarquat)h*speed/2.0,
@@ -42,3 +42,9 @@ IGL_INLINE void igl::two_axis_valuator_fixed_up(
   }
 }
 
+#ifdef IGL_STATIC_LIBRARY
+// Explicit template specialization
+
+template void igl::two_axis_valuator_fixed_up<float, float>(int, int, double, Eigen::Quaternion<float, 0> const&, int, int, int, int, Eigen::Quaternion<float, 0>&);
+
+#endif

+ 3 - 1
tutorial/106_ViewerMenu/main.cpp

@@ -1,5 +1,7 @@
 #include <igl/readOFF.h>
 #include <igl/viewer/Viewer.h>
+#include <nanogui/formscreen.h>
+#include <iostream>
 
 Eigen::MatrixXd V;
 Eigen::MatrixXi F;
@@ -32,7 +34,7 @@ int main(int argc, char *argv[])
     },"bool",true);
 
     // Add a button
-    viewer.ngui->addButton("Print Hello",[](){ cout << "Hello\n"; });
+    viewer.ngui->addButton("Print Hello",[](){ std::cout << "Hello\n"; });
 
     // Add an additional bar
     viewer.ngui->addNewWindow(Eigen::Vector2i(220,10),"New Window");

+ 3 - 2
tutorial/306_EigenDecomposition/main.cpp

@@ -3,6 +3,7 @@
 #include <igl/massmatrix.h>
 #include <igl/Viewer/viewer.h>
 #include <igl/parula.h>
+#include <igl/read_triangle_mesh.h>
 #include <Eigen/Sparse>
 #include <iostream>
 #include <queue>
@@ -40,13 +41,13 @@ int main(int argc, char * argv[])
   {
     switch(key)
     {
-      default: 
+      default:
         return false;
       case ' ':
       {
         U = U.rightCols(k).eval();
         // Rescale eigen vectors for visualization
-        VectorXd Z = 
+        VectorXd Z =
           bbd*0.5*U.col(c);
         Eigen::MatrixXd C;
         igl::parula(U.col(c).eval(),false,C);

+ 4 - 3
tutorial/609_Boolean/main.cpp

@@ -1,5 +1,6 @@
 #include <igl/readOFF.h>
 #define IGL_NO_CORK
+#undef IGL_STATIC_LIBRARY
 #include <igl/boolean/mesh_boolean.h>
 #include <igl/viewer/Viewer.h>
 
@@ -12,7 +13,7 @@ Eigen::MatrixXi FA,FB,FC;
 igl::boolean::MeshBooleanType boolean_type(
   igl::boolean::MESH_BOOLEAN_TYPE_UNION);
 
-const char * MESH_BOOLEAN_TYPE_NAMES[] = 
+const char * MESH_BOOLEAN_TYPE_NAMES[] =
 {
   "Union",
   "Intersect",
@@ -47,12 +48,12 @@ bool key_down(igl::viewer::Viewer &viewer, unsigned char key, int mods)
     default:
       return false;
     case '.':
-      boolean_type = 
+      boolean_type =
         static_cast<igl::boolean::MeshBooleanType>(
           (boolean_type+1)% igl::boolean::NUM_MESH_BOOLEAN_TYPES);
       break;
     case ',':
-      boolean_type = 
+      boolean_type =
         static_cast<igl::boolean::MeshBooleanType>(
           (boolean_type+igl::boolean::NUM_MESH_BOOLEAN_TYPES-1)%
           igl::boolean::NUM_MESH_BOOLEAN_TYPES);