Skip to main content

Algoat

Algoat is a high-performance C++20 algorithm library featuring smart fallback and dynamic algorithm dispatch based on data profiles and runtime configuration. It is designed to provide zero-overhead algorithmic primitives for both C++ and Python applications.

Features

  • Sorting Algorithms: Insertion Sort, Quick Sort, Merge Sort, Heap Sort, Tim Sort, Intro Sort, Block Sort, Radix Sort (LSD/MSD), Counting Sort, Bucket Sort, Shell Sort, Comb Sort, Cycle Sort, and Bitonic Sort.
  • Searching Algorithms: Linear Search, Binary Search, Interpolation Search.
  • Smart Dispatching: Automatically analyzes array profiles ($O(n)$) to select the optimal algorithm (e.g., Insertion Sort for small arrays, Merge Sort for nearly sorted sequences).
  • Runtime Configuration: Dynamic algorithm overrides via JSON configuration (nlohmann/json).
  • Python Integration: Zero-copy Python bindings via nanobind, allowing seamless execution over native Python lists and NumPy arrays.

Domain-Specific Numerics

Algoat implements highly specialized, non-comparative sorting algorithms to bypass the standard $O(N \log N)$ constraints of std::sort for specific numeric domains, significantly outperforming standard libraries:

  • Boolean Arrays (bool): Utilizes a branchless counting pass for $O(N)$ execution. (~23.0x speedup vs numpy.sort)
  • Float16 (numpy.float16): Employs a custom bit-flipping technique to maintain strict weak ordering without floating-point comparisons, coupled with an L2-aligned 16-bit Counting Sort. (~2.2x speedup vs numpy.sort)
  • Complex Numbers (complex64, complex128): Replaces lexicographical sorting with spatial ordering. Computes 64-bit Morton Z-order interleaved keys in $O(N)$, followed by a highly tuned 4-pass 16-bit Radix Sort to maximize 2D spatial locality. (~2.0x speedup vs numpy.sort)

Installation

Python (via pip)

Cross-platform binary wheels are available for Python 3.10+.

pip install algoat

C++ (via CMake / Source)

Algoat requires a C++20 compliant compiler and CMake 3.21+.

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target install

C++ (via Package Managers)

Conan 2.x:

conan install --requires algoat/0.1.0

vcpkg:

vcpkg install algoat

Usage

C++ Usage

#include <algoat/algoat.hpp>
#include <iostream>
#include <vector>
#include <span>

int main() {
    std::vector<int> data = {42, 7, 19, 100, 3, 55, 21};
    
    // Automatically selects the best sorting algorithm
    algoat::sort(std::span{data});
    
    // Automatically selects the best searching algorithm
    auto res = algoat::search(std::span{data}, 19);
    if (res) {
        std::cout << "Found 19 at index " << *res << "\n";
    }

    return 0;
}

Python Usage

import algoat
import numpy as np

# Smart dispatch — automatically routes to the O(N) Float16 hybrid sort
arr = np.random.rand(1_000_000).astype(np.float16)
sorted_arr = algoat.sort(arr) 

# Sort standard Python lists in-place
data = [42, 7, 19, 100, 3, 55, 21]
algoat.sort_inplace(data) # [3, 7, 19, 21, 42, 55, 100]

# Search in sorted data
index = algoat.search(data, 19)
print(index)  # 2

### Usage Examples Repository

For complete, runnable standalone examples of these APIs (including the NumPy benchmarking scripts), please see the dedicated example directories:
- **[C++ Examples](examples/cpp/README.md)**: Contains `basic_usage.cpp`.
- **[Python Examples](examples/python/README.md)**: Contains `basic_usage.py` and the `benchmark.py` NumPy speedup suite.

## Architecture

Algoat uses a Registry and Dispatcher pattern. Algorithms are registered using a `std::variant` to avoid vtable overhead. The `Dispatcher` dynamically analyzes incoming data using `DataTraits` (size, sortedness ratio) and selects an optimal algorithm if one is not explicitly configured via `AlgoConfig`.

Metadata

Release files for algoat 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for algoat 0.1.0
File Actions
algoat-0.1.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for algoat-0.1.0-cp312-abi3-win_amd64.whl
algoat-0.1.0-cp312-abi3-win32.whl CPython 3.12 abi3 Windows x86-32 Details for algoat-0.1.0-cp312-abi3-win32.whl
algoat-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for algoat-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
algoat-0.1.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for algoat-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
algoat-0.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for algoat-0.1.0-cp311-cp311-win_amd64.whl
algoat-0.1.0-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details for algoat-0.1.0-cp311-cp311-win32.whl
algoat-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for algoat-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
algoat-0.1.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for algoat-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
algoat-0.1.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for algoat-0.1.0-cp310-cp310-win_amd64.whl
algoat-0.1.0-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details for algoat-0.1.0-cp310-cp310-win32.whl
algoat-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for algoat-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
algoat-0.1.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for algoat-0.1.0-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 4.7 MB

