GCS: Set SparseQR conditional compilation guards

This commit is contained in:
Abdullah Tahiri
2020-12-19 10:27:20 +01:00
committed by abdullahtahiriyo
parent 076eebc0a9
commit 7a76b9b7d2
2 changed files with 9 additions and 3 deletions

View File

@@ -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<int,int> &jacobianconstraintmap,
Eigen::SparseQR<Eigen::SparseMatrix<double>, Eigen::COLAMDOrdering<int> > &SqrJT,
int &rank, Eigen::MatrixXd & R, bool transposeJ, bool silent)
{
#ifdef EIGEN_SPARSEQR_COMPATIBLE
Eigen::SparseMatrix<double> 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<int,int> &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<int,int> &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 <typename T>
void System::identifyDependentParameters( T & qrJ,

View File

@@ -144,11 +144,12 @@ namespace GCS
Eigen::FullPivHouseholderQR<Eigen::MatrixXd>& 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<int,int> &jacobianconstraintmap,
Eigen::SparseQR<Eigen::SparseMatrix<double>, Eigen::COLAMDOrdering<int> > &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<int,int> &jacobianconstraintmap,
const GCS::VEC_pD &pdiagnoselist,
bool silent=true);
#endif
void identifyDependentParametersDenseQR( const Eigen::MatrixXd &J,
const std::map<int,int> &jacobianconstraintmap,