| 374 | |
| 375 | template<class Card> |
| 376 | forceinline int |
| 377 | PartialSum<Card>::sumup(int from, int to) const { |
| 378 | if (from <= to) { |
| 379 | return sum[to - firstValue] - sum[from - firstValue - 1]; |
| 380 | } else { |
| 381 | assert(to - firstValue - 1 >= 0); |
| 382 | assert(to - firstValue - 1 < size); |
| 383 | assert(from - firstValue >= 0); |
| 384 | assert(from - firstValue < size); |
| 385 | return sum[to - firstValue - 1] - sum[from - firstValue]; |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | template<class Card> |
| 390 | forceinline int |