How gifton/vectorcore works
VectorCore is a Swift CPU numerical library for fixed- and runtime-dimension vectors, distance computation, batch search, and projection—not an embedding generator or persistent index. Its main workflow is to create vectors, compute metrics or search a supplied candidate collection, and return ranked indices; PCA and UMAP provide separate projection capabilities. The graph uses README statements and the sampled source/reference index for relationships; unsampled implementation details are not inferred beyond documented capabilities.
Main entry points: Operations.swift Vector operations · Vector512Optimized.swift Vector types · VectorCore.swift Public API · GramBatchSearch.swift Batch search
Components 20
Vector API
- Public API
Sources/VectorCore/VectorCore.swift - Dimension types
Sources/VectorCore/Core/Dimension.swift - Vector types
Sources/VectorCore/Vectors/Vector512Optimized.swift - Dynamic vectors
Sources/VectorCore/Vectors/DynamicVector.swift
Numerical Compute
- Distance metrics
Sources/VectorCore/Protocols/DistanceMetric.swift - Vector operations
Sources/VectorCore/Operations/Operations.swift - Batch search
Sources/VectorCore/Operations/GramBatchSearch.swift - Matrix distances
Sources/VectorCore/Operations/MatrixDistance.swift - Distance kernels
Sources/VectorCore/Operations/Kernels/EuclideanKernels.swift - SIMD operations
Sources/VectorCore/Platform/SIMDOperations.swift
Projection
- PCA projection
Sources/VectorCore/LinearAlgebra/PCA.swift - Linear algebra
Sources/VectorCore/LinearAlgebra/LinearAlgebraProvider.swift - UMAP projection
Sources/VectorCore/ManifoldLearning/UMAP.swift - KNN graph
Sources/VectorCore/ManifoldLearning/KNNGraph.swift
Storage and Interop
- Vector storage
Sources/VectorCore/Storage/VectorStorage.swift - Aligned memory
Sources/VectorCore/Storage/AlignedMemory.swift - Unified buffers
Sources/VectorCore/Storage/UnifiedVectorBuffer.swift - C kernel API
Sources/VectorCoreC/include/VectorCoreC.h
Other components
- Swift caller
- Apple Accelerate
Connections 20
- Swift caller → Public API: uses API
README.md - Public API → Vector types: creates vectors
Sources/VectorCore/VectorCore.swift - Public API → Vector operations: exposes operations
Sources/VectorCore/VectorCore.swift - Swift caller → Dynamic vectors: creates vectors
README.md - Dimension types → Vector types: defines dimensions
Sources/VectorCore/Core/Dimension.swift - Vector types → Vector storage: stores values
- Vector types → Distance kernels: delegates distance
Sources/VectorCore/Vectors/Vector512Optimized.swift - Vector operations → Distance metrics: accepts metric
README.md - Vector operations → Batch search: routes batch search
Sources/VectorCore/Operations/GramBatchSearch.swift - Batch search → Matrix distances: uses distances
Sources/VectorCore/Operations/GramBatchSearch.swift - Batch search → Unified buffers: reads buffers
Sources/VectorCore/Operations/GramBatchSearch.swift - Vector operations → Distance kernels: computes metrics
- Vector storage → SIMD operations: dispatches operations
Sources/VectorCore/Storage/VectorStorage.swift - Vector storage → Aligned memory: allocates memory
Sources/VectorCore/Storage/AlignedMemory.swift - Swift caller → PCA projection: fits projection
README.md - PCA projection → Linear algebra: uses provider
- Swift caller → UMAP projection: requests layout
README.md - UMAP projection → KNN graph: accepts graph
README.md - Swift caller → KNN graph: supplies graph
README.md - C kernel API → Apple Accelerate: wraps LAPACK