diff --git a/include/igl/active_set.cpp b/include/igl/active_set.cpp index 0ba567ee1..15bcecc5a 100644 --- a/include/igl/active_set.cpp +++ b/include/igl/active_set.cpp @@ -290,11 +290,15 @@ IGL_INLINE igl::SolverStatus igl::active_set( #endif if(!min_quad_with_fixed_precompute(A,known_i,Aeq_i,params.Auu_pd,data)) { +#ifdef ACTIVE_SET_CPP_DEBUG cerr<<"Error: min_quad_with_fixed precomputation failed."< 0 && Aeq_i.rows() > Aeq.rows()) { +#ifdef ACTIVE_SET_CPP_DEBUG cerr<<" *Are you sure rows of [Aeq;Aieq] are linearly independent?*"<< endl; +#endif } ret = SOLVER_STATUS_ERROR; break; @@ -304,7 +308,9 @@ IGL_INLINE igl::SolverStatus igl::active_set( #endif if(!min_quad_with_fixed_solve(data,B,Y_i,Beq_i,Z,sol)) { +#ifdef ACTIVE_SET_CPP_DEBUG cerr<<"Error: min_quad_with_fixed solve failed."< #include #include -#include // References: // http://minregret.googlecode.com/svn/trunk/skyline/src/extern/CGAL-3.3.1/examples/Polyhedron/polyhedron_self_intersection.cpp @@ -344,7 +343,7 @@ inline igl::copyleft::cgal::SelfIntersectMesh< return diff; }; const auto log_time = [&](const std::string& label) -> void{ - printf("%50s: %0.5lf\n", + std::printf("%50s: %0.5lf\n", C_STR("SelfIntersectMesh." << label),tictoc()); }; tictoc(); @@ -630,8 +629,8 @@ inline bool igl::copyleft::cgal::SelfIntersectMesh< return true; }else { - cerr<<"Segment ∩ triangle neither point nor segment?"< *polyp = CGAL::object_cast< std::vector >(&obj)) { - //cerr< & poly = *polyp; const Index m = poly.size(); assert(m>=2); @@ -92,8 +91,7 @@ IGL_INLINE void igl::copyleft::cgal::projected_delaunay( } }else { - cerr<<"What is this object?!"< 0) - { - cerr<<"Error: Cage edges are not supported. Ignored."<::LLT; @@ -252,10 +262,14 @@ IGL_INLINE bool igl::min_quad_with_fixed_precompute( case Eigen::Success: break; case Eigen::NumericalIssue: +#ifdef MIN_QUAD_WITH_FIXED_CPP_DEBUG cerr<<"Error: Numerical issue."<::LDLT; @@ -273,13 +287,19 @@ IGL_INLINE bool igl::min_quad_with_fixed_precompute( case Eigen::Success: break; case Eigen::NumericalIssue: +#ifdef MIN_QUAD_WITH_FIXED_CPP_DEBUG cerr<<"Error: Numerical issue."<::LU; @@ -356,10 +376,14 @@ IGL_INLINE bool igl::min_quad_with_fixed_precompute( case Eigen::Success: break; case Eigen::NumericalIssue: +#ifdef MIN_QUAD_WITH_FIXED_CPP_DEBUG cerr<<"Error: Numerical issue."<::QR_LLT; @@ -465,7 +489,9 @@ IGL_INLINE bool igl::min_quad_with_fixed_solve( sol = data.lu.solve(NB); break; default: +#ifdef MIN_QUAD_WITH_FIXED_CPP_DEBUG cerr<<"Error: invalid solver type"<1e-10) + { std::cerr<<"Distance from V to plane of C is large..."<::assembleQ() solver.compute(Q.transpose()*Q); if(solver.info()!=Eigen::Success) { - std::cerr << "Cholesky failed - PlanarizerShapeUp.cpp" << std::endl; - assert(0); + assert(false && "Cholesky failed"); } } @@ -205,15 +204,13 @@ inline void igl::PlanarizerShapeUp::planarize(Eigen::PlainOb { igl::quad_planarity(Vout, Fin, planarity); typename DerivedV::Scalar nonPlanarity = planarity.cwiseAbs().maxCoeff(); - //std::cerr<<"iter #"< &VV) { assert(VV.size() >= 5); - if (VV.size() < 5) - { - std::cerr << "IGL_ASSERT FAILED! fit function requires at least 5 points: Only " << VV.size() << " were given." << std::endl; - exit(0); - } Eigen::MatrixXd A(VV.size(),5); Eigen::MatrixXd b(VV.size(),1); @@ -351,7 +346,7 @@ IGL_INLINE void CurvatureCalculator::fitQuadric(const Eigen::Vector3d& v, const } if (points.size() < 5) { - std::cerr << "IGL_ASSERT FAILED! fit function requires at least 5 points: Only " << points.size() << " were given." << std::endl; + assert(false && "fit function requires at least 5 points"); *q = Quadric(0,0,0,0,0); } else @@ -922,7 +917,7 @@ IGL_INLINE void igl::principal_curvature( if (PD1.row(i) * PD2.row(i).transpose() > 10e-6) { - std::cerr << "PRINCIPAL_CURVATURE: Something is wrong with vertex: " << i << std::endl; + assert(false && "PRINCIPAL_CURVATURE: Something is wrong with vertex"); PD1.row(i) *= 0; PD2.row(i) *= 0; } diff --git a/include/igl/rotation_matrix_from_directions.cpp b/include/igl/rotation_matrix_from_directions.cpp index 4ecc1a5d9..d90bf4d60 100644 --- a/include/igl/rotation_matrix_from_directions.cpp +++ b/include/igl/rotation_matrix_from_directions.cpp @@ -28,7 +28,9 @@ IGL_INLINE Eigen::Matrix igl::rotation_matrix_from_directions( { rotM = -Eigen::Matrix::Identity(); rotM(0,0) = 1.; +#ifdef IGL_ROTATION_MATRIX_FROM_DIRECTIONS_DEBUG std::cerr<<"igl::rotation_matrix_from_directions: rotating around x axis by 180o"<