Browse Source

fix for static lib linux

Former-commit-id: 9cfc45c4be4653048ba00349f03270ac77e763e2
Daniele Panozzo 10 years ago
parent
commit
dbf96d55aa
2 changed files with 17 additions and 12 deletions
  1. 4 4
      include/igl/polar_svd.cpp
  2. 13 8
      include/igl/polar_svd3x3.cpp

+ 4 - 4
include/igl/polar_svd.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 "polar_svd.h"
 #include <Eigen/SVD>

+ 13 - 8
include/igl/polar_svd3x3.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 "polar_svd3x3.h"
 #include "svd3x3.h"
@@ -21,7 +21,7 @@ IGL_INLINE void igl::polar_svd3x3(const Mat& A, Mat& R)
   assert(A.rows() == 3 && A.cols() == 3);
 
   Eigen::Matrix<typename Mat::Scalar, 3, 3> U, Vt;
-  Eigen::Matrix<typename Mat::Scalar, 3, 1> S;  
+  Eigen::Matrix<typename Mat::Scalar, 3, 1> S;
   svd3x3(A, U, S, Vt);
   R = U * Vt.transpose();
 }
@@ -34,7 +34,7 @@ IGL_INLINE void igl::polar_svd3x3_sse(const Eigen::Matrix<T, 3*4, 3>& A, Eigen::
   assert(A.rows() == 3*4 && A.cols() == 3);
 
   Eigen::Matrix<T, 3*4, 3> U, Vt;
-  Eigen::Matrix<T, 3*4, 1> S;  
+  Eigen::Matrix<T, 3*4, 1> S;
   svd3x3_sse(A, U, S, Vt);
 
   for (int k=0; k<4; k++)
@@ -67,7 +67,7 @@ IGL_INLINE void igl::polar_svd3x3_avx(const Eigen::Matrix<T, 3*8, 3>& A, Eigen::
   assert(A.rows() == 3*8 && A.cols() == 3);
 
   Eigen::Matrix<T, 3*8, 3> U, Vt;
-  Eigen::Matrix<T, 3*8, 1> S;  
+  Eigen::Matrix<T, 3*8, 1> S;
   svd3x3_avx(A, U, S, Vt);
 
   for (int k=0; k<8; k++)
@@ -85,7 +85,7 @@ IGL_INLINE void igl::polar_svd3x3_avx(const Eigen::Matrix<T, 3*8, 3>& A, Eigen::
     Eigen::Matrix3f Rpart_SSE = R.block(3*k, 0, 3, 3);
     Eigen::Matrix3f diff = Rpart - Rpart_SSE;
     float diffNorm = diff.norm();
-    if (abs(diffNorm) > 0.001) 
+    if (abs(diffNorm) > 0.001)
     {
       printf("Huh: diffNorm = %15f (k = %i)\n", diffNorm, k);
     }
@@ -105,4 +105,9 @@ template void igl::polar_svd3x3<Eigen::Matrix<float,3,3,0,3,3> >(Eigen::Matrix<f
 #ifdef __SSE__
 template void igl::polar_svd3x3_sse<float>(Eigen::Matrix<float, 12, 3, 0, 12, 3> const&, Eigen::Matrix<float, 12, 3, 0, 12, 3>&);
 #endif
+
+#ifdef __AVX__
+template void igl::polar_svd3x3_avx<float>(Eigen::Matrix<float, 24, 3, 0, 24, 3> const&, Eigen::Matrix<float, 24, 3, 0, 24, 3>&);
+#endif
+
 #endif