| 25 | |
| 26 | template <typename T> |
| 27 | void vector_incr(vector<T> &vec, size_t pos, T v) { |
| 28 | if (pos >= vec.size()) { |
| 29 | /* resize the vector so that we can increase, |
| 30 | * pos + 8 is to reduce the number of resize op */ |
| 31 | vec.resize(pos + 2, 0); |
| 32 | } |
| 33 | |
| 34 | vec[pos] += v; |
| 35 | } |
| 36 | |
| 37 | // static inline void my_assert(bool b, const std::string &msg) { |
| 38 | // if (!b) { |