From 7a76b9b7d2aa5081a264bd8cc7898f1a5df18c39 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 19 Dec 2020 10:27:20 +0100 Subject: [PATCH] GCS: Set SparseQR conditional compilation guards --- src/Mod/Sketcher/App/planegcs/GCS.cpp | 7 +++++-- src/Mod/Sketcher/App/planegcs/GCS.h | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index 35a4a97b24..292e9fe73d 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -4102,12 +4102,13 @@ void System::makeDenseQRDecomposition( const Eigen::MatrixXd &J, #endif } +#ifdef EIGEN_SPARSEQR_COMPATIBLE void System::makeSparseQRDecomposition( const Eigen::MatrixXd &J, const std::map &jacobianconstraintmap, Eigen::SparseQR, Eigen::COLAMDOrdering > &SqrJT, int &rank, Eigen::MatrixXd & R, bool transposeJ, bool silent) { -#ifdef EIGEN_SPARSEQR_COMPATIBLE + Eigen::SparseMatrix SJ; // this creation is not optimized (done using triplets) @@ -4184,8 +4185,8 @@ void System::makeSparseQRDecomposition( const Eigen::MatrixXd &J, #endif } #endif //_GCS_DEBUG_SOLVER_JACOBIAN_QR_DECOMPOSITION_TRIANGULAR_MATRIX -#endif // EIGEN_SPARSEQR_COMPATIBLE } +#endif // EIGEN_SPARSEQR_COMPATIBLE void System::identifyDependentParametersDenseQR( const Eigen::MatrixXd &J, const std::map &jacobianconstraintmap, @@ -4202,6 +4203,7 @@ void System::identifyDependentParametersDenseQR( const Eigen::MatrixXd &J, identifyDependentParameters(qrJ, Rparams, rank, pdiagnoselist, silent); } +#ifdef EIGEN_SPARSEQR_COMPATIBLE void System::identifyDependentParametersSparseQR( const Eigen::MatrixXd &J, const std::map &jacobianconstraintmap, const GCS::VEC_pD &pdiagnoselist, @@ -4216,6 +4218,7 @@ void System::identifyDependentParametersSparseQR( const Eigen::MatrixXd &J, identifyDependentParameters(SqrJ, Rparams, nontransprank, pdiagnoselist, silent); } +#endif template void System::identifyDependentParameters( T & qrJ, diff --git a/src/Mod/Sketcher/App/planegcs/GCS.h b/src/Mod/Sketcher/App/planegcs/GCS.h index 5c862cee06..7a1bd83524 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.h +++ b/src/Mod/Sketcher/App/planegcs/GCS.h @@ -144,11 +144,12 @@ namespace GCS Eigen::FullPivHouseholderQR& qrJT, int &rank, Eigen::MatrixXd &R, bool transposeJ = true, bool silent = false); +#ifdef EIGEN_SPARSEQR_COMPATIBLE void makeSparseQRDecomposition( const Eigen::MatrixXd &J, const std::map &jacobianconstraintmap, Eigen::SparseQR, Eigen::COLAMDOrdering > &SqrJT, int &rank, Eigen::MatrixXd &R, bool transposeJ = true, bool silent = false); - +#endif // This function name is long for a reason: // - Only for DenseQR // - Only for Transposed Jacobian QR decomposition @@ -171,10 +172,12 @@ namespace GCS void eliminateNonZerosOverPivotInUpperTriangularMatrix(Eigen::MatrixXd &R, int rank); +#ifdef EIGEN_SPARSEQR_COMPATIBLE void identifyDependentParametersSparseQR( const Eigen::MatrixXd &J, const std::map &jacobianconstraintmap, const GCS::VEC_pD &pdiagnoselist, bool silent=true); +#endif void identifyDependentParametersDenseQR( const Eigen::MatrixXd &J, const std::map &jacobianconstraintmap,