mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix compiler warnings from GCC 13 and Clang 18
libeigen/eigen!2146 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
@@ -84,7 +84,13 @@ class LDLT : public SolverBase<LDLT<MatrixType_, UpLo_> > {
|
|||||||
* The default constructor is useful in cases in which the user intends to
|
* The default constructor is useful in cases in which the user intends to
|
||||||
* perform decompositions via LDLT::compute(const MatrixType&).
|
* perform decompositions via LDLT::compute(const MatrixType&).
|
||||||
*/
|
*/
|
||||||
LDLT() : m_matrix(), m_transpositions(), m_sign(internal::ZeroSign), m_isInitialized(false) {}
|
LDLT()
|
||||||
|
: m_matrix(),
|
||||||
|
m_l1_norm(0),
|
||||||
|
m_transpositions(),
|
||||||
|
m_sign(internal::ZeroSign),
|
||||||
|
m_isInitialized(false),
|
||||||
|
m_info(InvalidInput) {}
|
||||||
|
|
||||||
/** \brief Default Constructor with memory preallocation
|
/** \brief Default Constructor with memory preallocation
|
||||||
*
|
*
|
||||||
@@ -94,10 +100,12 @@ class LDLT : public SolverBase<LDLT<MatrixType_, UpLo_> > {
|
|||||||
*/
|
*/
|
||||||
explicit LDLT(Index size)
|
explicit LDLT(Index size)
|
||||||
: m_matrix(size, size),
|
: m_matrix(size, size),
|
||||||
|
m_l1_norm(0),
|
||||||
m_transpositions(size),
|
m_transpositions(size),
|
||||||
m_temporary(size),
|
m_temporary(size),
|
||||||
m_sign(internal::ZeroSign),
|
m_sign(internal::ZeroSign),
|
||||||
m_isInitialized(false) {}
|
m_isInitialized(false),
|
||||||
|
m_info(InvalidInput) {}
|
||||||
|
|
||||||
/** \brief Constructor with decomposition
|
/** \brief Constructor with decomposition
|
||||||
*
|
*
|
||||||
@@ -108,10 +116,12 @@ class LDLT : public SolverBase<LDLT<MatrixType_, UpLo_> > {
|
|||||||
template <typename InputType>
|
template <typename InputType>
|
||||||
explicit LDLT(const EigenBase<InputType>& matrix)
|
explicit LDLT(const EigenBase<InputType>& matrix)
|
||||||
: m_matrix(matrix.rows(), matrix.cols()),
|
: m_matrix(matrix.rows(), matrix.cols()),
|
||||||
|
m_l1_norm(0),
|
||||||
m_transpositions(matrix.rows()),
|
m_transpositions(matrix.rows()),
|
||||||
m_temporary(matrix.rows()),
|
m_temporary(matrix.rows()),
|
||||||
m_sign(internal::ZeroSign),
|
m_sign(internal::ZeroSign),
|
||||||
m_isInitialized(false) {
|
m_isInitialized(false),
|
||||||
|
m_info(InvalidInput) {
|
||||||
compute(matrix.derived());
|
compute(matrix.derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,10 +135,12 @@ class LDLT : public SolverBase<LDLT<MatrixType_, UpLo_> > {
|
|||||||
template <typename InputType>
|
template <typename InputType>
|
||||||
explicit LDLT(EigenBase<InputType>& matrix)
|
explicit LDLT(EigenBase<InputType>& matrix)
|
||||||
: m_matrix(matrix.derived()),
|
: m_matrix(matrix.derived()),
|
||||||
|
m_l1_norm(0),
|
||||||
m_transpositions(matrix.rows()),
|
m_transpositions(matrix.rows()),
|
||||||
m_temporary(matrix.rows()),
|
m_temporary(matrix.rows()),
|
||||||
m_sign(internal::ZeroSign),
|
m_sign(internal::ZeroSign),
|
||||||
m_isInitialized(false) {
|
m_isInitialized(false),
|
||||||
|
m_info(InvalidInput) {
|
||||||
compute(matrix.derived());
|
compute(matrix.derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class LLT : public SolverBase<LLT<MatrixType_, UpLo_> > {
|
|||||||
* The default constructor is useful in cases in which the user intends to
|
* The default constructor is useful in cases in which the user intends to
|
||||||
* perform decompositions via LLT::compute(const MatrixType&).
|
* perform decompositions via LLT::compute(const MatrixType&).
|
||||||
*/
|
*/
|
||||||
LLT() : m_matrix(), m_isInitialized(false) {}
|
LLT() : m_matrix(), m_l1_norm(0), m_isInitialized(false), m_info(InvalidInput) {}
|
||||||
|
|
||||||
/** \brief Default Constructor with memory preallocation
|
/** \brief Default Constructor with memory preallocation
|
||||||
*
|
*
|
||||||
@@ -94,10 +94,11 @@ class LLT : public SolverBase<LLT<MatrixType_, UpLo_> > {
|
|||||||
* according to the specified problem \a size.
|
* according to the specified problem \a size.
|
||||||
* \sa LLT()
|
* \sa LLT()
|
||||||
*/
|
*/
|
||||||
explicit LLT(Index size) : m_matrix(size, size), m_isInitialized(false) {}
|
explicit LLT(Index size) : m_matrix(size, size), m_l1_norm(0), m_isInitialized(false), m_info(InvalidInput) {}
|
||||||
|
|
||||||
template <typename InputType>
|
template <typename InputType>
|
||||||
explicit LLT(const EigenBase<InputType>& matrix) : m_matrix(matrix.rows(), matrix.cols()), m_isInitialized(false) {
|
explicit LLT(const EigenBase<InputType>& matrix)
|
||||||
|
: m_matrix(matrix.rows(), matrix.cols()), m_l1_norm(0), m_isInitialized(false), m_info(InvalidInput) {
|
||||||
compute(matrix.derived());
|
compute(matrix.derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +110,8 @@ class LLT : public SolverBase<LLT<MatrixType_, UpLo_> > {
|
|||||||
* \sa LLT(const EigenBase&)
|
* \sa LLT(const EigenBase&)
|
||||||
*/
|
*/
|
||||||
template <typename InputType>
|
template <typename InputType>
|
||||||
explicit LLT(EigenBase<InputType>& matrix) : m_matrix(matrix.derived()), m_isInitialized(false) {
|
explicit LLT(EigenBase<InputType>& matrix)
|
||||||
|
: m_matrix(matrix.derived()), m_l1_norm(0), m_isInitialized(false), m_info(InvalidInput) {
|
||||||
compute(matrix.derived());
|
compute(matrix.derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,12 +73,12 @@ void array_for_matrix(const MatrixType& m) {
|
|||||||
VERIFY_IS_EQUAL(m1.block(0, 0, rows, 0).rowwise().prod(), ColVectorType::Ones(rows));
|
VERIFY_IS_EQUAL(m1.block(0, 0, rows, 0).rowwise().prod(), ColVectorType::Ones(rows));
|
||||||
|
|
||||||
// verify the const accessors exist
|
// verify the const accessors exist
|
||||||
const Scalar& ref_m1 = m.matrix().array().coeffRef(0);
|
const Scalar* ptr_m1 = &m.matrix().array().coeffRef(0);
|
||||||
const Scalar& ref_m2 = m.matrix().array().coeffRef(0, 0);
|
const Scalar* ptr_m2 = &m.matrix().array().coeffRef(0, 0);
|
||||||
const Scalar& ref_a1 = m.array().matrix().coeffRef(0);
|
const Scalar* ptr_a1 = &m.array().matrix().coeffRef(0);
|
||||||
const Scalar& ref_a2 = m.array().matrix().coeffRef(0, 0);
|
const Scalar* ptr_a2 = &m.array().matrix().coeffRef(0, 0);
|
||||||
VERIFY(&ref_a1 == &ref_m1);
|
VERIFY(ptr_a1 == ptr_m1);
|
||||||
VERIFY(&ref_a2 == &ref_m2);
|
VERIFY(ptr_a2 == ptr_m2);
|
||||||
|
|
||||||
// Check write accessors:
|
// Check write accessors:
|
||||||
m1.array().coeffRef(0, 0) = 1;
|
m1.array().coeffRef(0, 0) = 1;
|
||||||
|
|||||||
@@ -1687,10 +1687,6 @@ void packetmath_complex() {
|
|||||||
CHECK_CWISE1_N(std::log, internal::plog, size);
|
CHECK_CWISE1_N(std::log, internal::plog, size);
|
||||||
|
|
||||||
// Test misc. corner cases.
|
// Test misc. corner cases.
|
||||||
const RealScalar zero = RealScalar(0);
|
|
||||||
const RealScalar one = RealScalar(1);
|
|
||||||
const RealScalar inf = std::numeric_limits<RealScalar>::infinity();
|
|
||||||
const RealScalar nan = std::numeric_limits<RealScalar>::quiet_NaN();
|
|
||||||
for (RealScalar x : {zero, one, inf}) {
|
for (RealScalar x : {zero, one, inf}) {
|
||||||
for (RealScalar y : {zero, one, inf}) {
|
for (RealScalar y : {zero, one, inf}) {
|
||||||
data1[0] = Scalar(x, y);
|
data1[0] = Scalar(x, y);
|
||||||
|
|||||||
Reference in New Issue
Block a user