numpyCore C++ Documentation#

Welcome to the numpyCore C++ API documentation. This library provides a NumPy-compatible C++ implementation for high-performance numerical computing.

Contents:

Overview#

numpyCore C++ is a header-only library that provides:

  • NDArray: Multi-dimensional array class with NumPy-like functionality

  • Mathematical functions: sin, cos, exp, log, sqrt, and more

  • Linear algebra: dot, matmul, solve, inv, svd, qr, eig

  • Random number generation: Various distributions with modern generators

  • FFT: Fast Fourier Transform operations

  • SIMD optimizations: AVX2/AVX-512 accelerated sorting and operations

  • Statistical functions: mean, std, var, histogram, percentile

Quick Start#

#include <numpy/np_ndarray.h>
using namespace numpy;

int main() {
    // Create arrays
    NDArray<double> a = np::arange<double>(12).reshape({3, 4});
    NDArray<double> b = np::ones<double>({4, 2});

    // Basic operations
    auto c = np::dot(a, b);
    std::cout << "Shape: " << c.shape() << std::endl;

    // Statistics
    auto mean_val = np::mean(a);
    auto std_val = np::std(a);

    // Random numbers
    Generator gen(42);
    auto random = gen.random({3, 3});

    // Linear algebra
    auto [u, s, vh] = np::linalg::svd(a);

    return 0;
}

Installation#

numpyCore C++ is a header-only library. Simply include the headers:

#include <numpy/np_ndarray.h>
#include <numpy/np_linalg.h>
#include <numpy/np_random.h>
// or include everything:
#include <numpy/numpy.h>

Requirements#

  • C++20 compatible compiler (MSVC 2022, GCC 11+, Clang 14+)

  • Optional: Intel MKL for optimized linear algebra

  • Optional: Intel IPP for performance optimizations

  • Optional: Boost Math Library for special functions

API Reference#

See the API Reference for complete API documentation.

Indices and tables#