Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. xtensor

xtensor

BSD-3-ClauseC++

A C++ library for numerical analysis with multi-dimensional array expressions featuring broadcasting and lazy computing.

Visit WebsiteGitHubGitHub
3.8k stars445 forks0 contributors

What is xtensor?

xtensor is a C++ library for numerical analysis with multi-dimensional array expressions. It provides tools for lazy broadcasting and an API following C++ standard library idioms, enabling high-performance array operations similar to NumPy but in C++. It solves the need for efficient, expressive array programming in native C++ environments.

Target Audience

C++ developers working on numerical analysis, scientific computing, or machine learning projects who require high-performance array operations with NumPy-like syntax.

Value Proposition

Developers choose xtensor for its seamless integration with C++, lazy evaluation for performance, and compatibility with NumPy, Julia, and R arrays, offering a native alternative to Python-based numerical libraries.

Overview

C++ tensors with broadcasting and lazy computing

Use Cases

Best For

  • Implementing high-performance numerical algorithms in C++ with array expressions
  • Processing NumPy, Julia, or R arrays inplace from C++ code
  • Building scientific computing applications requiring SIMD acceleration
  • Developing machine learning kernels with lazy evaluation for optimization
  • Creating extensible expression systems for symbolic array operations
  • Writing performance-critical code where compile-time dimensionality reduces overhead

Not Ideal For

  • Projects prioritizing rapid prototyping with minimal dependencies, where Python and NumPy offer quicker setup
  • Environments locked to pre-C++14 standards, as xtensor requires modern C++ features (C++14/17/20)
  • Applications needing extensive linear algebra out-of-the-box without additional bindings like xtensor-blas

Pros & Cons

Pros

Lazy Evaluation Efficiency

Deferred computation until access optimizes memory and performance for large arrays, similar to NumPy's broadcasting rules.

SIMD Accelerated Performance

Optional xsimd integration enables automatic use of SSE, AVX, or Neon instruction sets for significant speedups in numerical operations.

Familiar C++ API

Follows C++ standard library idioms, easing adoption for C++ developers and integrating seamlessly with existing codebases.

Multi-language Interoperability

Provides adaptors for inplace processing of NumPy, Julia, and R arrays, facilitating data exchange without copying.

Cons

Dependency Complexity

Requires xtl and optionally xsimd, adding build system overhead and potential version management issues.

Modern C++ Requirement

Mandates C++14 or higher compilers, excluding legacy projects or environments with older toolchains.

Limited Core Functionality

Advanced features like linear algebra require additional libraries (e.g., xtensor-blas), increasing setup complexity.

Open Source Alternative To

xtensor is an open-source alternative to the following products:

N
NumPy

Frequently Asked Questions

Quick Stats

Stars3,768
Forks445
Contributors0
Open Issues381
Last commit2 days ago
CreatedSince 2016

Tags

#multi-dimensional-arrays#scientific-computing#high-performance-computing#simd#tensors#c-plus-plus-20#c-plus-plus-14#c-plus-plus#multidimensional-arrays#header-only-library#numerical-computing#array-programming#broadcasting#c-plus-plus-17#numpy#lazy-evaluation

Built With

S
Sphinx
D
Doxygen
C
CMake
C
C++

Links & Resources

Website

Included in

C/C++70.6k
Auto-fetched 1 day ago

Related Projects

DLIBDLIB

A toolkit for making real world machine learning and data analysis applications in C++

Stars14,464
Forks3,438
Last commit2 days ago
OpenGL MathematicsOpenGL Mathematics

OpenGL Mathematics (GLM)

Stars11,274
Forks2,410
Last commit6 months ago
QuantLibQuantLib

The QuantLib C++ library

Stars7,690
Forks2,359
Last commit1 day ago
OpenBLASOpenBLAS

OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.

Stars7,642
Forks1,743
Last commit2 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub