mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 00:50:37 +08:00
Fix Eigen error in 2D sphere manifolds
Since Eigen does not allow to have a RowMajor column vector (see https://gitlab.com/libeigen/eigen/-/issues/416), the storage order must be set to ColMajor in that case. This fix adds that special case when generating 2D sphere manifolds. Change-Id: I594932e0dafc878e0b348f72524478588e61b34d
This commit is contained in:
@@ -114,12 +114,17 @@ class SphereManifold final : public Manifold {
|
||||
static constexpr int TangentSpaceDimension =
|
||||
AmbientSpaceDimension > 0 ? AmbientSpaceDimension - 1 : Eigen::Dynamic;
|
||||
|
||||
// NOTE: Eigen does not allow to have a RowMajor column vector.
|
||||
// In that case, change the storage order
|
||||
static constexpr int SafeRowMajor =
|
||||
TangentSpaceDimension == 1 ? Eigen::ColMajor : Eigen::RowMajor;
|
||||
|
||||
using AmbientVector = Eigen::Matrix<double, AmbientSpaceDimension, 1>;
|
||||
using TangentVector = Eigen::Matrix<double, TangentSpaceDimension, 1>;
|
||||
using MatrixPlusJacobian = Eigen::Matrix<double,
|
||||
AmbientSpaceDimension,
|
||||
TangentSpaceDimension,
|
||||
Eigen::RowMajor>;
|
||||
SafeRowMajor>;
|
||||
using MatrixMinusJacobian = Eigen::Matrix<double,
|
||||
TangentSpaceDimension,
|
||||
AmbientSpaceDimension,
|
||||
|
||||
Reference in New Issue
Block a user