don't use deprecated MappedSparseMatrix

This commit is contained in:
Erik Schultheis
2021-11-19 15:58:04 +00:00
committed by Rasmus Munk Larsen
parent 11cb7b8372
commit 7e586635ba
11 changed files with 16 additions and 93 deletions

View File

@@ -88,7 +88,7 @@ void check_sparse_solving(Solver& solver, const typename Solver::MatrixType& A,
x.setZero();
// test with Map
MappedSparseMatrix<Scalar,Mat::Options,StorageIndex> Am(A.rows(), A.cols(), A.nonZeros(), const_cast<StorageIndex*>(A.outerIndexPtr()), const_cast<StorageIndex*>(A.innerIndexPtr()), const_cast<Scalar*>(A.valuePtr()));
Map<SparseMatrix<Scalar,Mat::Options,StorageIndex>> Am(A.rows(), A.cols(), A.nonZeros(), const_cast<StorageIndex*>(A.outerIndexPtr()), const_cast<StorageIndex*>(A.innerIndexPtr()), const_cast<Scalar*>(A.valuePtr()));
solver.compute(Am);
VERIFY(solver.info() == Success && "factorization failed when using Map");
DenseRhs dx(refX);
@@ -217,7 +217,7 @@ void check_sparse_solving(Eigen::SparseLU<Eigen::SparseMatrix<Scalar> >& solver,
x1.setZero();
// test with Map
MappedSparseMatrix<Scalar,Mat::Options,StorageIndex> Am(A.rows(), A.cols(), A.nonZeros(), const_cast<StorageIndex*>(A.outerIndexPtr()), const_cast<StorageIndex*>(A.innerIndexPtr()), const_cast<Scalar*>(A.valuePtr()));
Map<SparseMatrix<Scalar,Mat::Options,StorageIndex> > Am(A.rows(), A.cols(), A.nonZeros(), const_cast<StorageIndex*>(A.outerIndexPtr()), const_cast<StorageIndex*>(A.innerIndexPtr()), const_cast<Scalar*>(A.valuePtr()));
solver.compute(Am);
VERIFY(solver.info() == Success && "factorization failed when using Map");
DenseRhs dx(refX1);