**Organization and Functionality:**
- We now rely on C++17 for `std::optional`
- We implement a new version of BanditPAM that considers only $n$ non-medoids as arms in the SWAP step, each of which has $k$ values. This leads to a significant speedup. The old BanditPAM is still available as `BanditPAM_orig`
- Update the GHA to use newer machine images and update the dependencies on Ubuntu 22.04
- Split the cmake build into a separate GHA
- Added Python 3.11 to GHA where possible, removed Python 3.6
- Restores the ability to call OpenMP functions `omp_get_max_threads` and `omp_set_num_threads`, which should resolve the remaining issues on M1 Macs
- We allow users to pass in a distance matrix (Fixes 164 )
- Now uses `buildConfidence` and `swapConfidence` in log (ln) space
- Allows users to retrieve the sample complexities and caching statistics
- Adds `scripts/cache_measurements.py`, `scripts/compare_banditpam_versions.py`, `scripts/comparison_utils.py`, `scripts/comparison_with_fasterpam.py`, `scripts/dist_mat_test.py`, `scripts/timing_dist_mat.py`, `scripts/sample_complexity_with_k.py`, and `scripts/scaling_with_k.py`
- Properly builds Mac wheels using Apple Clang and enabling OpenMP. Tested across both Intel and M1 Macs for `gcc`- and `clang`- compiled Python.
- Adding `parallelize` flag that only uses OpenMP parallelization if set to `true`, i.e., replacing all `pragma omp parallel for` with `pragma omp parallel for if (this->parallelize)`
- Fixing an issue with the python bindings where variable orderings didn't match so they were getting intialized with each other's values
- Changes `max_iter` to `100`
- Added `tests/test_initialization.py`, but this is not run by GHA
- Implements caching of distance computations. Also allows for retrieving cache statistics (hits, misses, writes)
- Allows setting cache parameters (`useCache`, `usePerm`, etc.) from Python
- Allows setting `parallelize` from Python
**Tests:**
- Added `tests/test_initialization.py`, but this is not run by GHA
**Style:**
- Ran `black` over codebase.
**Documentation:**
- Documented new capabilities.
**Full Changelog**: https://github.com/motiwari/BanditPAM/compare/v3.0.4...v4.0.0