Release files / algoat-0.1.0-cp312-abi3-win_amd64.whl

Download URL algoat-0.1.0-cp312-abi3-win_amd64.whl
Size 585.2 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f8d6425ef9296fef4d2678397407dcf350c9b937b6f3c80e03da68aa31482868
BLAKE2b-256 checksum
How to use checksums
798958df65550f7b1e88c0b306f227f5a96933b34504fcc2b75c3e812dc39cf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp312-abi3-win32.whl

Download URL algoat-0.1.0-cp312-abi3-win32.whl
Size 485.9 kB
Tags CPython 3.12 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
c512e2048309b86f49a4fb79951f21f38a1b0892b676d267e8790abfe6929deb
BLAKE2b-256 checksum
How to use checksums
45cfbe66d9af3bda207f135327f3bd483734c774e4b3e71b8a8216bcf066ef65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL algoat-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 266.6 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
0f9c37223fc0df3e54d94bb10c8978355eabad3e90b94baf9665d7130b4a2ffb
BLAKE2b-256 checksum
How to use checksums
ee33c175e37f475bc2455981ecb83430515d2c152107e8438cba492eb18fd4f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL algoat-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Size 242.0 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e49ad6276dd5d5b1fea5b61f88317314e522f241ffae8fbbfde9c917bb3335b8
BLAKE2b-256 checksum
How to use checksums
f14403f2202bbcefe5048530720f5ae83cedcce1f54a5370e55fc46ae7225612
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp311-cp311-win_amd64.whl

Download URL algoat-0.1.0-cp311-cp311-win_amd64.whl
Size 585.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
b68e675cf71dec954353d598c8db7487fde52b8f7e861d52da67783f9970bb0e
BLAKE2b-256 checksum
How to use checksums
97cbc6720210459705b58db7b57f488b35579915a83153b3d05f77a43b34449e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp311-cp311-win32.whl

Download URL algoat-0.1.0-cp311-cp311-win32.whl
Size 486.1 kB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
bcd3cd8b93f4d409c1f5129b96872f6baa75a891d2606575d1153c2fff530f84
BLAKE2b-256 checksum
How to use checksums
d5da21680cd6a15a1e16a076fe187ef4decff1e3834ec5110087a8815191d974
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL algoat-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 267.2 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c2dba01ca6b4b14dbaaf1361bcdb7f08869d4e8fb43aec6b3cdd9298f13471e4
BLAKE2b-256 checksum
How to use checksums
ea0d9d2d25581469d8436c279227282afe06227448311dcf3f82f38c3707a3c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL algoat-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Size 242.6 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
565a086edcf323fea3f7eccfd8948b93523f0d2a4bea67b6b9182002b34a223d
BLAKE2b-256 checksum
How to use checksums
399da6c47790cc43ce8e436acae3d3fd1480bc44e516665a24e98420c4b237f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp310-cp310-win_amd64.whl

Download URL algoat-0.1.0-cp310-cp310-win_amd64.whl
Size 585.9 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
7bb0d8c852da9c4dd8f61a8681592190260f85ddd42a9601ea714cd51a8b102f
BLAKE2b-256 checksum
How to use checksums
061455c1f19108654fd5a2f19ded0e8811d815806d848ac628975f9c2a463517
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp310-cp310-win32.whl

Download URL algoat-0.1.0-cp310-cp310-win32.whl
Size 486.2 kB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
e6c0d0f44abff23e1aa2be9664a7a97e4033af006f5da61f5018653b2a2ea4b9
BLAKE2b-256 checksum
How to use checksums
f9625e0f3658bfc9bccbcafc8adf02a4663efcad503d41f97f3bc3d1d4631d1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL algoat-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 267.5 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3ac22ce667965045acfbd78acff2cf43e68309fc30b81e6ba4e2830a7924a13e
BLAKE2b-256 checksum
How to use checksums
f3c709a8fd6cb25da1298506e1bc4c4255a049a72cecb48d97cd9f32b6e3e032
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / algoat-0.1.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL algoat-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Size 243.0 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0eee0392cfce6ffa840d656bcf1424d1779e4f8e1c0b2fddfc5cd4b842355a5f
BLAKE2b-256 checksum
How to use checksums
6a70b6132c16ad0c88f27a9dc15807741054fa720ad7782684ce4ca94ea59d58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Security for algoat 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 12 files in this release have been uploaded with provenance metadata.

Select from 12 files

Attestation for algoat-0.1.0-cp312-abi3-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page