From 6e3f36dc634a1defee11ce858e100f0ae12b9f03 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sat, 12 Dec 2009 12:53:39 +0000 Subject: [PATCH] Trying different orderings --- cpp/gtsam.h | 1 + matlab/BeijingPose2Graph.m | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cpp/gtsam.h b/cpp/gtsam.h index d3aaf329e..a7a82a059 100644 --- a/cpp/gtsam.h +++ b/cpp/gtsam.h @@ -3,6 +3,7 @@ class Ordering { void push_back(string s); void print(string s) const; void unique (); + void reverse (); }; class SymbolicFactor{ diff --git a/matlab/BeijingPose2Graph.m b/matlab/BeijingPose2Graph.m index b3cfe2e55..4736659dc 100644 --- a/matlab/BeijingPose2Graph.m +++ b/matlab/BeijingPose2Graph.m @@ -1,7 +1,7 @@ load beijing.mat; load beijing_angles.mat; load beijing_graph.mat; -load beijing_config.mat; +%load beijing_config.mat; cov = [ 0.25, 0, 0; 0, 0.25, 0; 0, 0, 0.01]; @@ -12,7 +12,7 @@ ord = Ordering(); ord2 = Ordering(); for i=1:length(ways) - if mod(i,50) == 0 + if mod(i,500) == 0 fprintf(1, 'processing way %d\n', i); end for j=1:length(ways{i})-1 @@ -39,6 +39,8 @@ for i=1:length(ways) end ord.unique(); ord2.unique(); +% ord.reverse(); +% ord2.reverse(); if 0 config=Pose2Config(); @@ -69,9 +71,14 @@ figure(2) spy(A2); % show R factor -P = COLAMD(A); +R = qr(A,0); figure(3) +spy(R) + +% show re-ordered R factor +P = colamd(A); +figure(4) spy(A(:,P)) R = qr(A(:,P),0); -figure(4) +figure(5) spy(R)