Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup eigen svd clang warning. Update svd options usage. #2032

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions gtsam/geometry/FundamentalMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

//*************************************************************************
Expand All @@ -39,7 +35,10 @@ FundamentalMatrix::FundamentalMatrix(const Matrix3& U, double s,

FundamentalMatrix::FundamentalMatrix(const Matrix3& F) {
// Perform SVD
Eigen::JacobiSVD<Matrix3> svd(F, Eigen::ComputeFullU | Eigen::ComputeFullV);
Eigen::JacobiSVD<Matrix3, Eigen::ComputeFullU | Eigen::ComputeFullV> svd(F);
if (svd.info() != Eigen::ComputationInfo::Success) {
throw std::runtime_error("FundamentalMatrix::FundamentalMatrix: SVD computation failure.");
}

// Extract U and V
Matrix3 U = svd.matrixU();
Expand Down
2 changes: 1 addition & 1 deletion gtsam/geometry/Rot2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Rot2 Rot2::relativeBearing(const Point2& d, OptionalJacobian<1, 2> H) {

/* ************************************************************************* */
Rot2 Rot2::ClosestTo(const Matrix2& M) {
Eigen::JacobiSVD<Matrix2> svd(M, Eigen::ComputeFullU | Eigen::ComputeFullV);
Eigen::JacobiSVD<Matrix2, Eigen::ComputeFullU | Eigen::ComputeFullV> svd(M);
const Matrix2& U = svd.matrixU();
const Matrix2& V = svd.matrixV();
const double det = (U * V.transpose()).determinant();
Expand Down
2 changes: 1 addition & 1 deletion gtsam/geometry/SO3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ SO3 SO3::AxisAngle(const Vector3& axis, double theta) {
template <>
GTSAM_EXPORT
SO3 SO3::ClosestTo(const Matrix3& M) {
Eigen::JacobiSVD<Matrix3> svd(M, Eigen::ComputeFullU | Eigen::ComputeFullV);
Eigen::JacobiSVD<Matrix3, Eigen::ComputeFullU | Eigen::ComputeFullV> svd(M);
const auto& U = svd.matrixU();
const auto& V = svd.matrixV();
const double det = (U * V.transpose()).determinant();
Expand Down
Loading