Przeglądaj źródła

Some further cleanups for MIQ (#998)

* Cleanups: unified arguments' names, variable types, unused variables removed, initialization of fileds. Many Clang-tidy hints have been applied, etc.

* ints should be unsigned

* changes overlooked duing refactorization

* changes overlooked duing refactorization

* changes overlooked duing refactorization

* changes overlooked duing refactorization

* changes overlooked duing refactorization and suggestions from @jdumas

* remove unneeded var.

* indents

* extract a constant

* a name changed
Kacper Pluta 6 lat temu
rodzic
commit
48ac6aa0b5

+ 191 - 178
include/igl/copyleft/comiso/miq.cpp

@@ -51,23 +51,28 @@ namespace comiso {
   struct SeamInfo
   {
     int v0,v0p;
-    int integerVar;
-    unsigned char MMatch;
+    unsigned int integerVar;
+    int mismatch;
 
     IGL_INLINE SeamInfo(int _v0,
                         int _v0p,
-                        int _MMatch,
-                        int _integerVar);
+                        int _mismatch,
+                        unsigned int _integerVar);
 
     IGL_INLINE SeamInfo(const SeamInfo &S1);
   };
 
   struct MeshSystemInfo
   {
+    MeshSystemInfo()
+    {
+      num_vert_variables = 0;
+      num_integer_cuts = 0;
+    }
     ////number of vertices variables
-    int num_vert_variables;
+    unsigned int num_vert_variables;
     ///num of integer for cuts
-    int num_integer_cuts;
+    unsigned int num_integer_cuts;
     ///this are used for drawing purposes
     std::vector<SeamInfo> edgeSeamInfo;
   };
@@ -120,12 +125,12 @@ namespace comiso {
       }
     };
 
-    IGL_INLINE void getSeamInfo(const int f0,
-                                const int f1,
-                                const int indexE,
+    IGL_INLINE void getSeamInfo(int f0,
+                                int f1,
+                                int indexE,
                                 int &v0, int &v1,
                                 int &v0p, int &v1p,
-                                unsigned char &_mismatch);
+                                int &_mismatch);
 
     IGL_INLINE std::vector<std::vector<VertexInfo> > getVerticesPerSeam();
   };
