Generalization of the inner iterations algorithm.

Add automatic recursive independent set decomposition.
Clean up the naming and the API for inner iterations.

Change-Id: I3d7d6babb9756842d7367e14b7279d2df98fb724
This commit is contained in:
Sameer Agarwal
2012-10-02 00:48:57 -07:00
parent 2c94eed50f
commit ba8d967f8c
19 changed files with 538 additions and 386 deletions
+26
View File
@@ -133,5 +133,31 @@ TEST(OrderedGroup, AddAndRemoveEveryThingFromOneGroup) {
EXPECT_EQ(ordering.GroupId(x + 2), 5);
}
TEST(OrderedGroup, ReverseOrdering) {
ParameterBlockOrdering ordering;
double x[3];
ordering.AddElementToGroup(x, 1);
ordering.AddElementToGroup(x + 1, 2);
ordering.AddElementToGroup(x + 2, 2);
EXPECT_EQ(ordering.NumGroups(), 2);
EXPECT_EQ(ordering.NumElements(), 3);
EXPECT_EQ(ordering.GroupSize(1), 1);
EXPECT_EQ(ordering.GroupSize(2), 2);
EXPECT_EQ(ordering.GroupId(x), 1);
EXPECT_EQ(ordering.GroupId(x + 1), 2);
EXPECT_EQ(ordering.GroupId(x + 2), 2);
ordering.Reverse();
EXPECT_EQ(ordering.NumGroups(), 2);
EXPECT_EQ(ordering.NumElements(), 3);
EXPECT_EQ(ordering.GroupSize(3), 1);
EXPECT_EQ(ordering.GroupSize(2), 2);
EXPECT_EQ(ordering.GroupId(x), 3);
EXPECT_EQ(ordering.GroupId(x + 1), 2);
EXPECT_EQ(ordering.GroupId(x + 2), 2);
}
} // namespace internal
} // namespace ceres