Introduce a histogram filter for filtering discrete values

This commit is contained in:
Chris Cannam
2022-06-10 12:35:15 +01:00
parent 10e2c13551
commit 6940ad29d8
6 changed files with 438 additions and 4 deletions

View File

@@ -107,6 +107,11 @@ private:
// precondition: sorted contains m_length values, one of which is toDrop
// postcondition: sorted contains m_length values, one of which is toPut
// (and one instance of toDrop has been removed)
// This implementation was timed for rather short filters (no
// longer than maybe 16 items). Two binary searches plus a
// memmove should be faster for longer ones.
const int n = m_length;
T *sorted = sortedFor(filter);
int dropIx;