mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-30 15:54:13 +08:00
simplification
This commit is contained in:
parent
126a8e6a69
commit
abb2a1bb15
@ -294,8 +294,6 @@ JacobiSVD<MatrixType, Options>& JacobiSVD<MatrixType, Options>::compute(const Ma
|
|||||||
int rows = matrix.rows();
|
int rows = matrix.rows();
|
||||||
int cols = matrix.cols();
|
int cols = matrix.cols();
|
||||||
int diagSize = std::min(rows, cols);
|
int diagSize = std::min(rows, cols);
|
||||||
if(ComputeU) m_matrixU = MatrixUType::Zero(rows,rows);
|
|
||||||
if(ComputeV) m_matrixV = MatrixVType::Zero(cols,cols);
|
|
||||||
m_singularValues.resize(diagSize);
|
m_singularValues.resize(diagSize);
|
||||||
const RealScalar precision = 2 * epsilon<Scalar>();
|
const RealScalar precision = 2 * epsilon<Scalar>();
|
||||||
|
|
||||||
@ -303,8 +301,8 @@ JacobiSVD<MatrixType, Options>& JacobiSVD<MatrixType, Options>::compute(const Ma
|
|||||||
&& !ei_svd_precondition_if_more_cols_than_rows<MatrixType, Options>::run(matrix, work_matrix, *this))
|
&& !ei_svd_precondition_if_more_cols_than_rows<MatrixType, Options>::run(matrix, work_matrix, *this))
|
||||||
{
|
{
|
||||||
work_matrix = matrix.block(0,0,diagSize,diagSize);
|
work_matrix = matrix.block(0,0,diagSize,diagSize);
|
||||||
if(ComputeU) m_matrixU.diagonal().setOnes();
|
if(ComputeU) m_matrixU.setIdentity(rows,rows);
|
||||||
if(ComputeV) m_matrixV.diagonal().setOnes();
|
if(ComputeV) m_matrixV.setIdentity(cols,cols);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user