Fix Matrix_(...) to Mat() <<…
parent
2896a45d1f
commit
e4d56df32e
|
|
@ -1,80 +1,80 @@
|
||||||
3 7 19
|
3 7 19
|
||||||
|
|
||||||
0 0 -385.989990234375 387.1199951171875
|
0 0 -385.989990234375 387.1199951171875
|
||||||
1 0 -38.439998626708984 492.1199951171875
|
1 0 -38.439998626708984375 492.1199951171875
|
||||||
2 0 -667.91998291015625 123.11000061035156
|
2 0 -667.91998291015625 123.1100006103515625
|
||||||
0 1 383.8800048828125 -15.299989700317383
|
0 1 383.8800048828125 -15.299989700317382812
|
||||||
1 1 559.75 -106.15000152587891
|
1 1 559.75 -106.15000152587890625
|
||||||
0 2 591.54998779296875 136.44000244140625
|
0 2 591.54998779296875 136.44000244140625
|
||||||
1 2 863.8599853515625 -23.469970703125
|
1 2 863.8599853515625 -23.469970703125
|
||||||
2 2 494.72000122070312 112.51999664306641
|
2 2 494.720001220703125 112.51999664306640625
|
||||||
0 3 592.5 125.75
|
0 3 592.5 125.75
|
||||||
1 3 861.08001708984375 -35.219970703125
|
1 3 861.08001708984375 -35.219970703125
|
||||||
2 3 498.54000854492187 101.55999755859375
|
2 3 498.540008544921875 101.55999755859375
|
||||||
0 4 348.72000122070312 558.3800048828125
|
0 4 348.720001220703125 558.3800048828125
|
||||||
1 4 776.030029296875 483.52999877929687
|
1 4 776.030029296875 483.529998779296875
|
||||||
2 4 7.7800288200378418 326.35000610351562
|
2 4 7.7800288200378417969 326.350006103515625
|
||||||
0 5 14.010009765625 96.420013427734375
|
0 5 14.010009765625 96.420013427734375
|
||||||
1 5 207.1300048828125 118.36000061035156
|
1 5 207.1300048828125 118.3600006103515625
|
||||||
0 6 202.75999450683594 340.989990234375
|
0 6 202.7599945068359375 340.989990234375
|
||||||
1 6 543.18011474609375 294.80999755859375
|
1 6 543.18011474609375 294.80999755859375
|
||||||
2 6 -58.419979095458984 110.83000183105469
|
2 6 -58.419979095458984375 110.8300018310546875
|
||||||
|
|
||||||
0.29656188120312943
|
0.29656188120312942935
|
||||||
-0.03531835438428587
|
-0.035318354384285870207
|
||||||
0.31252101755032047
|
0.31252101755032046793
|
||||||
0.47230274932665989
|
0.47230274932665988752
|
||||||
-0.35723408637441134
|
-0.3572340863744113415
|
||||||
-2.0517704282499576
|
-2.0517704282499575896
|
||||||
1430.031982421875
|
1430.031982421875
|
||||||
-7.5572756941255648e-008
|
-7.5572756941255647689e-08
|
||||||
3.2377570134516087e-014
|
3.2377570134516087119e-14
|
||||||
|
|
||||||
0.28532097290364833
|
0.28532097381985194184
|
||||||
-0.27699838355720618
|
-0.27699838370789808817
|
||||||
0.048601170006498565
|
0.048601169984112867206
|
||||||
-1.2598695987678452
|
-1.2598695987143850861
|
||||||
-0.04906379852479037
|
-0.049063798188844320869
|
||||||
-1.9586867140054638
|
-1.9586867140445654023
|
||||||
1432.137451171875
|
1432.137451171875
|
||||||
-7.317191830225056e-008
|
-7.3171918302250560373e-08
|
||||||
3.1759419042137055e-014
|
3.1759419042137054801e-14
|
||||||
|
|
||||||
0.057491325683772541
|
0.057491325683772541433
|
||||||
0.34853090049579966
|
0.34853090049579965592
|
||||||
0.47985129303736057
|
0.47985129303736057116
|
||||||
8.196390428906339
|
8.1963904289063389541
|
||||||
6.5146840788718787
|
6.5146840788718787252
|
||||||
-3.8392804395897406
|
-3.8392804395897406344
|
||||||
1572.047119140625
|
1572.047119140625
|
||||||
-1.5962623223231276e-008
|
-1.5962623223231275915e-08
|
||||||
-1.6507904730136101e-014
|
-1.6507904730136101212e-14
|
||||||
|
|
||||||
-11.317351620610928
|
-11.317351620610928364
|
||||||
3.3594874875767187
|
3.3594874875767186673
|
||||||
-42.755222607849106
|
-42.755222607849105998
|
||||||
|
|
||||||
4.2648515634753199
|
4.2648515634753199066
|
||||||
-8.4629358700849355
|
-8.4629358700849355301
|
||||||
-22.252086323427271
|
-22.252086323427270997
|
||||||
|
|
||||||
10.996977688149537
|
10.996977688149536689
|
||||||
-9.2123370180278048
|
-9.2123370180278048025
|
||||||
-29.206739014051372
|
-29.206739014051372294
|
||||||
|
|
||||||
10.935342607054865
|
10.935342607054865383
|
||||||
-9.4338917557810742
|
-9.4338917557810741954
|
||||||
-29.1122639091755
|
-29.112263909175499776
|
||||||
|
|
||||||
15.71402493540176
|
15.714024935401759819
|
||||||
1.3745079651566265
|
1.3745079651566265433
|
||||||
-59.286834979937105
|
-59.286834979937104606
|
||||||
|
|
||||||
-1.3624227800805182
|
-1.3624227800805182031
|
||||||
-4.1979357415396095
|
-4.1979357415396094666
|
||||||
-21.034430148188399
|
-21.034430148188398846
|
||||||
|
|
||||||
6.7690173115899297
|
6.7690173115899296974
|
||||||
-4.7352452433700787
|
-4.7352452433700786827
|
||||||
-53.605307875695893
|
-53.605307875695892506
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ double timeColumn(size_t reps) {
|
||||||
*/
|
*/
|
||||||
double timeHouseholder(size_t reps) {
|
double timeHouseholder(size_t reps) {
|
||||||
// create a matrix
|
// create a matrix
|
||||||
Matrix Abase = Matrix_(4, 7,
|
Matrix Abase = Mat(4, 7) <<
|
||||||
-5, 0, 5, 0, 0, 0, -1,
|
-5, 0, 5, 0, 0, 0, -1,
|
||||||
00, -5, 0, 5, 0, 0, 1.5,
|
00, -5, 0, 5, 0, 0, 1.5,
|
||||||
10, 0, 0, 0,-10, 0, 2,
|
10, 0, 0, 0,-10, 0, 2,
|
||||||
|
|
|
||||||
|
|
@ -273,7 +273,7 @@ public:
|
||||||
boost::optional<Matrix&> Dpoint = boost::none) {
|
boost::optional<Matrix&> Dpoint = boost::none) {
|
||||||
if (Dpoint) {
|
if (Dpoint) {
|
||||||
double d = 1.0 / P.z(), d2 = d * d;
|
double d = 1.0 / P.z(), d2 = d * d;
|
||||||
*Dpoint = Matrix_(2, 3, d, 0.0, -P.x() * d2, 0.0, d, -P.y() * d2);
|
*Dpoint = (Mat(2, 3) << d, 0.0, -P.x() * d2, 0.0, d, -P.y() * d2);
|
||||||
}
|
}
|
||||||
return Point2(P.x() / P.z(), P.y() / P.z());
|
return Point2(P.x() / P.z(), P.y() / P.z());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ public:
|
||||||
* @return xihat, 3*3 element of Lie algebra that can be exponentiated
|
* @return xihat, 3*3 element of Lie algebra that can be exponentiated
|
||||||
*/
|
*/
|
||||||
static inline Matrix wedge(double vx, double vy, double w) {
|
static inline Matrix wedge(double vx, double vy, double w) {
|
||||||
return Matrix_(3,3,
|
return (Mat(3,3) <<
|
||||||
0.,-w, vx,
|
0.,-w, vx,
|
||||||
w, 0., vy,
|
w, 0., vy,
|
||||||
0., 0., 0.);
|
0., 0., 0.);
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ double Pose3::range(const Point3& point, boost::optional<Matrix&> H1,
|
||||||
Point3 d = transform_to(point, H1, H2);
|
Point3 d = transform_to(point, H1, H2);
|
||||||
double x = d.x(), y = d.y(), z = d.z(), d2 = x * x + y * y + z * z, n = sqrt(
|
double x = d.x(), y = d.y(), z = d.z(), d2 = x * x + y * y + z * z, n = sqrt(
|
||||||
d2);
|
d2);
|
||||||
Matrix D_result_d = Matrix_(1, 3, x / n, y / n, z / n);
|
Matrix D_result_d = (Mat(1, 3) << x / n, y / n, z / n);
|
||||||
if (H1)
|
if (H1)
|
||||||
*H1 = D_result_d * (*H1);
|
*H1 = D_result_d * (*H1);
|
||||||
if (H2)
|
if (H2)
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,7 @@ public:
|
||||||
* @return xihat, 4*4 element of Lie algebra that can be exponentiated
|
* @return xihat, 4*4 element of Lie algebra that can be exponentiated
|
||||||
*/
|
*/
|
||||||
static Matrix wedge(double wx, double wy, double wz, double vx, double vy, double vz) {
|
static Matrix wedge(double wx, double wy, double wz, double vx, double vy, double vz) {
|
||||||
return Matrix_(4,4,
|
return (Mat(4,4) <<
|
||||||
0.,-wz, wy, vx,
|
0.,-wz, wy, vx,
|
||||||
wz, 0.,-wx, vy,
|
wz, 0.,-wx, vy,
|
||||||
-wy, wx, 0., vz,
|
-wy, wx, 0., vz,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ using namespace gtsam;
|
||||||
|
|
||||||
GTSAM_CONCEPT_MANIFOLD_INST(CalibratedCamera)
|
GTSAM_CONCEPT_MANIFOLD_INST(CalibratedCamera)
|
||||||
|
|
||||||
static const Pose3 pose1(Matrix_(3,3,
|
static const Pose3 pose1((Matrix)(Mat(3,3) <<
|
||||||
1., 0., 0.,
|
1., 0., 0.,
|
||||||
0.,-1., 0.,
|
0.,-1., 0.,
|
||||||
0., 0.,-1.
|
0., 0.,-1.
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ using namespace gtsam;
|
||||||
|
|
||||||
static const Cal3_S2 K(625, 625, 0, 0, 0);
|
static const Cal3_S2 K(625, 625, 0, 0, 0);
|
||||||
|
|
||||||
static const Pose3 pose1(Matrix_(3,3,
|
static const Pose3 pose1((Matrix)(Mat(3,3) <<
|
||||||
1., 0., 0.,
|
1., 0., 0.,
|
||||||
0.,-1., 0.,
|
0.,-1., 0.,
|
||||||
0., 0.,-1.
|
0., 0.,-1.
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ TEST( Point2, norm ) {
|
||||||
// exception, for (0,0) derivative is [Inf,Inf] but we return [1,1]
|
// exception, for (0,0) derivative is [Inf,Inf] but we return [1,1]
|
||||||
actual = x1.norm(actualH);
|
actual = x1.norm(actualH);
|
||||||
EXPECT_DOUBLES_EQUAL(0, actual, 1e-9);
|
EXPECT_DOUBLES_EQUAL(0, actual, 1e-9);
|
||||||
expectedH = Matrix_(1, 2, 1.0, 1.0);
|
expectedH = (Mat(1, 2) << 1.0, 1.0);
|
||||||
EXPECT(assert_equal(expectedH,actualH));
|
EXPECT(assert_equal(expectedH,actualH));
|
||||||
|
|
||||||
actual = x2.norm(actualH);
|
actual = x2.norm(actualH);
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ TEST( StereoCamera, project)
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
||||||
static Pose3 camera1(Matrix_(3,3,
|
static Pose3 camera1((Matrix)(Mat(3,3) <<
|
||||||
1., 0., 0.,
|
1., 0., 0.,
|
||||||
0.,-1., 0.,
|
0.,-1., 0.,
|
||||||
0., 0.,-1.
|
0., 0.,-1.
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ int main()
|
||||||
{
|
{
|
||||||
int n = 100000;
|
int n = 100000;
|
||||||
|
|
||||||
const Pose3 pose1(Matrix_(3,3,
|
const Pose3 pose1((Matrix)(Mat(3,3) <<
|
||||||
1., 0., 0.,
|
1., 0., 0.,
|
||||||
0.,-1., 0.,
|
0.,-1., 0.,
|
||||||
0., 0.,-1.
|
0., 0.,-1.
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ int main()
|
||||||
{
|
{
|
||||||
int n = 1000000;
|
int n = 1000000;
|
||||||
|
|
||||||
const Pose3 pose1(Matrix_(3,3,
|
const Pose3 pose1((Matrix)(Mat(3,3) <<
|
||||||
1., 0., 0.,
|
1., 0., 0.,
|
||||||
0.,-1., 0.,
|
0.,-1., 0.,
|
||||||
0., 0.,-1.
|
0., 0.,-1.
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ Pose2 Pose2betweenOptimized(const Pose2& r1, const Pose2& r2,
|
||||||
if (H1) {
|
if (H1) {
|
||||||
double dt1 = -s2 * x + c2 * y;
|
double dt1 = -s2 * x + c2 * y;
|
||||||
double dt2 = -c2 * x - s2 * y;
|
double dt2 = -c2 * x - s2 * y;
|
||||||
*H1 = Matrix_(3,3,
|
*H1 = (Mat(3,3) <<
|
||||||
-c, -s, dt1,
|
-c, -s, dt1,
|
||||||
s, -c, dt2,
|
s, -c, dt2,
|
||||||
0.0, 0.0,-1.0);
|
0.0, 0.0,-1.0);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ int main()
|
||||||
{
|
{
|
||||||
int n = 100000;
|
int n = 100000;
|
||||||
|
|
||||||
const Pose3 pose1(Matrix_(3,3,
|
const Pose3 pose1((Matrix)(Mat(3,3) <<
|
||||||
1., 0., 0.,
|
1., 0., 0.,
|
||||||
0.,-1., 0.,
|
0.,-1., 0.,
|
||||||
0., 0.,-1.
|
0., 0.,-1.
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ using namespace std;
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
TEST(GaussianDensity, constructor)
|
TEST(GaussianDensity, constructor)
|
||||||
{
|
{
|
||||||
Matrix R = Matrix_(2,2,
|
Matrix R = (Mat(2,2) <<
|
||||||
-12.1244, -5.1962,
|
-12.1244, -5.1962,
|
||||||
0., 4.6904);
|
0., 4.6904);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue