TVecSmallInt.GroupCount Method

TVecInt GroupCount(TMtxVecInt SrcBins, Int32 SrcBinsMax)

Counts groups of equal numbers within Bins.

#NameTypeDescription
1SrcBinsTMtxVecIntsource TVecInt or TMtxInt
2SrcBinsMaxInt32

Result: stored in self (calling object), returns self for chaining

Remarks:

The maximum integer value within SrcBins parameter defines the Size of the calling vector. Within each IValues[Idx] of the result will be number of Bin items, which have value equal to "Idx". The size of self is set to SrcBins.Max+1. SrcBinsMax with default value of -1 indicates that Bins.Max is computed internally. The routine does not perform additional range checking, if BinsMax is provided explicitely (memory overwrite is possible, if indexes are less than zero or more than calling vector length).