@@ -134,17 +139,21 @@ namespace comiso {
   template <typename DerivedV, typename DerivedF>
   class PoissonSolver
   {
+  private:
+
+    // Penalization term for integer variables used in mixedIntegerSolve
+    const double PENALIZATION = 0.000001;
 
   public:
-    IGL_INLINE void solvePoisson(Eigen::VectorXd Stiffness,
-                                 double gredientSize = 0.1,
-                                 double grid_res = 1.,
-                                 bool direct_round = true,
-                                 int localIter = 0,
-                                 bool _doRound = true,
-                                 bool _singularity_rounding = true,
-                                 std::vector<int> roundVertices = std::vector<int>(),
-                                 std::vector<std::vector<int> > hardFeatures = std::vector<std::vector<int> >());
+    IGL_INLINE void solvePoisson(Eigen::VectorXd stiffness,
+                                 double gradientSize = 0.1,
+                                 double gridResolution = 1.,
+                                 bool directRound = true,
+                                 unsigned int localIter = 0,
+                                 bool doRound = true,
+                                 bool singularityRound = true,
+                                 const std::vector<int> &roundVertices = std::vector<int>(),
+                                 const std::vector<std::vector<int>> &hardFeatures = std::vector<std::vector<int> >());
 
     IGL_INLINE PoissonSolver(const Eigen::PlainObjectBase<DerivedV> &_V,
                              const Eigen::PlainObjectBase<DerivedF> &_F,
@@ -154,8 +163,8 @@ namespace comiso {
                              const Eigen::PlainObjectBase<DerivedF> &_TTi,
                              const Eigen::PlainObjectBase<DerivedV> &_PD1,
                              const Eigen::PlainObjectBase<DerivedV> &_PD2,
-                             const Eigen::Matrix<int, Eigen::Dynamic, 1>&_Handle_Singular,
-                             const MeshSystemInfo &_Handle_SystemInfo
+                             const Eigen::Matrix<int, Eigen::Dynamic, 1>&_singular,
+                             const MeshSystemInfo &_systemInfo
                              );
 
     const Eigen::PlainObjectBase<DerivedV> &V;
@@ -282,9 +291,9 @@ namespace comiso {
     IGL_INLINE void buildUserDefinedConstraints();
 
     ///call of the mixed integer solver
-    IGL_INLINE void mixedIntegerSolve(double cone_grid_res = 1,
-                                      bool direct_round = true,
-                                      int localIter = 0);
+    IGL_INLINE void mixedIntegerSolve(double coneGridRes = 1,
+                                      bool directRound = true,
+                                      unsigned int localIter = 0);
 
     IGL_INLINE void clearUserConstraint();
 
@@ -308,7 +317,7 @@ namespace comiso {
     DerivedF TTi;
 
     // Stiffness per face
-    Eigen::VectorXd Handle_Stiffness;
+    Eigen::VectorXd stiffnessVector;
     DerivedV B1, B2, B3;
 
   public:
@@ -316,18 +325,18 @@ namespace comiso {
                          const Eigen::PlainObjectBase<DerivedF> &F_,
                          const Eigen::PlainObjectBase<DerivedV> &PD1_combed,
                          const Eigen::PlainObjectBase<DerivedV> &PD2_combed,
-                         const Eigen::Matrix<int, Eigen::Dynamic, 3> &Handle_MMatch,
-                         const Eigen::Matrix<int, Eigen::Dynamic, 1> &Handle_Singular,
-                         const Eigen::Matrix<int, Eigen::Dynamic, 3> &Handle_Seams,
+                         const Eigen::Matrix<int, Eigen::Dynamic, 3> &mismatch,
+                         const Eigen::Matrix<int, Eigen::Dynamic, 1> &singular,
+                         const Eigen::Matrix<int, Eigen::Dynamic, 3> &seams,
                          Eigen::PlainObjectBase<DerivedU> &UV,
                          Eigen::PlainObjectBase<DerivedF> &FUV,
-                         double GradientSize = 30.0,
-                         double Stiffness = 5.0,
-                         bool DirectRound = false,
-                         int iter = 5,
-                         int localIter = 5,
-                         bool DoRound = true,
-                         bool SingularityRound = true,
+                         double gradientSize = 30.0,
+                         double stiffness = 5.0,
+                         bool directRound = false,
+                         unsigned int iter = 5,
+                         unsigned int localIter = 5,
+                         bool doRound = true,
+                         bool singularityRound = true,
                          std::vector<int> roundVertices = std::vector<int>(),
                          std::vector<std::vector<int> > hardFeatures = std::vector<std::vector<int> >());
 
@@ -340,7 +349,7 @@ namespace comiso {
 
     IGL_INLINE double Distortion(int f, double h, const Eigen::MatrixXd& WUV);
 
-    IGL_INLINE double LaplaceDistortion(const int f, double h, const Eigen::MatrixXd& WUV);
+    IGL_INLINE double LaplaceDistortion(int f, double h, const Eigen::MatrixXd& WUV);
 
     IGL_INLINE bool updateStiffeningJacobianDistorsion(double grad_size, const Eigen::MatrixXd& WUV);
 
@@ -348,7 +357,7 @@ namespace comiso {
                               const Eigen::Vector2d &uv1,
                               const Eigen::Vector2d &uv2);
 
-    IGL_INLINE bool IsFlipped(const int i, const Eigen::MatrixXd& WUV);
+    IGL_INLINE bool IsFlipped(int i, const Eigen::MatrixXd& WUV);
 
   };
 };
@@ -356,14 +365,14 @@ namespace comiso {
 }
 
 IGL_INLINE igl::copyleft::comiso::SeamInfo::SeamInfo(int _v0,
-                                   int _v0p,
-                                   int _MMatch,
-                                   int _integerVar)
+                                                     int _v0p,
+                                                     int _mismatch,
+                                                     unsigned int _integerVar)
 {
   v0=_v0;
   v0p=_v0p;
   integerVar=_integerVar;
-  MMatch=_MMatch;
+  mismatch=_mismatch;
 }
 
 IGL_INLINE igl::copyleft::comiso::SeamInfo::SeamInfo(const SeamInfo &S1)
@@ -371,7 +380,7 @@ IGL_INLINE igl::copyleft::comiso::SeamInfo::SeamInfo(const SeamInfo &S1)
   v0=S1.v0;
   v0p=S1.v0p;
   integerVar=S1.integerVar;
-  MMatch=S1.MMatch;
+  mismatch=S1.mismatch;
 }
 
 
@@ -382,9 +391,9 @@ IGL_INLINE igl::copyleft::comiso::VertexIndexing<DerivedV, DerivedF>::VertexInde
                                                                    const Eigen::PlainObjectBase<DerivedF> &_Fcut,
                                                                    const Eigen::PlainObjectBase<DerivedF> &_TT,
                                                                    const Eigen::PlainObjectBase<DerivedF> &_TTi,
-                                                                   const Eigen::Matrix<int, Eigen::Dynamic, 3> &_Handle_MMatch,
-                                                                   const Eigen::Matrix<int, Eigen::Dynamic, 1> &_Handle_Singular,
-                                                                   const Eigen::Matrix<int, Eigen::Dynamic, 3> &_Handle_Seams
+                                                                   const Eigen::Matrix<int, Eigen::Dynamic, 3> &_mismatch,
+                                                                   const Eigen::Matrix<int, Eigen::Dynamic, 1> &_singular,
+                                                                   const Eigen::Matrix<int, Eigen::Dynamic, 3> &_seams
                                                                    ):
 V(_V),
 F(_F),
@@ -392,9 +401,9 @@ Vcut(_Vcut),
 Fcut(_Fcut),
 TT(_TT),
 TTi(_TTi),
-mismatch(_Handle_MMatch),
-singular(_Handle_Singular),
-seams(_Handle_Seams)
+mismatch(_mismatch),
+singular(_singular),
+seams(_seams)
 {
   #ifdef DEBUG_PRINT
   cerr<<igl::matlab_format(Handle_Seams,"Handle_Seams");
@@ -410,7 +419,7 @@ IGL_INLINE void igl::copyleft::comiso::VertexIndexing<DerivedV, DerivedF>::getSe
                                                                                        const int indexE,
                                                                                        int &v0, int &v1,
                                                                                        int &v0p, int &v1p,
-                                                                                       unsigned char &_mismatch)
+                                                                                       int &_mismatch)
 {
   int edgef0 = indexE;
   v0 = Fcut(f0,edgef0);
@@ -444,8 +453,7 @@ IGL_INLINE std::vector<std::vector<typename igl::copyleft::comiso::VertexIndexin
       if(f1 == -1)
         continue;
 
-      bool seam = seams(f0,k0);
-      if (seam && F_hit(f0,k0) == 0)
+      if (seams(f0, k0) != 0 && F_hit(f0,k0) == 0)
       {
         int v0 = F(f0, k0);
         int v1 = F(f0, (k0+1)%3);
@@ -465,7 +473,7 @@ IGL_INLINE std::vector<std::vector<typename igl::copyleft::comiso::VertexIndexin
   {
     isStartVertex[i] = false;
     // vertices with two neighbors are regular vertices, unless the vertex is a singularity, in which case it qualifies as a start vertex
-    if (VVSeam[i].size() > 0 && VVSeam[i].size() != 2 || singular(i) == true)
+    if ((!VVSeam[i].empty() && VVSeam[i].size() != 2) || singular(i) != 0)
     {
       startVertexIndices.push_back(i);
       isStartVertex[i] = true;
@@ -473,20 +481,20 @@ IGL_INLINE std::vector<std::vector<typename igl::copyleft::comiso::VertexIndexin
   }
 
   // For each startVertex, walk along its seam
-  for (unsigned int i=0;i<startVertexIndices.size();i++)
+  for (auto element : startVertexIndices)
   {
-    auto startVertexNeighbors = &VVSeam[startVertexIndices[i]];
-    const int neighborSize = startVertexNeighbors->size();
+    auto startVertexNeighbors = &VVSeam[element];
+    size_t neighborSize = startVertexNeighbors->size();
 
     // explore every seam to which this vertex is a start vertex
     // note: a vertex can never be a start vertex and a regular vertex simultaneously
-    for (unsigned int j=0;j<neighborSize;j++)
+    for (size_t j = 0; j < neighborSize; j++)
     {
       std::vector<VertexInfo> thisSeam; // temporary container
 
       // Create vertexInfo struct for start vertex
-      auto startVertex = VertexInfo(startVertexIndices[i], -1, -1, -1, -1);// -1 values are arbitrary (will never be used)
-      auto currentVertex = startVertex;
+      VertexInfo startVertex = VertexInfo(element, -1, -1, -1, -1);// -1 values are arbitrary (will never be used)
+      VertexInfo currentVertex = startVertex;
       // Add start vertex to the seam
       thisSeam.push_back(currentVertex);
 
@@ -495,7 +503,8 @@ IGL_INLINE std::vector<std::vector<typename igl::copyleft::comiso::VertexIndexin
       auto nextVertex = currentVertexNeighbors->front();
       currentVertexNeighbors->pop_front();
 
-      auto prevVertex = startVertex; // bogus initialization to get the type
+      // bogus initialization due to lack of def. constructor
+      VertexInfo prevVertex = startVertex;
       while (true)
       {
         // move to the next vertex
@@ -531,7 +540,7 @@ IGL_INLINE void igl::copyleft::comiso::VertexIndexing<DerivedV, DerivedF>::initS
 {
   auto verticesPerSeam = getVerticesPerSeam();
   systemInfo.edgeSeamInfo.clear();
-  int integerVar = 0;
+  unsigned int integerVar = 0;
   // Loop over each seam
   for(auto seam : verticesPerSeam){
     //choose initial side of the seam such that the start vertex corresponds to Fcut(f, k) and the end vertex corresponds to Fcut(f, (k+1)%3) and not vice versa.
@@ -556,19 +565,19 @@ IGL_INLINE void igl::copyleft::comiso::VertexIndexing<DerivedV, DerivedF>::initS
     for(auto it=seam.begin()+1; it != seam.end(); ++it){
       auto vertex = *it;
       // choose the correct side of the seam
-      int f,k,ff,kk;
+      int f,k,ff;
       if(priorVertexIdx == Fcut(vertex.f0, vertex.k0)){
         f = vertex.f0; ff = vertex.f1;
-        k = vertex.k0; kk = vertex.k1;
+        k = vertex.k0;
       }
       else{
         f = vertex.f1; ff = vertex.f0;
-        k = vertex.k1; kk = vertex.k0;
+        k = vertex.k1;
         assert(priorVertexIdx == Fcut(vertex.f1, vertex.k1));
       }
 
       int vtx0,vtx0p,vtx1,vtx1p;
-      unsigned char MM;
+      int MM;
       getSeamInfo(f, ff, k, vtx0, vtx1, vtx0p, vtx1p, MM);
       systemInfo.edgeSeamInfo.push_back(SeamInfo(vtx0,vtx0p,MM,integerVar));
       if(it == seam.end() -1){
@@ -583,7 +592,7 @@ IGL_INLINE void igl::copyleft::comiso::VertexIndexing<DerivedV, DerivedF>::initS
 
 #ifndef NDEBUG
   int totalNVerticesOnSeams = 0;
-  for(auto seam : verticesPerSeam){
+  for(auto const & seam : verticesPerSeam){
     totalNVerticesOnSeams += seam.size();
   }
   assert(systemInfo.edgeSeamInfo.size() == totalNVerticesOnSeams);
@@ -593,17 +602,17 @@ IGL_INLINE void igl::copyleft::comiso::VertexIndexing<DerivedV, DerivedF>::initS
 
 
 template <typename DerivedV, typename DerivedF>
-IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::solvePoisson(Eigen::VectorXd Stiffness,
-                                                                     double gradientSize,
-                                                                     double gridResolution,
-                                                                     bool directRound,
-                                                                     int localIter,
-                                                                     bool doRound,
-                                                                     bool singularityRound,
-                                                                     std::vector<int> roundVertices,
-                                                                     std::vector<std::vector<int> > hardFeatures)
+IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::solvePoisson(Eigen::VectorXd stiffness,
+                                                                                       double gradientSize,
+                                                                                       double gridResolution,
+                                                                                       bool directRound,
+                                                                                       unsigned int localIter,
+                                                                                       bool doRound,
+                                                                                       bool singularityRound,
+                                                                                       const std::vector<int> &roundVertices,
+                                                                                       const std::vector<std::vector<int>> &hardFeatures)
 {
-  Handle_Stiffness = Stiffness;
+  Handle_Stiffness = stiffness;
 
   //initialization of flags and data structures
   integer_rounding=doRound;
@@ -612,9 +621,9 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::solveP
 
   clearUserConstraint();
   // copy the user constraints number
-  for (size_t i = 0; i < hardFeatures.size(); ++i)
+  for (const auto & element : hardFeatures)
   {
-    addSharpEdgeConstraint(hardFeatures[i][0],hardFeatures[i][1]);
+    addSharpEdgeConstraint(element[0], element[1]);
   }
 
   ///Initializing Matrix
@@ -647,19 +656,19 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::solveP
     addSingularityRound();
 
   clock_t t1 = clock();
-  if (DEBUGPRINT) printf("\n time:%d \n",t1-t0);
+  if (DEBUGPRINT) printf("\n time:%ld \n",t1-t0);
   if (DEBUGPRINT) printf("\n SOLVING \n");
 
   mixedIntegerSolve(gridResolution, directRound, localIter);
 
   clock_t t2 = clock();
-  if (DEBUGPRINT) printf("\n time:%d \n",t2-t1);
+  if (DEBUGPRINT) printf("\n time:%ld \n",t2-t1);
   if (DEBUGPRINT) printf("\n ASSIGNING COORDS \n");
 
   mapCoords();
 
   clock_t t3 = clock();
-  if (DEBUGPRINT) printf("\n time:%d \n",t3-t2);
+  if (DEBUGPRINT) printf("\n time:%ld \n",t3-t2);
   if (DEBUGPRINT) printf("\n FINISHED \n");
 }
 
@@ -687,9 +696,17 @@ PD2(_PD2),
 singular(_singular),
 systemInfo(_systemInfo)
 {
-  UV        = Eigen::MatrixXd(V.rows(),2);
-  WUV       = Eigen::MatrixXd(F.rows(),6);
-  UV_out    = Eigen::MatrixXd(Vcut.rows(),2);
+  n_fixed_vars = 0;
+  n_vert_vars = 0;
+  num_total_vars = 0;
+  n_integer_vars = 0;
+  num_cut_constraint = 0;
+  num_userdefined_constraint = 0;
+  num_constraint_equations = 0;
+  integer_rounding = false;
+  UV = Eigen::MatrixXd(V.rows(),2);
+  WUV = Eigen::MatrixXd(F.rows(),6);
+  UV_out = Eigen::MatrixXd(Vcut.rows(),2);
   igl::vertex_triangle_adjacency(V,F,VF,VFi);
 }
 
@@ -704,10 +721,10 @@ IGL_INLINE std::complex<double> igl::copyleft::comiso::PoissonSolver<DerivedV, D
 
   switch(interval)
   {
-    case 0:return std::complex<double>(1,0);
-    case 1:return std::complex<double>(0,1);
-    case 2:return std::complex<double>(-1,0);
-    default:return std::complex<double>(0,-1);
+    case 0:return {1,0};
+    case 1:return {0,1};
+    case 2: return {-1,0};
+    default:return {0,-1};
   }
 }
 
@@ -781,7 +798,7 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::fixBlo
     int indexvert = index*2;
 
     ///find the first free row to add the constraint
-    int indexRow = (offset_row+constr_num*2);
+    int indexRow = offset_row + constr_num * 2;
     int indexCol = indexRow;
 
     ///add fixing constraint LHS
@@ -817,13 +834,13 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::addSin
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::addToRoundVertices(std::vector<int> ids)
 {
-  for (size_t i = 0; i < ids.size(); ++i)
+  for(auto index : ids)
   {
-    if (ids[i] < 0 || ids[i] >= V.rows())
-      std::cerr << "WARNING: Ignored round vertex constraint, vertex " << ids[i] << " does not exist in the mesh." << std::endl;
-    int index0 = getFirstVertexIndex(ids[i]);
-    ids_to_round.push_back( index0*2   );
-    ids_to_round.push_back((index0*2)+1);
+    if (index < 0 || index >= V.rows())
+      std::cerr << "WARNING: Ignored round vertex constraint, vertex " << index << " does not exist in the mesh." << std::endl;
+    int index0 = getFirstVertexIndex(index);
+    ids_to_round.push_back( index0 * 2   );
+    ids_to_round.push_back((index0 * 2)+1);
   }
 }
 
@@ -889,19 +906,19 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::findSi
   ///initialize matrix size
 
   if (DEBUGPRINT)     printf("\n*** SYSTEM VARIABLES *** \n");
-  if (DEBUGPRINT)     printf("* NUM REAL VERTEX VARIABLES %d \n",n_vert_vars);
+  if (DEBUGPRINT)     printf("* NUM REAL VERTEX VARIABLES %ud \n",n_vert_vars);
 
   if (DEBUGPRINT)     printf("\n*** INTEGER VARIABLES *** \n");
-  if (DEBUGPRINT)     printf("* NUM INTEGER VARIABLES %d \n",(int)n_integer_vars);
+  if (DEBUGPRINT)     printf("* NUM INTEGER VARIABLES %ud \n",n_integer_vars);
 
   if (DEBUGPRINT)     printf("\n*** CONSTRAINTS *** \n ");
-  if (DEBUGPRINT)     printf("* NUM FIXED CONSTRAINTS %d\n",n_fixed_vars);
-  if (DEBUGPRINT)     printf("* NUM CUTS CONSTRAINTS %d\n",num_cut_constraint);
-  if (DEBUGPRINT)     printf("* NUM USER DEFINED CONSTRAINTS %d\n",num_userdefined_constraint);
+  if (DEBUGPRINT)     printf("* NUM FIXED CONSTRAINTS %ud\n",n_fixed_vars);
+  if (DEBUGPRINT)     printf("* NUM CUTS CONSTRAINTS %ud\n",num_cut_constraint);
+  if (DEBUGPRINT)     printf("* NUM USER DEFINED CONSTRAINTS %ud\n",num_userdefined_constraint);
 
   if (DEBUGPRINT)     printf("\n*** TOTAL SIZE *** \n");
-  if (DEBUGPRINT)     printf("* TOTAL VARIABLE SIZE (WITH INTEGER TRASL) %d \n",num_total_vars);
-  if (DEBUGPRINT)     printf("* TOTAL CONSTRAINTS %d \n",num_constraint_equations);
+  if (DEBUGPRINT)     printf("* TOTAL VARIABLE SIZE (WITH INTEGER TRASL) %ud \n",num_total_vars);
+  if (DEBUGPRINT)     printf("* TOTAL CONSTRAINTS %ud \n",num_constraint_equations);
 }
 
 template <typename DerivedV, typename DerivedF>
@@ -912,10 +929,10 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::alloca
   rhs.resize(n_vert_vars * 2);
   constraints_rhs.resize(num_constraint_equations);
 
-  printf("\n INITIALIZED SPARSE MATRIX OF %d x %d \n",n_vert_vars*2, n_vert_vars*2);
-  printf("\n INITIALIZED SPARSE MATRIX OF %d x %d \n",num_constraint_equations, num_total_vars);
-  printf("\n INITIALIZED VECTOR OF %d x 1 \n",n_vert_vars*2);
-  printf("\n INITIALIZED VECTOR OF %d x 1 \n",num_constraint_equations);
+  printf("\n INITIALIZED SPARSE MATRIX OF %ud x %ud \n",n_vert_vars*2, n_vert_vars*2);
+  printf("\n INITIALIZED SPARSE MATRIX OF %ud x %ud \n",num_constraint_equations, num_total_vars);
+  printf("\n INITIALIZED VECTOR OF %ud x 1 \n",n_vert_vars*2);
+  printf("\n INITIALIZED VECTOR OF %ud x 1 \n",num_constraint_equations);
 }
 
 ///intitialize the whole matrix
@@ -949,7 +966,7 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::mapCoo
 
   }
 
-  for(int i = 0; i < Vcut.rows(); i++){
+  for(unsigned int i = 0; i < Vcut.rows(); i++){
     UV_out(i,0) = X[i*2];
     UV_out(i,1) = X[i*2+1];
   }
@@ -966,7 +983,7 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::buildS
 
   for (unsigned int i=0; i<num_cut_constraint; i++)
   {
-    unsigned char interval = systemInfo.edgeSeamInfo[i].MMatch;
+    int interval = systemInfo.edgeSeamInfo[i].mismatch;
     if (interval==1)
       interval=3;
     else
@@ -979,7 +996,7 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::buildS
     std::complex<double> rot = getRotationComplex(interval);
 
     ///get the integer variable
-    int integerVar = n_vert_vars + systemInfo.edgeSeamInfo[i].integerVar;
+    unsigned int integerVar = n_vert_vars + systemInfo.edgeSeamInfo[i].integerVar;
 
     if (integer_rounding)
     {
@@ -1012,16 +1029,13 @@ template <typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::buildUserDefinedConstraints()
 {
   /// the user defined constraints are at the end
-  int offset_row = num_cut_constraint*2 + n_fixed_vars*2;
-
-  ///current constraint row
-  int constr_row = offset_row;
+  unsigned int constr_row = num_cut_constraint*2 + n_fixed_vars*2;
 
   assert(num_userdefined_constraint == userdefined_constraints.size());
 
-  for (unsigned int i=0; i<num_userdefined_constraint; i++)
+  for (unsigned int i = 0; i < num_userdefined_constraint; i++)
   {
-    for (unsigned int j=0; j<userdefined_constraints[i].size()-1; ++j)
+    for (unsigned int j = 0; j < userdefined_constraints[i].size()-1; ++j)
     {
       Constraints.coeffRef(constr_row, j) = userdefined_constraints[i][j];
     }
@@ -1033,30 +1047,30 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::buildU
 
 ///call of the mixed integer solver
 template <typename DerivedV, typename DerivedF>
-IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::mixedIntegerSolve(double cone_grid_res,
-                                                                                            bool direct_round,
-                                                                                            int localIter)
+IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::mixedIntegerSolve(double coneGridRes,
+                                                                                            bool directRound,
+                                                                                            unsigned int localIter)
 {
   X = std::vector<double>((n_vert_vars+n_integer_vars)*2);
   if (DEBUGPRINT)
     printf("\n ALLOCATED X \n");
 
   ///variables part
-  int ScalarSize = n_vert_vars*2;
-  int SizeMatrix = (n_vert_vars+n_integer_vars)*2;
+  const int sizeMatrix = (n_vert_vars + n_integer_vars) * 2;
+  const int scalarSize = n_vert_vars * 2;
 
   ///matrix A
-  gmm::col_matrix< gmm::wsvector< double > > A(SizeMatrix,SizeMatrix); // lhs matrix variables
+  gmm::col_matrix< gmm::wsvector< double > > A(sizeMatrix,sizeMatrix); // lhs matrix variables
 
   ///constraints part
   int CsizeX = num_constraint_equations;
-  int CsizeY = SizeMatrix+1;
+  int CsizeY = sizeMatrix+1;
   gmm::row_matrix< gmm::wsvector< double > > C(CsizeX,CsizeY); // constraints
 
   if (DEBUGPRINT)
     printf("\n ALLOCATED QMM STRUCTURES \n");
 
-  std::vector<double> B(SizeMatrix,0);  // rhs
+  std::vector<double> B(sizeMatrix,0);  // rhs
 
   if (DEBUGPRINT)
     printf("\n ALLOCATED RHS STRUCTURES \n");
@@ -1081,22 +1095,20 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::mixedI
   if (DEBUGPRINT)
     printf("\n SET %d INTEGER VALUES \n",n_integer_vars);
 
-  ///add penalization term for integer variables
-  double penalization = 0.000001;
-  int offline_index   = ScalarSize;
-  for(unsigned int i = 0; i < (n_integer_vars)*2; ++i)
+  int offline_index = scalarSize;
+  for(unsigned int i = 0; i < n_integer_vars*2; ++i)
   {
     int index=offline_index+i;
-    A(index,index)=penalization;
+    A(index, index) = PENALIZATION;
   }
 
   if (DEBUGPRINT)
     printf("\n SET RHS \n");
 
   // copy RHS
-  for(int i = 0; i < (int)ScalarSize; ++i)
+  for(unsigned int i = 0; i < scalarSize; ++i)
   {
-    B[i] = rhs[i] * cone_grid_res;
+    B[i] = rhs[i] * coneGridRes;
   }
 
   // copy constraint RHS
@@ -1105,18 +1117,18 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::mixedI
 
   for(unsigned int i = 0; i < num_constraint_equations; ++i)
   {
-    C(i, SizeMatrix) = -constraints_rhs[i] * cone_grid_res;
+    C(i, sizeMatrix) = -constraints_rhs[i] * coneGridRes;
   }
 
   COMISO::ConstrainedSolver solver;
 
   solver.misolver().set_local_iters(localIter);
 
-  solver.misolver().set_direct_rounding(direct_round);
+  solver.misolver().set_direct_rounding(directRound);
 
   std::sort(ids_to_round.begin(),ids_to_round.end());
-  std::vector<int>::iterator new_end=std::unique(ids_to_round.begin(),ids_to_round.end());
-  int dist=distance(ids_to_round.begin(),new_end);
+  auto new_end=std::unique(ids_to_round.begin(),ids_to_round.end());
+  long int dist = distance(ids_to_round.begin(),new_end);
   ids_to_round.resize(dist);
 
   solver.solve( C, A, X, B, ids_to_round, 0.0, false, false);
@@ -1165,24 +1177,25 @@ IGL_INLINE void igl::copyleft::comiso::PoissonSolver<DerivedV, DerivedF>::addSha
 
 
 template <typename DerivedV, typename DerivedF, typename DerivedU>
-IGL_INLINE igl::copyleft::comiso::MIQ_class<DerivedV, DerivedF, DerivedU>::MIQ_class(const Eigen::PlainObjectBase<DerivedV> &V_,
-                                                                   const Eigen::PlainObjectBase<DerivedF> &F_,
-                                                                   const Eigen::PlainObjectBase<DerivedV> &PD1_combed,
-                                                                   const Eigen::PlainObjectBase<DerivedV> &PD2_combed,
-                                                                   const Eigen::Matrix<int, Eigen::Dynamic, 3> &mismatch,
-                                                                   const Eigen::Matrix<int, Eigen::Dynamic, 1> &singular,
-                                                                   const Eigen::Matrix<int, Eigen::Dynamic, 3> &seams,
-                                                                   Eigen::PlainObjectBase<DerivedU> &UV,
-                                                                   Eigen::PlainObjectBase<DerivedF> &FUV,
-                                                                   double gradientSize,
-                                                                   double stiffness,
-                                                                   bool directRound,
-                                                                   int iter,
-                                                                   int localIter,
-                                                                   bool doRound,
-                                                                   bool singularityRound,
-                                                                   std::vector<int> roundVertices,
-                                                                   std::vector<std::vector<int> > hardFeatures):
+IGL_INLINE igl::copyleft::comiso::MIQ_class<DerivedV, DerivedF, DerivedU>::MIQ_class(
+        const Eigen::PlainObjectBase<DerivedV> &V_,
+        const Eigen::PlainObjectBase<DerivedF> &F_,
+        const Eigen::PlainObjectBase<DerivedV> &PD1_combed,
+        const Eigen::PlainObjectBase<DerivedV> &PD2_combed,
+        const Eigen::Matrix<int, Eigen::Dynamic, 3> &mismatch,
+        const Eigen::Matrix<int, Eigen::Dynamic, 1> &singular,
+        const Eigen::Matrix<int, Eigen::Dynamic, 3> &seams,
+        Eigen::PlainObjectBase<DerivedU> &UV,
+        Eigen::PlainObjectBase<DerivedF> &FUV,
+        double gradientSize,
+        double stiffness,
+        bool directRound,
+        unsigned int iter,
+        unsigned int localIter,
+        bool doRound,
+        bool singularityRound,
+        std::vector<int> roundVertices,
+        std::vector<std::vector<int> > hardFeatures):
 V(V_),
 F(F_)
 {
@@ -1207,14 +1220,14 @@ F(F_)
                                             PD2_combed,
                                             singular,
                                             VInd.systemInfo);
-  Handle_Stiffness = Eigen::VectorXd::Constant(F.rows(),1);
+  stiffnessVector = Eigen::VectorXd::Constant(F.rows(),1);
 
 
   if (iter > 0) // do stiffening
   {
-    for (int i=0;i<iter;i++)
+    for (unsigned int i=0;i<iter;i++)
     {
-      PSolver.solvePoisson(Handle_Stiffness, gradientSize, 1.f, directRound, localIter, doRound, singularityRound,
+      PSolver.solvePoisson(stiffnessVector, gradientSize, 1.f, directRound, localIter, doRound, singularityRound,
                            roundVertices, hardFeatures);
       int nflips=NumFlips(PSolver.WUV);
       bool folded = updateStiffeningJacobianDistorsion(gradientSize,PSolver.WUV);
@@ -1224,7 +1237,7 @@ F(F_)
   }
   else
   {
-    PSolver.solvePoisson(Handle_Stiffness, gradientSize, 1.f, directRound, localIter, doRound, singularityRound,
+    PSolver.solvePoisson(stiffnessVector, gradientSize, 1.f, directRound, localIter, doRound, singularityRound,
                          roundVertices, hardFeatures);
   }
 
@@ -1385,7 +1398,7 @@ IGL_INLINE bool igl::copyleft::comiso::MIQ_class<DerivedV, DerivedF, DerivedU>::
 
       double stiffDelta = std::min(c * absLap, d);
 
-      Handle_Stiffness[i]+=stiffDelta;
+      stiffnessVector[i]+=stiffDelta;
     }
   }
   printf("Maximum Distorsion %4.4f \n",maxD);
@@ -1434,12 +1447,12 @@ IGL_INLINE void igl::copyleft::comiso::miq(
   double gradientSize,
   double stiffness,
   bool directRound,
-  int iter,
-  int localIter,
+  unsigned int iter,
+  unsigned int localIter,
   bool doRound,
   bool singularityRound,
-  std::vector<int> roundVertices,
-  std::vector<std::vector<int> > hardFeatures)
+  const std::vector<int> &roundVertices,
+  const std::vector<std::vector<int>> &hardFeatures)
 {
   gradientSize = gradientSize/(V.colwise().maxCoeff()-V.colwise().minCoeff()).norm();
 
@@ -1467,21 +1480,21 @@ IGL_INLINE void igl::copyleft::comiso::miq(
 
 template <typename DerivedV, typename DerivedF, typename DerivedU>
 IGL_INLINE void igl::copyleft::comiso::miq(
-    const Eigen::PlainObjectBase<DerivedV> &V,
-    const Eigen::PlainObjectBase<DerivedF> &F,
-    const Eigen::PlainObjectBase<DerivedV> &PD1,
-    const Eigen::PlainObjectBase<DerivedV> &PD2,
-    Eigen::PlainObjectBase<DerivedU> &UV,
-    Eigen::PlainObjectBase<DerivedF> &FUV,
-    double gradientSize,
-    double stiffness,
-    bool directRound,
-    int iter,
-    int localIter,
-    bool doRound,
-    bool singularityRound,
-    std::vector<int> roundVertices,
-    std::vector<std::vector<int> > hardFeatures)
+  const Eigen::PlainObjectBase<DerivedV> &V,
+  const Eigen::PlainObjectBase<DerivedF> &F,
+  const Eigen::PlainObjectBase<DerivedV> &PD1,
+  const Eigen::PlainObjectBase<DerivedV> &PD2,
+  Eigen::PlainObjectBase<DerivedU> &UV,
+  Eigen::PlainObjectBase<DerivedF> &FUV,
+  double gradientSize,
+  double stiffness,
+  bool directRound,
+  unsigned int iter,
+  unsigned int localIter,
+  bool doRound,
+  bool singularityRound,
+  const std::vector<int> &roundVertices,
+  const std::vector<std::vector<int>> &hardFeatures)
 {
 
   DerivedV BIS1, BIS2;
@@ -1524,7 +1537,7 @@ IGL_INLINE void igl::copyleft::comiso::miq(
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
-template void igl::copyleft::comiso::miq<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -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<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&, double, double, bool, int, int, bool, bool, std::vector<int, std::allocator<int> >, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >);
-template void igl::copyleft::comiso::miq<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, 3, 0, -1, 3> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::Matrix<int, -1, 3, 0, -1, 3> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, double, double, bool, int, int, bool, bool, std::vector<int, std::allocator<int> >, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >);
-template void igl::copyleft::comiso::miq<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, double, double, bool, int, int, bool, bool, std::vector<int, std::allocator<int> >, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >);
+template void igl::copyleft::comiso::miq<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -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<double, -1, -1, 0, -1, -1> > &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > &, double, double, bool, unsigned int, unsigned int, bool, bool, const std::vector<int> &, const std::vector<std::vector<int>> &);
+template void igl::copyleft::comiso::miq<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::Matrix<int, -1, 3, 0, -1, 3> const &, Eigen::Matrix<int, -1, 1, 0, -1, 1> const &, Eigen::Matrix<int, -1, 3, 0, -1, 3> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > &, double, double, bool, unsigned int, unsigned int, bool, bool, const std::vector<int> &, const std::vector<std::vector<int>> &);
+template void igl::copyleft::comiso::miq<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > &, double, double, bool, unsigned int, unsigned int, bool, bool, const std::vector<int> &, const std::vector<std::vector<int>> &);
 #endif

+ 10 - 9
include/igl/copyleft/comiso/miq.h

@@ -59,12 +59,12 @@ namespace igl
       double gradientSize = 30.0,
       double stiffness = 5.0,
       bool directRound = false,
-      int iter = 5,
-      int localIter = 5,
+      unsigned int iter = 5,
+      unsigned int localIter = 5,
       bool doRound = true,
       bool singularityRound = true,
-      std::vector<int> roundVertices = std::vector<int>(),
-      std::vector<std::vector<int> > hardFeatures = std::vector<std::vector<int> >());
+      const std::vector<int> &roundVertices = std::vector<int>(),
+      const std::vector<std::vector<int>> &hardFeatures = std::vector<std::vector<int> >());
 
     // Helper function that allows to directly provided pre-combed bisectors for an already cut mesh
 
@@ -95,7 +95,8 @@ namespace igl
     // FUV                #FUV by 3 list of face indices in UV
     //
     template <typename DerivedV, typename DerivedF, typename DerivedU>
-    IGL_INLINE void miq(const Eigen::PlainObjectBase<DerivedV> &V,
+    IGL_INLINE void miq(
+      const Eigen::PlainObjectBase<DerivedV> &V,
       const Eigen::PlainObjectBase<DerivedF> &F,
       const Eigen::PlainObjectBase<DerivedV> &PD1_combed,
       const Eigen::PlainObjectBase<DerivedV> &PD2_combed,
@@ -107,12 +108,12 @@ namespace igl
       double gradientSize = 30.0,
       double stiffness = 5.0,
       bool directRound = false,
-      int iter = 5,
-      int localIter = 5,
+      unsigned int iter = 5,
+      unsigned int localIter = 5,
       bool doRound = true,
       bool singularityRound = true,
-      std::vector<int> roundVertices = std::vector<int>(),
-      std::vector<std::vector<int> > hardFeatures = std::vector<std::vector<int> >());
+      const std::vector<int> &roundVertices = std::vector<int>(),
+      const std::vector<std::vector<int>> &hardFeatures = std::vector<std::vector<int> >());
   };
 };
 };

+ 2 - 2
include/igl/cut_mesh_from_singularities.h

@@ -13,13 +13,13 @@
 namespace igl
 {
   // Given a mesh (V,F) and the integer mismatch of a cross field per edge
-  // (MMatch), finds the cut_graph connecting the singularities (seams) and the
+  // (mismatch), finds the cut_graph connecting the singularities (seams) and the
   // degree of the singularities singularity_index
   //
   // Input:
   //   V  #V by 3 list of mesh vertex positions
   //   F  #F by 3 list of faces
-  //   MMatch  #F by 3 list of per corner integer mismatch
+  //   mismatch  #F by 3 list of per corner integer mismatch
   // Outputs:
   //   seams  #F by 3 list of per corner booleans that denotes if an edge is a
   //     seam or not

+ 2 - 2
python/py_doc.cpp

@@ -443,13 +443,13 @@ const char *__doc_igl_cross_field_mismatch = R"igl_Qu8mg5v7(// Inputs:
   //                    across all face edges
   //)igl_Qu8mg5v7";
 const char *__doc_igl_cut_mesh_from_singularities = R"igl_Qu8mg5v7(// Given a mesh (V,F) and the integer mismatch of a cross field per edge
-  // (MMatch), finds the cut_graph connecting the singularities (seams) and the
+  // (mismatch), finds the cut_graph connecting the singularities (seams) and the
   // degree of the singularities singularity_index
   //
   // Input:
   //   V  #V by 3 list of mesh vertex positions
   //   F  #F by 3 list of faces
-  //   MMatch  #F by 3 list of per corner integer mismatch
+  //   mismatch  #F by 3 list of per corner integer mismatch
   // Outputs:
   //   seams  #F by 3 list of per corner booleans that denotes if an edge is a
   //     seam or not

+ 21 - 24
python/py_igl/copyleft/comiso/py_miq.cpp

@@ -15,21 +15,19 @@ m.def("miq", []
   Eigen::MatrixXi &FUV,
   double scale,
   double stiffness,
-  bool direct_round,
+  bool directRound,
   int iter,
-  int local_iter,
-  bool DoRound,bool SingularityRound
-  //  std::vector<int> round_vertices,
-  //  std::vector<std::vector<int> > hard_features
+  int localIter,
+  bool doRound,
+  bool singularityRound
 )
 {
-  std::vector<int> round_vertices;
-  std::vector<std::vector<int> > hard_features;
+  std::vector<int> roundVertices;
+  std::vector<std::vector<int> > hardFeatures;
 
-  igl::copyleft::comiso::miq(V,F,PD1,PD2,UV,FUV,scale,stiffness,direct_round,iter,local_iter,DoRound, SingularityRound, round_vertices, hard_features);
+  igl::copyleft::comiso::miq(V, F, PD1, PD2, UV, FUV, scale, stiffness, directRound, iter, localIter, doRound, singularityRound, roundVertices, hardFeatures);
 }, __doc_igl_copyleft_comiso_miq,
-py::arg("V"), py::arg("F"), py::arg("PD1"), py::arg("PD2"), py::arg("UV"), py::arg("FUV"), py::arg("scale") = 30.0, py::arg("stiffness") = 5.0, py::arg("direct_round") = false, py::arg("iter") = 5, py::arg("local_iter") = 5, py::arg("DoRound") = true, py::arg("SingularityRound") = true
-// , py::arg("round_vertices"), py::arg("hard_features")
+py::arg("V"), py::arg("F"), py::arg("PD1"), py::arg("PD2"), py::arg("UV"), py::arg("FUV"), py::arg("scale") = 30.0, py::arg("stiffness") = 5.0, py::arg("directRound") = false, py::arg("iter") = 5, py::arg("localIter") = 5, py::arg("doRound") = true, py::arg("singularityRound") = true
 );
 
 m.def("miq", []
@@ -38,29 +36,28 @@ m.def("miq", []
   const Eigen::MatrixXi &F,
   const Eigen::MatrixXd &PD1_combed,
   const Eigen::MatrixXd &PD2_combed,
-  const Eigen::MatrixXi &MMatch,
-  const Eigen::MatrixXi &Singular,
-  const Eigen::MatrixXi &Seams,
+  const Eigen::MatrixXi &mismatch,
+  const Eigen::MatrixXi &singular,
+  const Eigen::MatrixXi &seams,
   Eigen::MatrixXd &UV,
   Eigen::MatrixXi &FUV,
-  double GradientSize,
-  double Stiffness,
-  bool DirectRound,
+  double gradientSize,
+  double stiffness,
+  bool directRound,
   int iter,
-  int localIter, bool DoRound, bool SingularityRound
-  // std::vector<int> roundVertices,
-  // std::vector<std::vector<int> > hardFeatures
+  int localIter,
+  bool doRound,
+  bool singularityRound
 )
 {
-  assert_is_VectorX("Singular",Singular);
+  assert_is_VectorX("singular",singular);
 
   std::vector<int> roundVertices;
   std::vector<std::vector<int> > hardFeatures;
 
-  igl::copyleft::comiso::miq(V,F,PD1_combed,PD2_combed,MMatch,Singular,Seams,UV,FUV,GradientSize,Stiffness,DirectRound,iter,localIter,DoRound, SingularityRound, roundVertices, hardFeatures);
+  igl::copyleft::comiso::miq(V, F, PD1_combed, PD2_combed, mismatch, singular, seams, UV, FUV, gradientSize, stiffness, directRound, iter, localIter, doRound, singularityRound, roundVertices, hardFeatures);
 }, __doc_igl_copyleft_comiso_miq,
 py::arg("V"), py::arg("F"), py::arg("PD1_combed"), py::arg("PD2_combed"),
-py::arg("MMatch"), py::arg("Singular"), py::arg("Seams"),
-py::arg("UV"), py::arg("FUV"), py::arg("GradientSize") = 30.0, py::arg("Stiffness") = 5.0, py::arg("DirectRound") = false, py::arg("iter") = 5, py::arg("localIter") = 5, py::arg("DoRound") = true, py::arg("SingularityRound") = true
-// , py::arg("roundVertices"), py::arg("hardFeatures")
+py::arg("mismatch"), py::arg("singular"), py::arg("seams"),
+py::arg("UV"), py::arg("FUV"), py::arg("gradientSize") = 30.0, py::arg("stiffness") = 5.0, py::arg("directRound") = false, py::arg("iter") = 5, py::arg("localIter") = 5, py::arg("doRound") = true, py::arg("singularityRound") = true
 );

+ 1 - 1
python/py_igl/py_cut_mesh_from_singularities.cpp

@@ -15,4 +15,4 @@ m.def("cut_mesh_from_singularities", []
 {
   return igl::cut_mesh_from_singularities(V,F,MMatch,seams);
 }, __doc_igl_cut_mesh_from_singularities,
-py::arg("V"), py::arg("F"), py::arg("MMatch"), py::arg("seams"));
+py::arg("V"), py::arg("F"), py::arg("mismatch"), py::arg("seams"));