| 39 | namespace Gecode { namespace Int { namespace LDSB { |
| 40 | |
| 41 | std::pair<int,int> |
| 42 | findVar(int *indices, unsigned int n_values, unsigned int seq_size, int index) { |
| 43 | unsigned int seq = 0; |
| 44 | unsigned int pos = 0; |
| 45 | for (unsigned int i=0U ; i<n_values ; i++) { |
| 46 | if (indices[i] == index) |
| 47 | return std::pair<int,int>(seq,pos); |
| 48 | pos++; |
| 49 | if (pos == seq_size) { |
| 50 | pos = 0; |
| 51 | seq++; |
| 52 | } |
| 53 | } |
| 54 | return std::pair<int,int>(-1,-1); |
| 55 | } |
| 56 | |
| 57 | }}} |
| 58 |