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

Method same

gecode/kernel/data/array.hpp:1385–1402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1383
1384 template<class View>
1385 bool
1386 ViewArray<View>::same(void) const {
1387 if (n < 2)
1388 return false;
1389 Region r;
1390 View* y = r.alloc<View>(n);
1391 int j=0;
1392 for (int i=0; i<n; i++)
1393 if (!x[i].assigned())
1394 y[j++] = x[i];
1395 if (j < 2)
1396 return false;
1397 Support::quicksort<View>(y,j);
1398 for (int i=1; i<j; i++)
1399 if (y[i-1] == y[i])
1400 return true;
1401 return false;
1402 }
1403
1404 template<class View>
1405 bool

Callers 5

postMethod · 0.45
postMethod · 0.45
postMethod · 0.45
postMethod · 0.45
postMethod · 0.45

Calls 1

assignedMethod · 0.45

Tested by

no test coverage detected