mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 00:50:37 +08:00
Add ExpressionGraph::Erase(ExpressionId)
Add the function ExpressionGraph::Erase and a test-case for it. Erase removes the given expression from the graph by shifting all later expressions to the front. Indices and references are updated accordingly. Change-Id: Ic0449ccf28b369600fd2959a7e2a919d47f4cbe3
This commit is contained in:
@@ -64,6 +64,12 @@ class ExpressionGraph {
|
||||
|
||||
int Size() const { return expressions_.size(); }
|
||||
|
||||
// Erases the expression at "location". All expression after "location" are
|
||||
// moved by one element to the front. References to moved expressions are
|
||||
// updated. Removing an expression that is still referenced somewhere is
|
||||
// undefined behaviour.
|
||||
void Erase(ExpressionId location);
|
||||
|
||||
// Insert a new expression at "location" into the graph. All expression
|
||||
// after "location" are moved by one element to the back. References to
|
||||
// moved expressions are updated.
|
||||
|
||||
Reference in New Issue
Block a user