Macaulay2 Engine
Loading...
Searching...
No Matches

◆ isValid() [3/3]

bool Subsets::isValid ( size_t nElements,
size_t subsetSize,
const size_t * a )
static

Definition at line 47 of file comb.cpp.

48{
49 if (subsetSize > nElements) return false;
50 if (subsetSize == 0) return true;
51 if (a[subsetSize - 1] > nElements) return false;
52 for (size_t i = 1; i < subsetSize; i++)
53 if (a[i] <= a[i - 1]) return false;
54 return true;
55}