mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-12 17:33:15 +08:00
fix bug in svd solve reported on forum, was apparently assuming square matrix, not sure how the unit test could work.
This commit is contained in:
parent
3979f6d8aa
commit
4c456d4211
@ -426,8 +426,11 @@ bool SVD<MatrixType>::solve(const MatrixBase<OtherDerived> &b, ResultType* resul
|
|||||||
else
|
else
|
||||||
aux.coeffRef(i) /= si;
|
aux.coeffRef(i) /= si;
|
||||||
}
|
}
|
||||||
|
const int cols = m_matV.rows();
|
||||||
result->col(j) = m_matV * aux;
|
const int minsize = std::min(rows,cols);
|
||||||
|
result->col(j).start(minsize) = aux.start(minsize);
|
||||||
|
if(cols>rows) result->col(j).end(cols-minsize).setZero();
|
||||||
|
result->col(j) = m_matV * result->col(j);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user