mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user