| 17 | template <typename T> |
| 18 | class SparseState { |
| 19 | struct State { |
| 20 | int position; |
| 21 | T value; |
| 22 | State(int position_, T value_) : position(position_), value(value_) { |
| 23 | } |
| 24 | inline bool operator<(const State &other) const { |
| 25 | return position < other.position; |
| 26 | } |
| 27 | inline bool operator==(const State &other) const { |
| 28 | return (position == other.position) && (value == other.value); |
| 29 | } |
| 30 | }; |
| 31 | int positionFirst; |
| 32 | typedef std::vector<State> stateVector; |
| 33 | stateVector states; |