24 #include <tr1/unordered_map>
35 virtual void init(T&) = 0;
49 tr1::unordered_map<long, T> map;
51 cloned_ptr< IndexMapInit<T> > init;
73 T& operator[] (
long j) {
74 assert(indexSet.contains(j));
77 const T& operator[] (
long j)
const {
78 assert(indexSet.contains(j));
81 tr1::unordered_map<long, T> & map1 =
82 const_cast< tr1::unordered_map<long, T> &
> (map);
90 if (!indexSet.contains(j)) {
92 if (!init.null()) init->init(map[j]);
101 void remove(
long j) { indexSet.remove(j); map.erase(j); }
122 if (map1[i] == map2[i])
continue;
130 return !(map1 == map2);