mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-16 21:55:58 +08:00
Prevent BDCSVD crash caused by index out of bounds.
This commit is contained in:
parent
798fc1c577
commit
028ab12586
@ -1097,7 +1097,14 @@ void BDCSVD<MatrixType, Options>::perturbCol0(const ArrayRef& col0, const ArrayR
|
|||||||
std::cout << " " << "j=" << j << "\n";
|
std::cout << " " << "j=" << j << "\n";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Index j = i<k ? i : perm(l-1);
|
// Avoid index out of bounds.
|
||||||
|
// Will end up setting zhat(k) = 0.
|
||||||
|
if (l == 0) {
|
||||||
|
m_info = NumericalIssue;
|
||||||
|
prod = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Index j = i<k ? i : l > 0 ? perm(l-1) : i;
|
||||||
#ifdef EIGEN_BDCSVD_SANITY_CHECKS
|
#ifdef EIGEN_BDCSVD_SANITY_CHECKS
|
||||||
if(!(dk!=Literal(0) || diag(i)!=Literal(0)))
|
if(!(dk!=Literal(0) || diag(i)!=Literal(0)))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user