From 6030da1182b059134ac417a3a06d14ecc2e7241e Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 20 Jun 2015 07:20:53 +0200 Subject: [PATCH] Sketcher: Solver improvements and bug fixes =========================================== - Improvement Debug added to redundant solving in Iteration Mode, to show when just one iteration solved the system - Fix wrong QR information on empty sketch --- src/Mod/Sketcher/App/planegcs/GCS.cpp | 31 +++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index a131ed4ae9..dc4533493d 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -1776,18 +1776,27 @@ int System::diagnose(Algorithm alg) if(debugMode==IterationLevel) { std::stringstream stream; + stream << (qrAlgorithm==EigenSparseQR?"EigenSparseQR":(qrAlgorithm==EigenDenseQR?"DenseQR":"")); + + if (J.rows() > 0) { + stream << ", Threads: " << Eigen::nbThreads() + #ifdef EIGEN_VECTORIZE + << ", Vectorization: On" + #endif + << ", Params: " << paramsNum + << ", Constr: " << constrNum + << ", Rank: " << rank << "\n"; + } + else { + stream << ", Threads: " << Eigen::nbThreads() + #ifdef EIGEN_VECTORIZE + << ", Vectorization: On" + #endif + << ", Empty Sketch, nothing to solve" << "\n"; + } - stream << (qrAlgorithm==EigenSparseQR?"EigenSparseQR":(qrAlgorithm==EigenDenseQR?"DenseQR":"")); - stream << ", Threads: " << Eigen::nbThreads() - #ifdef EIGEN_VECTORIZE - << ", Vectorization: On" - #endif - << ", Params: " << paramsNum - << ", Constr: " << constrNum - << ", Rank: " << rank << "\n"; - const std::string tmp = stream.str(); - Base::Console().Log(tmp.c_str()); + Base::Console().Log(tmp.c_str()); } if (J.rows() > 0) { @@ -1890,7 +1899,7 @@ int System::diagnose(Algorithm alg) SubSystem *subSysTmp = new SubSystem(clistTmp, plist); int res = solve(subSysTmp,true,alg,true); - if(debugMode==Minimal) { + if(debugMode==Minimal || debugMode==IterationLevel) { std::string solvername; switch (alg) { case 0: