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

◆ isValid() [2/3]

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

Definition at line 56 of file comb.cpp.

57{
58 if (subsetSize > nElements) return false;
59 if (subsetSize == 0) return true;
60 if (a[subsetSize - 1] > nElements) return false;
61 for (size_t i = 1; i < subsetSize; i++)
62 if (a[i] <= a[i - 1]) return false;
63 return true;
64}