mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 12:19:12 +08:00
Extend unit tests to check uncompressed sparse inputs in sparse solvers
This commit is contained in:
parent
1fa6fe2abd
commit
7a17639953
@ -67,6 +67,15 @@ void check_sparse_solving(Solver& solver, const typename Solver::MatrixType& A,
|
|||||||
VERIFY(oldb.isApprox(db) && "sparse solver testing: the rhs should not be modified!");
|
VERIFY(oldb.isApprox(db) && "sparse solver testing: the rhs should not be modified!");
|
||||||
VERIFY(x.isApprox(refX,test_precision<Scalar>()));
|
VERIFY(x.isApprox(refX,test_precision<Scalar>()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test uncompressed inputs
|
||||||
|
{
|
||||||
|
Mat A2 = A;
|
||||||
|
A2.reserve((ArrayXf::Random(A.outerSize())+2).template cast<typename Mat::Index>().eval());
|
||||||
|
solver.compute(A2);
|
||||||
|
Rhs x = solver.solve(b);
|
||||||
|
VERIFY(x.isApprox(refX,test_precision<Scalar>()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Solver, typename Rhs>
|
template<typename Solver, typename Rhs>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user