mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-20 08:39:37 +08:00
BDCSVD: Suppress Wmaybe-uninitialized
This commit is contained in:
parent
9d3d37c5b7
commit
c21a80be3d
@ -50,26 +50,6 @@ struct traits<BDCSVD<MatrixType_, Options> > : svd_traits<MatrixType_, Options>
|
||||
typedef MatrixType_ MatrixType;
|
||||
};
|
||||
|
||||
template <typename MatrixType, int Options>
|
||||
struct allocate_small_svd {
|
||||
static void run(JacobiSVD<MatrixType, Options>& smallSvd, Index rows, Index cols, unsigned int computationOptions) {
|
||||
(void)computationOptions;
|
||||
smallSvd = JacobiSVD<MatrixType, Options>(rows, cols);
|
||||
}
|
||||
};
|
||||
|
||||
EIGEN_DIAGNOSTICS(push)
|
||||
EIGEN_DISABLE_DEPRECATED_WARNING
|
||||
|
||||
template <typename MatrixType>
|
||||
struct allocate_small_svd<MatrixType, 0> {
|
||||
static void run(JacobiSVD<MatrixType>& smallSvd, Index rows, Index cols, unsigned int computationOptions) {
|
||||
smallSvd = JacobiSVD<MatrixType>(rows, cols, computationOptions);
|
||||
}
|
||||
};
|
||||
|
||||
EIGEN_DIAGNOSTICS(pop)
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
/** \ingroup SVD_Module
|
||||
@ -289,7 +269,7 @@ void BDCSVD<MatrixType, Options>::allocate(Index rows, Index cols, unsigned int
|
||||
if (Base::allocate(rows, cols, computationOptions)) return;
|
||||
|
||||
if (cols < m_algoswap)
|
||||
internal::allocate_small_svd<MatrixType, ComputationOptions>::run(smallSvd, rows, cols, computationOptions);
|
||||
smallSvd.allocate(rows, cols, Options == 0 ? computationOptions : internal::get_computation_options(Options));
|
||||
|
||||
m_computed = MatrixXr::Zero(diagSize() + 1, diagSize());
|
||||
m_compU = computeV();
|
||||
|
@ -611,7 +611,6 @@ class JacobiSVD : public SVDBase<JacobiSVD<MatrixType_, Options_> > {
|
||||
using Base::rank;
|
||||
using Base::rows;
|
||||
|
||||
private:
|
||||
void allocate(Index rows_, Index cols_, unsigned int computationOptions) {
|
||||
if (Base::allocate(rows_, cols_, computationOptions)) return;
|
||||
eigen_assert(!(ShouldComputeThinU && int(QRPreconditioner) == int(FullPivHouseholderQRPreconditioner)) &&
|
||||
@ -624,6 +623,7 @@ class JacobiSVD : public SVDBase<JacobiSVD<MatrixType_, Options_> > {
|
||||
if (rows() > cols()) m_qr_precond_morerows.allocate(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
JacobiSVD& compute_impl(const MatrixType& matrix, unsigned int computationOptions);
|
||||
|
||||
protected:
|
||||
|
Loading…
x
Reference in New Issue
Block a user