Skip to content

Commit e8e8cf9

Browse files
committed
Cleanup eigen svd clang warning. Update svd options usage.
1 parent 6b73f3e commit e8e8cf9

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

gtsam/geometry/FundamentalMatrix.cpp

Lines changed: 4 additions & 5 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
//*************************************************************************
@@ -39,7 +35,10 @@ FundamentalMatrix::FundamentalMatrix(const Matrix3& U, double s,
3935

4036
FundamentalMatrix::FundamentalMatrix(const Matrix3& F) {
4137
// Perform SVD
42-
Eigen::JacobiSVD<Matrix3> svd(F, Eigen::ComputeFullU | Eigen::ComputeFullV);
38+
Eigen::JacobiSVD<Matrix3, Eigen::ComputeFullU | Eigen::ComputeFullV> svd(F);
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();

gtsam/geometry/Rot2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Rot2 Rot2::relativeBearing(const Point2& d, OptionalJacobian<1, 2> H) {
131131

132132
/* ************************************************************************* */
133133
Rot2 Rot2::ClosestTo(const Matrix2& M) {
134-
Eigen::JacobiSVD<Matrix2> svd(M, Eigen::ComputeFullU | Eigen::ComputeFullV);
134+
Eigen::JacobiSVD<Matrix2, Eigen::ComputeFullU | Eigen::ComputeFullV> svd(M);
135135
const Matrix2& U = svd.matrixU();
136136
const Matrix2& V = svd.matrixV();
137137
const double det = (U * V.transpose()).determinant();

gtsam/geometry/SO3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ SO3 SO3::AxisAngle(const Vector3& axis, double theta) {
200200
template <>
201201
GTSAM_EXPORT
202202
SO3 SO3::ClosestTo(const Matrix3& M) {
203-
Eigen::JacobiSVD<Matrix3> svd(M, Eigen::ComputeFullU | Eigen::ComputeFullV);
203+
Eigen::JacobiSVD<Matrix3, Eigen::ComputeFullU | Eigen::ComputeFullV> svd(M);
204204
const auto& U = svd.matrixU();
205205
const auto& V = svd.matrixV();
206206
const double det = (U * V.transpose()).determinant();

0 commit comments

Comments
 (0)