Skip to content

Commit a83c50d

Browse files
authored
Merge pull request #2033 from jmackay2/fix_maybe_uninitialized
fix maybe unitialized warning
2 parents 08147c7 + ecee078 commit a83c50d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

gtsam/geometry/FundamentalMatrix.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
#include <gtsam/geometry/FundamentalMatrix.h>
1010
#include <gtsam/geometry/Point2.h>
1111

12-
#if defined(__GNUC__) && !defined(__clang__)
13-
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
14-
#endif
15-
1612
namespace gtsam {
1713

1814
//*************************************************************************
@@ -40,6 +36,9 @@ FundamentalMatrix::FundamentalMatrix(const Matrix3& U, double s,
4036
FundamentalMatrix::FundamentalMatrix(const Matrix3& F) {
4137
// Perform SVD
4238
Eigen::JacobiSVD<Matrix3> svd(F, Eigen::ComputeFullU | Eigen::ComputeFullV);
39+
if (svd.info() != Eigen::ComputationInfo::Success) {
40+
throw std::runtime_error("FundamentalMatrix::FundamentalMatrix: SVD computation failure");
41+
}
4342

4443
// Extract U and V
4544
Matrix3 U = svd.matrixU();

0 commit comments

Comments
 (0)