26 using namespace gtsam;
80 actual.
augment(fg2, newIndices);
104 vector<size_t> indices;
105 indices.push_back(0); indices.push_back(1); indices.push_back(2); indices.push_back(3);
106 actual.
remove(indices.begin(), indices.end(), fg1);
107 std::list<Key> unusedVariables{0, 9};
131 vector<size_t> indices;
132 indices.push_back(0); indices.push_back(1); indices.push_back(2); indices.push_back(3);
133 clone.
remove(indices.begin(), indices.end(), fg1);
134 std::list<Key> unusedVariables{0, 9};
Provides additional testing facilities for common data structures.
static int runAllTests(TestResult &result)
size_t size() const
The number of variable entries. This is equal to the number of unique variable Keys.
std::shared_ptr< This > shared_ptr
SymbolicFactorGraph testGraph2()
IsDerived< DERIVEDFACTOR > push_back(std::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
size_t nEntries() const
The number of nonzero blocks, i.e. the number of variable-factor entries.
TEST(VariableIndex, augment)
size_t nFactors() const
The number of factors in the original factor graph.
SymbolicFactorGraph testGraph1()
void augment(const FG &factors, const FactorIndices *newFactorIndices=nullptr)
FastVector< FactorIndex > FactorIndices
Define collection types:
void remove(ITERATOR firstFactor, ITERATOR lastFactor, const FG &factors)
void push_factor(Key key)
#define EXPECT(condition)
#define LONGS_EQUAL(expected, actual)
void removeUnusedVariables(ITERATOR firstKey, ITERATOR lastKey)
Remove unused empty variables (in debug mode verifies they are empty).