fix maybe unitialized warning

release/4.3a0
jmackay2 2025-02-24 22:28:38 -05:00
parent 08147c7011
commit ecee078c0f
1 changed files with 3 additions and 4 deletions

View File

@ -9,10 +9,6 @@
#include <gtsam/geometry/FundamentalMatrix.h>
#include <gtsam/geometry/Point2.h>
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
namespace gtsam {
//*************************************************************************
@ -40,6 +36,9 @@ FundamentalMatrix::FundamentalMatrix(const Matrix3& U, double s,
FundamentalMatrix::FundamentalMatrix(const Matrix3& F) {
// Perform SVD
Eigen::JacobiSVD<Matrix3> svd(F, Eigen::ComputeFullU | Eigen::ComputeFullV);
if (svd.info() != Eigen::ComputationInfo::Success) {
throw std::runtime_error("FundamentalMatrix::FundamentalMatrix: SVD computation failure");
}
// Extract U and V
Matrix3 U = svd.matrixU();