added missing square matrix specialization - without it, square to square cases would be ambiguous.
parent
00765d9bf3
commit
fed2c8b684
|
@ -303,6 +303,15 @@ struct Reshape {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Reshape specialization that does nothing as shape stays the same (needed to not be ambiguous for square input equals square output)
|
||||||
|
template <int M, int InOptions>
|
||||||
|
struct Reshape<M, M, M, M, InOptions> {
|
||||||
|
typedef const Eigen::Matrix<double, M, M, InOptions> & ReshapedType;
|
||||||
|
static inline ReshapedType reshape(const Eigen::Matrix<double, M, M, InOptions> & in) {
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/// Reshape specialization that does nothing as shape stays the same
|
/// Reshape specialization that does nothing as shape stays the same
|
||||||
template <int M, int N, int InOptions>
|
template <int M, int N, int InOptions>
|
||||||
struct Reshape<M, N, M, N, InOptions> {
|
struct Reshape<M, N, M, N, InOptions> {
|
||||||
|
|
|
@ -96,6 +96,15 @@ TEST(Manifold, DefaultChart) {
|
||||||
EXPECT(chart.retract(m, Vector2(1, 2)) == 2 * m);
|
EXPECT(chart.retract(m, Vector2(1, 2)) == 2 * m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
typedef Eigen::Matrix<double, 1, 1> ManifoldPoint;
|
||||||
|
ManifoldPoint m;
|
||||||
|
DefaultChart<ManifoldPoint> chart;
|
||||||
|
m << 1;
|
||||||
|
EXPECT(assert_equal(Vector(ManifoldPoint::Ones()), Vector(chart.local(ManifoldPoint::Zero(), m))));
|
||||||
|
EXPECT(chart.retract(m, ManifoldPoint::Ones()) == 2 * m);
|
||||||
|
}
|
||||||
|
|
||||||
DefaultChart<double> chart3;
|
DefaultChart<double> chart3;
|
||||||
Vector v1(1);
|
Vector v1(1);
|
||||||
v1 << 1;
|
v1 << 1;
|
||||||
|
|
Loading…
Reference in New Issue