NumKong provides hardware-accelerated vector math for Swift without pulling in a full tensor framework. It gives you collection-based dense metrics, binary set distances, owning tensors, explicit matrix views, reusable packed matrices, symmetric all-pairs kernels, MaxSim late-interaction scoring, geospatial distance helpers, and storage wrappers for low-precision formats that Swift does not model natively.
Swift users usually want one of two things. They either want ergonomic collection-based scalar metrics. Or they want a compact matrix API for repeated retrieval-style workloads. This package targets those two cases directly instead of pretending to be a full tensor framework.
Topics
| Installation | |
|---|---|
| Quickstart6 | |
| Highlights | Collection-first scalar API. |
| Scalar Types137 | The output type is intentionally wider than the storage type for most operations. |
| Tensors and Views44 | Tensor<T> is the owning two-dimensional type. |
| Dot Products3 | Dot products follow a collection-first shape. |
| Dense Distances10 | The collection extensions are the lightest entry point. |
| Set Similarity6 | Binary metrics work on packed words instead of boolean slices. |
| Geospatial Metrics6 | The Swift geospatial helpers operate on four coordinate arrays, two per point set. |
| Matrix Kernels24 | Packed kernels are the GEMM-like throughput path. |
| MaxSim9 | MaxSim is the late-interaction primitive used by systems such as ColBERT. |
| Runtime Dispatch67 |