Browse Source

Removed Debug output

Former-commit-id: a1774afa03b85bf58bc9c13828c2cb4850b62904
wkevin 10 years ago
parent
commit
409b43a07e
2 changed files with 3 additions and 68 deletions
  1. 3 57
      include/igl/comiso/miq.cpp
  2. 0 11
      include/igl/comiso/miq.h

+ 3 - 57
include/igl/comiso/miq.cpp

@@ -35,14 +35,16 @@
 #include <igl/compute_frame_field_bisectors.h>
 #include <igl/rotate_vectors.h>
 
+#ifndef NDEBUG
 #include <fstream>
+#endif
 #include <iostream>
 #include <igl/matlab_format.h>
 
 using namespace std;
 using namespace Eigen;
 
-#define DEBUGPRINT 1
+#define DEBUGPRINT 0
 
 
 namespace igl {
@@ -96,9 +98,6 @@ namespace comiso {
     ///this handle for mesh TODO: move with the other global variables
     MeshSystemInfo Handle_SystemInfo;
 
-    //DEBUG
-    std::vector<DebugFaceEdgeInfo> DebugInfo;
-
     IGL_INLINE VertexIndexing(const Eigen::PlainObjectBase<DerivedV> &_V,
                               const Eigen::PlainObjectBase<DerivedF> &_F,
                               const Eigen::PlainObjectBase<DerivedV> &_Vcut,
@@ -309,8 +308,6 @@ namespace comiso {
     Eigen::MatrixXd UV_out;
     Eigen::PlainObjectBase<DerivedF> FUV_out;
 
-    //DEBUG
-    std::vector<DebugFaceEdgeInfo> debugFaceEdgeInfo_out;
     // internal
     Eigen::PlainObjectBase<DerivedF> TT;
     Eigen::PlainObjectBase<DerivedF> TTi;
@@ -343,10 +340,6 @@ namespace comiso {
     IGL_INLINE void extractUV(Eigen::PlainObjectBase<DerivedU> &UV_out,
                               Eigen::PlainObjectBase<DerivedF> &FUV_out);
 
-    //DEBUG
-
-    IGL_INLINE void extractDebugInfo(std::vector<igl::comiso::DebugFaceEdgeInfo>& debugFaceEdgeInfo);
-
   private:
     IGL_INLINE int NumFlips(const Eigen::MatrixXd& WUV);
 
@@ -586,8 +579,6 @@ IGL_INLINE void igl::comiso::VertexIndexing<DerivedV, DerivedF>::InitSeamInfo()
         Handle_SystemInfo.EdgeSeamInfo.push_back(SeamInfo(vtx1,vtx1p,MM,integerVar));
       }
       priorVertexIdx = vtx1;
-      //DEBUG
-      DebugInfo.push_back(DebugFaceEdgeInfo(f,k,integerVar));
     }
     // use the same integer for each seam
     integerVar++;
@@ -1151,37 +1142,6 @@ IGL_INLINE void igl::comiso::PoissonSolver<DerivedV, DerivedF>::MixedIntegerSolv
   ids_to_round.resize(dist);
 
   solver.solve( C, A, X, B, ids_to_round, 0.0, false, false);
-
-
-  ////DEBUG OUTPUT
-  if(integer_rounding){
-  std::ofstream idsout("ids.txt");
-  for(auto elem : ids_to_round){
-    idsout << elem << std::endl;
-  }
-  idsout.close();
-
-    std::ofstream consout("Cmat.txt");
-    Eigen::SparseMatrix<double, Eigen::RowMajor> Cmat = Constraints;
-    for (int k=0; k < Cmat.outerSize(); ++k){
-      for (Eigen::SparseMatrix<double, Eigen::RowMajor>::InnerIterator it(Cmat,k); it; ++it){
-        int row = it.row();
-        int col = it.col();
-        consout << "(" << row << ", " << col << ")" << "\t" << it.value() << std::endl;
-      }
-    }
-    consout.close();
-
-    std::ofstream rhsCout("rhsC.txt");
-    rhsCout << rhs;
-    rhsCout.close();
-
-    std::ofstream xout("Xout.txt");
-    for(auto it = X.begin(); it != X.end(); it+=2){
-      xout << *it << "\t" << *(it+1) << std::endl;
-    }
-    xout.close();
-  }
 }
 
 template <typename DerivedV, typename DerivedF>
@@ -1322,7 +1282,6 @@ F(F_)
 
   UV_out = PSolver.UV_out;
   FUV_out = PSolver.Fcut;
-  debugFaceEdgeInfo_out = VInd.DebugInfo;
   fflush(stdout);
 }
 
@@ -1334,12 +1293,6 @@ IGL_INLINE void igl::comiso::MIQ_class<DerivedV, DerivedF, DerivedU>::extractUV(
   FUV_out = this->FUV_out;
 }
 
-//DEBUG
-template <typename DerivedV, typename DerivedF, typename DerivedU>
-IGL_INLINE void igl::comiso::MIQ_class<DerivedV, DerivedF, DerivedU>::extractDebugInfo(std::vector<igl::comiso::DebugFaceEdgeInfo>& debugFaceEdgeInfo){
-  debugFaceEdgeInfo = this->debugFaceEdgeInfo_out;
-}
-
 template <typename DerivedV, typename DerivedF, typename DerivedU>
 IGL_INLINE int igl::comiso::MIQ_class<DerivedV, DerivedF, DerivedU>::NumFlips(const Eigen::MatrixXd& WUV)
 {
@@ -1527,8 +1480,6 @@ IGL_INLINE void igl::comiso::miq(
   const Eigen::Matrix<int, Eigen::Dynamic, 3> &Handle_Seams,
   Eigen::PlainObjectBase<DerivedU> &UV,
   Eigen::PlainObjectBase<DerivedF> &FUV,
-  //DEBUG
-  std::vector<igl::comiso::DebugFaceEdgeInfo> &debugFaceEdgeInfo,
   double GradientSize,
   double Stiffness,
   bool DirectRound,
@@ -1561,7 +1512,6 @@ IGL_INLINE void igl::comiso::miq(
     hardFeatures);
 
   miq.extractUV(UV,FUV);
-  miq.extractDebugInfo(debugFaceEdgeInfo);
 }
 
 template <typename DerivedV, typename DerivedF, typename DerivedU>
@@ -1572,8 +1522,6 @@ IGL_INLINE void igl::comiso::miq(
     const Eigen::PlainObjectBase<DerivedV> &PD2,
     Eigen::PlainObjectBase<DerivedU> &UV,
     Eigen::PlainObjectBase<DerivedF> &FUV,
-    //DEBUG
-    std::vector<igl::comiso::DebugFaceEdgeInfo> &debugFaceEdgeInfo,
     double GradientSize,
     double Stiffness,
     bool DirectRound,
@@ -1619,8 +1567,6 @@ IGL_INLINE void igl::comiso::miq(
            Handle_Seams,
            UV,
            FUV,
-           //DEBUG
-           debugFaceEdgeInfo,
            GradientSize,
            Stiffness,
            DirectRound,

+ 0 - 11
include/igl/comiso/miq.h

@@ -15,13 +15,6 @@ namespace igl
 {
   namespace comiso
   {
-  //DEBUG
-  struct DebugFaceEdgeInfo
-  {
-	int f, e, integerVar;
-
-	IGL_INLINE DebugFaceEdgeInfo(int _f, int _e, int _integerVar) : f(_f), e(_e), integerVar(_integerVar){}
-  };
   // Global seamless parametrization aligned with a given per-face jacobian (PD1,PD2).
     // The algorithm is based on
     // "Mixed-Integer Quadrangulation" by D. Bommes, H. Zimmer, L. Kobbelt
@@ -59,8 +52,6 @@ namespace igl
       const Eigen::PlainObjectBase<DerivedV> &PD2,
       Eigen::PlainObjectBase<DerivedU> &UV,
       Eigen::PlainObjectBase<DerivedF> &FUV,
-      //DEBUG
-      std::vector<DebugFaceEdgeInfo> &debugFaceEdgeInfo,
       double scale = 30.0,
       double stiffness = 5.0,
       bool direct_round = false,
@@ -89,8 +80,6 @@ namespace igl
       const Eigen::Matrix<int, Eigen::Dynamic, 3> &Seams,
       Eigen::PlainObjectBase<DerivedU> &UV,
       Eigen::PlainObjectBase<DerivedF> &FUV,
-      //DEBUG
-      std::vector<DebugFaceEdgeInfo> &debugFaceEdgeInfo,
       double GradientSize = 30.0,
       double Stiffness = 5.0,
       bool DirectRound = false,