MCPcopy Create free account
hub / github.com/Gecode/gecode / findVar

Function findVar

gecode/int/ldsb.cpp:41–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39namespace 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

Callers 2

symmetricMethod · 0.85
symmetricMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected