Cortex.Vectors
2.2.0
dotnet add package Cortex.Vectors --version 2.2.0
NuGet\Install-Package Cortex.Vectors -Version 2.2.0
<PackageReference Include="Cortex.Vectors" Version="2.2.0" />
<PackageVersion Include="Cortex.Vectors" Version="2.2.0" />
<PackageReference Include="Cortex.Vectors" />
paket add Cortex.Vectors --version 2.2.0
#r "nuget: Cortex.Vectors, 2.2.0"
#:package Cortex.Vectors@2.2.0
#addin nuget:?package=Cortex.Vectors&version=2.2.0
#tool nuget:?package=Cortex.Vectors&version=2.2.0
Cortex.Vectors 🧠
Cortex.Vectors is a High‑performance vector types—Dense, Sparse, and Bit—for AI & for .NET.
Built as part of the Cortex Data Framework, this library offers High‑performance vector types—Dense, Sparse, and Bit—for AI for:
- ✨ Generic‑math powered (IFloatingPointIeee754<T>): works with float, double, decimal, …
- 🟢 DenseVector – contiguous storage, SIMD‑friendly operations
- 🔵 SparseVector – dictionary‑backed, memory‑efficient for huge, mostly‑zero spaces
- 🟡 BitVector – bit‑packed booleans with popcount & logical ops
- ⚙️ Core ops out‑of‑the‑box: dot product, L2 norm, cosine similarity, scaling, +/‑
🚀 Getting Started
Install via NuGet
dotnet add package Cortex.Vectors
DenseVector
using Cortex.Vectors;
// (1, 2, 3)
var a = new DenseVector<float>(1f, 2f, 3f);
// (0.5, 0.5, 0.5)
var b = DenseVector<float>.Filled(3, 0.5f);
float dot = a.Dot(b); // = 3.0
var normA = a.Norm(); // ≈ 3.7417
var unitA = a.Normalize(); // unit length
float cosine = a.CosineSimilarity(b);
SparseVector
using Cortex.Vectors;
using System.Collections.Generic;
// 1‑million‑dimensional vector with two non‑zeros
var sv = new SparseVector<double>(
dimension: 1_000_000,
nonZero: new[]
{
new KeyValuePair<int,double>(42, 1.0),
new KeyValuePair<int,double>(123456, 2.5)
});
double l2 = sv.Norm(); // √(1² + 2.5²)
var unit = sv.Normalize();
BitVector
using Cortex.Vectors;
// length 128, bits 0, 3, and 5 set to 1
var bv = new BitVector<float>(128, new[] { 0, 3, 5 });
int ones = bv.PopCount(); // 3
float selfDot = bv.Dot(bv); // 3.0 (generic type ⇒ float)
var l2 = bv.Norm(); // √3
💬 Contributing
We welcome contributions from the community! Whether it's reporting bugs, suggesting features, or submitting pull requests, your involvement helps improve Cortex for everyone.
💬 How to Contribute
- Fork the Repository
- Create a Feature Branch
git checkout -b feature/YourFeature
- Commit Your Changes
git commit -m "Add your feature"
- Push to Your Fork
git push origin feature/YourFeature
- Open a Pull Request
Describe your changes and submit the pull request for review.
📄 License
This project is licensed under the MIT License.
📚 Sponsorship
Cortex is an open-source project maintained by BuilderSoft. Your support helps us continue developing and improving Cortex. Consider sponsoring us to contribute to the future of resilient streaming platforms.
How to Sponsor
- Financial Contributions: Support us through GitHub Sponsors or other preferred platforms.
- Corporate Sponsorship: If your organization is interested in sponsoring Cortex, please contact us directly.
Contact Us: cortex@buildersoft.io
Contact
We'd love to hear from you! Whether you have questions, feedback, or need support, feel free to reach out.
- Email: cortex@buildersoft.io
- Website: https://buildersoft.io
- GitHub Issues: Cortex Data Framework Issues
- Join our Discord Community:
Thank you for using Cortex Data Framework! We hope it empowers you to build scalable and efficient data processing pipelines effortlessly.
Built with ❤️ by the Buildersoft team.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Just as the Cortex in our brains handles complex processing efficiently, Cortex Data Framework brings brainpower to your data management!