NanoVector 1.0.2

dotnet add package NanoVector --version 1.0.2
                    
NuGet\Install-Package NanoVector -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NanoVector" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NanoVector" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="NanoVector" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NanoVector --version 1.0.2
                    
#r "nuget: NanoVector, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NanoVector@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NanoVector&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=NanoVector&version=1.0.2
                    
Install as a Cake Tool

NanoVector Logo

⏏NanoVector⚑

A high-performance, SIMD-accelerated vector library for .NET. Minimalist, zero-allocation, and engineered for raw speed.

✨ Key Features

  • πŸš€ SIMD Accelerated β€” Uses hardware intrinsics (AVX/AVX2) to process multiple numbers in a single CPU cycle.
  • πŸ’Ž Zero Allocations β€” Engineered to work with Span<T> and unsafe pointers. No Garbage Collector overhead.
  • πŸ›  Raw Speed β€” Bypasses standard .NET bounds checking for maximum throughput.
  • 🧩 Simple API β€” Easy to use for AI, game engines, and math-heavy applications.

πŸ“₯ Installation

Install via NuGet: dotnet add package NanoVector

πŸ’» Usage

πŸ”§ Basic Operations

  • ⏺ Using
    using NanoVector;
    
  • πŸš€ Create & Sum β€” Create a vector from an array and calculate the total sum using SIMD power.
    var vector = new MultiVector(new float[] { 1, 2, 3, 4 });
    float result = vector.Sum();
    
  • πŸ’Ž Sum of Squares β€” Optimized calculation for AI and statistical variance.
    float squares = vector.SumOfSquares();
    
  • πŸ€– AI Comparison β€” Measure cosine similarity between two vectors for neural networks.
    float dotProduct = NanoComparator.DotProduct(vector1, vector2);
    float similarity = NanoComparator.Compare(vector1, vector2);
    
  • πŸ›‘οΈ Read-Only Safety β€” Use ReadOnlyMultiVector for safe data processing without accidental modifications.
    ReadOnlyMultiVector readOnlyVector = vector.AsReadOnly();
    float safeSum = readOnlyVector.Sum();
    float safeSumSquares = readOnlyVector.SumOfSquares();
    

🧠 Example: Simple Neuron Calculation

This is a conceptual example of how to implement a high-speed neural network layer using NanoVector:

// Let's represent the input signals and the weight of the neuron
// Input signals and trained weights
var inputs = new MultiVector(new float[] { 0.5f, -0.2f, 0.8f, 0.1f });
var weights = new MultiVector(new float[] { 0.15f, 0.45f, -0.1f, 0.9f });
float bias = 0.05f;

// 1. Compute the dot product using SIMD
// Calculate dot product with hardware acceleration
float dot = NanoComparator.DotProduct(inputs, weights);

// 2. Add bias and apply activation (ReLU)
// Add bias and apply ReLU activation
float neuronOutput = MathF.Max(0, dot + bias);

//Showing the result
Console.WriteLine($"Neuron result: {neuronOutput}");

β˜• Support NanoVector ⚑

If this library saved your nanoseconds, consider a tip:

ETH / EVM Bitcoin Litecoin
EVM QR BTC QR LTC QR
0xCCDD9...4AB4 bc1qjmw...uhcd LgSVCqN...VP3o
  • ETH / Polygon / BSC / Base (EVM): 0xCCDD90984C6e9BC4a84e10c402CF85e69f9A4AB4
  • Bitcoin (BTC): bc1qjmwjjcqnphrc3qmy6x9pl5qk06a28msdw8uhcd
  • Litecoin (LTC): LgSVCqNyt44Rgg7jPTkbiKzskedy5AVP3o

πŸ›‘οΈ License

Distributed under the MIT License. See LICENSE for more information.


Built for nanoseconds. 🧬

Product 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.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.

Version Downloads Last Updated
1.0.2 136 3/12/2026
1.0.1 120 3/8/2026
1.0.0 113 3/7/2026