25 #include <boost/assign/std/list.hpp> 26 #include <boost/assign/list_of.hpp> 30 using namespace gtsam;
84 actual.
augment(fg2, newIndices);
108 vector<size_t> indices;
109 indices.push_back(0); indices.push_back(1); indices.push_back(2); indices.push_back(3);
110 actual.
remove(indices.begin(), indices.end(), fg1);
111 std::list<Key> unusedVariables; unusedVariables += 0, 9;
135 vector<size_t> indices;
136 indices.push_back(0); indices.push_back(1); indices.push_back(2); indices.push_back(3);
137 clone.
remove(indices.begin(), indices.end(), fg1);
138 std::list<Key> unusedVariables; unusedVariables += 0, 9;
Provides additional testing facilities for common data structures.
static int runAllTests(TestResult &result)
void augment(const FG &factors, boost::optional< const FactorIndices & > newFactorIndices=boost::none)
SymbolicFactorGraph testGraph2()
FastVector< FactorIndex > FactorIndices
Define collection types:
TEST(VariableIndex, augment)
IsDerived< DERIVEDFACTOR > push_back(boost::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
size_t size() const
The number of variable entries. This is equal to the number of unique variable Keys.
SymbolicFactorGraph testGraph1()
void remove(ITERATOR firstFactor, ITERATOR lastFactor, const FG &factors)
void push_factor(Key key)
#define EXPECT(condition)
size_t nEntries() const
The number of nonzero blocks, i.e. the number of variable-factor entries.
boost::shared_ptr< This > shared_ptr
#define LONGS_EQUAL(expected, actual)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
size_t nFactors() const
The number of factors in the original factor graph.
void removeUnusedVariables(ITERATOR firstKey, ITERATOR lastKey)
Remove unused empty variables (in debug mode verifies they are empty).