![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <routing_filter_committables.h>
Public Member Functions | |
CommittableVector (size_t num_elements, const T &value) | |
Makes a vector with initial elements all committed to value. | |
size_t | Size () const |
Return the size of the vector. | |
T | Get (size_t index) const |
void | Set (size_t index, const T &value) |
Set the value stored at index in the current state to given value. | |
void | Revert () |
Changes the values of the vector to those in the last Commit(). | |
void | Commit () |
Makes the current state committed, clearing all changes. | |
void | SetAllAndCommit (const T &value) |
T | GetCommitted (size_t index) const |
Returns a copy of the value stored at index in the last committed state. | |
bool | HasChanged (size_t index) const |
const std::vector< size_t > & | ChangedIndices () const |
Definition at line 58 of file routing_filter_committables.h.
|
inline |
Makes a vector with initial elements all committed to value.
Definition at line 54 of file routing_filter_committables.h.
|
inline |
Returns the set of indices that have been Set() since the last Commit() or Revert().
Definition at line 118 of file routing_filter_committables.h.
|
inline |
Makes the current state committed, clearing all changes.
Definition at line 92 of file routing_filter_committables.h.
|
inline |
Returns a copy of the value stored at index in the current state. Does not return a reference, because the class needs to know when elements are modified.
Definition at line 70 of file routing_filter_committables.h.
|
inline |
Returns a copy of the value stored at index in the last committed state.
Definition at line 107 of file routing_filter_committables.h.
|
inline |
Return true iff the value at index has been Set() since the last Commit() or Revert(), even if the current value is the same as the committed value.
Definition at line 114 of file routing_filter_committables.h.
|
inline |
Changes the values of the vector to those in the last Commit().
Definition at line 84 of file routing_filter_committables.h.
|
inline |
Set the value stored at index in the current state to given value.
Definition at line 76 of file routing_filter_committables.h.
|
inline |
Sets all elements of this vector to given value, and commits to this state. Supposes that there are no changes since the last Commit() or Revert().
Definition at line 101 of file routing_filter_committables.h.
|
inline |
Return the size of the vector.
Definition at line 65 of file routing_filter_committables.h.