mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 12:19:12 +08:00
fix bug #128 : tridiagonalization failed for 1x1 matrices
This commit is contained in:
parent
17de59278b
commit
bacd531862
@ -356,12 +356,13 @@ namespace internal {
|
|||||||
template<typename MatrixType, typename CoeffVectorType>
|
template<typename MatrixType, typename CoeffVectorType>
|
||||||
void tridiagonalization_inplace(MatrixType& matA, CoeffVectorType& hCoeffs)
|
void tridiagonalization_inplace(MatrixType& matA, CoeffVectorType& hCoeffs)
|
||||||
{
|
{
|
||||||
eigen_assert(matA.rows()==matA.cols());
|
|
||||||
eigen_assert(matA.rows()==hCoeffs.size()+1);
|
|
||||||
typedef typename MatrixType::Index Index;
|
typedef typename MatrixType::Index Index;
|
||||||
typedef typename MatrixType::Scalar Scalar;
|
typedef typename MatrixType::Scalar Scalar;
|
||||||
typedef typename MatrixType::RealScalar RealScalar;
|
typedef typename MatrixType::RealScalar RealScalar;
|
||||||
Index n = matA.rows();
|
Index n = matA.rows();
|
||||||
|
eigen_assert(n==matA.cols());
|
||||||
|
eigen_assert(n==hCoeffs.size()+1 || n==1);
|
||||||
|
|
||||||
for (Index i = 0; i<n-1; ++i)
|
for (Index i = 0; i<n-1; ++i)
|
||||||
{
|
{
|
||||||
Index remainingSize = n-i-1;
|
Index remainingSize = n-i-1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user