For a C++ library for mathematical computations, the first results are openmathlib/openblas (OpenBLAS is a high-performance linear algebra library that provides the foundational BLAS and LAPACK routines required for numerical computing, though it is implemented in C rather than using a template-based C++ design), boostorg/boost (Boost provides a comprehensive suite of high-performance, template-based C++ libraries that include specialized modules for linear algebra and numerical computation, making it a foundational resource for these tasks) and xtensor-stack/xtensor (This library provides a high-performance, template-based framework for multidimensional arrays and numerical computing that mirrors the NumPy API, making it a strong choice for linear algebra and array-based mathematical tasks). cgal/cgal and libigl/libigl round out the shortlist. Compare the match explanations and check the project documentation against your requirements.
We curate open-source GitHub repositories matching “best c++ math libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
OpenBLAS is a high-performance implementation of the Basic Linear Algebra Subprograms standard designed for numerical computing and matrix operations. It serves as a hardware-accelerated numerical library and optimized math kernel library, providing a computational engine for large-scale matrix multiplication and vector operations. The library distinguishes itself through the use of hand-tuned assembly kernels and SIMD instruction mapping, such as AVX and SVE, to maximize floating-point performance on specific CPU architectures. It features a multi-threaded framework that manages parallel exe
OpenBLAS is a high-performance linear algebra library that provides the foundational BLAS and LAPACK routines required for numerical computing, though it is implemented in C rather than using a template-based C++ design.
Boost is a collection of portable, high-performance source libraries that extend the C++ standard library. It provides a wide range of reusable components, data structures, and algorithms designed to add capabilities to the base language across different platforms. The project is distinguished by its extensive focus on compile-time template metaprogramming and generic programming. It implements advanced architectural patterns such as policy-based design, concept-based type validation, and the use of SFINAE for conditional template resolution to minimize runtime overhead. The library covers a
Boost provides a comprehensive suite of high-performance, template-based C++ libraries that include specialized modules for linear algebra and numerical computation, making it a foundational resource for these tasks.
xtensor is a C++ multidimensional array library for numerical computing that provides N-dimensional containers with an interface mirroring the NumPy API. It utilizes a lazy evaluation expression engine to defer numerical computations until assignment, which minimizes memory allocations and intermediate copies. The library features a foreign memory array adaptor that allows it to wrap external buffers, such as NumPy arrays, to perform numerical operations in-place without duplicating data. It further optimizes performance through lazy broadcasting and a system that manages the lifetime of temp
This library provides a high-performance, template-based framework for multidimensional arrays and numerical computing that mirrors the NumPy API, making it a strong choice for linear algebra and array-based mathematical tasks.
CGAL is a software library that provides a comprehensive collection of computational geometry algorithms and data structures. It is built around a geometry kernel that defines fundamental geometric primitives and operations, enabling the construction of complex geometric objects and the computation of geometric predicates with exact arithmetic for reliable results. The library covers a wide range of geometric computation capabilities, including the construction of convex hulls, triangulations of point sets, and the generation of Voronoi diagrams. It also supports the processing of polygonal m
CGAL is a specialized C++ library focused on computational geometry and spatial data structures, providing robust template-based primitives and exact arithmetic that serve as a powerful tool for complex geometric mathematical computation.
libigl is a C++ geometry processing library used for analyzing and manipulating 3D triangle and tetrahedral meshes. It functions as a numerical linear algebra suite and a mesh manipulation framework, integrating a geometric deformation engine to implement rigid and polyharmonic transformations. The project is distinguished by its header-only library design and its implementation of specialized deformation techniques, including rigid-as-possible and polyharmonic shape deformation. It also provides a visualization tool for rendering surfaces and scalar fields with interactive scene controls and
This is a specialized geometry processing library that relies heavily on numerical linear algebra and matrix operations, making it a suitable tool for high-performance mathematical computation in 3D contexts.
Numba is a just-in-time compiler that translates high-level Python functions into optimized machine code at runtime. By leveraging the LLVM compiler infrastructure, it provides a framework for accelerating numerical data processing and mathematical computations, enabling performance levels comparable to statically compiled languages. The project distinguishes itself through its ability to perform type-inference-based specialization, which generates machine instructions tailored to the specific data types used during execution. It employs a lazy compilation pipeline that defers translation unt
This is a Python-based just-in-time compiler for accelerating numerical code rather than a C++ library for mathematical computation, making it a tool for optimizing performance rather than a native C++ mathematical framework.
This project is a comprehensive library for numerical linear algebra and scientific computing, designed to provide optimized routines for matrix decomposition, statistical modeling, and high-performance data analysis. It serves as both a toolkit for solving complex linear systems and an educational resource for understanding the fundamental algorithms behind matrix factorizations and numerical solvers. The library distinguishes itself through a focus on randomized numerical linear algebra, utilizing probabilistic algorithms and approximate methods to perform dimensionality reduction and matri
This repository is a collection of educational Jupyter notebooks and Python-based tutorials rather than a high-performance C++ library for numerical computation.
OR-Tools is a software suite for combinatorial optimization, constraint programming, and mathematical modeling. It provides a framework for defining complex problems involving variables and logical constraints, enabling the systematic search for feasible or optimal solutions. The project features a high-performance core engine written in C++ that utilizes branch and bound search and local search metaheuristics to navigate large solution spaces. A language-agnostic wrapper layer allows these optimization capabilities to be accessed through idiomatic interfaces in multiple high-level programmin
This is a specialized suite for combinatorial optimization and constraint programming rather than a general-purpose linear algebra or numerical analysis library.
ndarray is a multidimensional array library for Rust that serves as a linear algebra framework and scientific computing tool. It provides the core infrastructure for creating and manipulating n-dimensional arrays, functioning as both a parallel array processor and a toolkit for numerical data analysis. The library distinguishes itself by providing efficient slicing and memory views, allowing for data sharing without copying. It leverages optimized backend math libraries for high-speed matrix multiplication and distributes heavy mathematical iterations across multiple CPU threads to accelerate
This is a high-performance multidimensional array library for Rust, but it does not meet the requirement for a C++ library.
This project is a high-performance numerical computing library designed for large-scale scientific and machine learning workloads. It functions as an automatic differentiation framework and a just-in-time compilation engine, transforming high-level Python code into optimized machine instructions. By enforcing pure functional programming patterns and immutable array semantics, the library ensures that mathematical functions remain compatible with automated graph transformations and symbolic differentiation. The platform distinguishes itself through its distributed array computing capabilities,
This is a Python-based framework for machine learning and automatic differentiation that relies on underlying C++ kernels, but it is not a C++ library for developers to integrate into their own numerical applications.
This project is a numerical computing library designed for scientific and engineering mathematical operations. It functions as a comprehensive linear algebra framework, a statistical analysis library, and a toolkit for mathematical optimization and numerical integration. The library is distinguished by its provider-based native acceleration, which allows managed code to be swapped for platform-native binary libraries to increase the performance of computationally intensive routines. It also supports a hybrid approach to matrix storage, implementing separate strategies for dense and sparse mat
This is a comprehensive numerical computing library for the .NET ecosystem, but it is written in C# rather than C++, making it a different tool than the native performance library requested.
This project is a machine learning array framework and tensor computation library designed for high-performance numerical computing. It provides a comprehensive suite of tools for constructing and training neural networks, featuring an automatic differentiation engine that facilitates gradient-based optimization and complex mathematical modeling. The library distinguishes itself through a unified memory architecture that allows data to be shared across CPU and GPU devices without explicit copies, significantly reducing data movement overhead. Its execution model relies on a lazy evaluation en
This is a machine learning-focused tensor framework rather than a general-purpose numerical analysis or linear algebra library, making it a specialized tool for neural network development rather than the mathematical computation library requested.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| openmathlib/openblas | 7.5K | C | BSD-3-Clause | |
| boostorg/boost | 8.5K | HTML | BSL-1.0 | |
| xtensor-stack/xtensor |
| 3.7K |
| C++ |
| BSD-3-Clause |
| cgal/cgal | 5.8K | C++ | other |
| libigl/libigl | 5K | C++ | GPL-3.0 |
| numba/numba | 10.9K | Python | bsd-2-clause |
| fastai/numerical-linear-algebra | 10.7K | Jupyter Notebook | — |
| google/or-tools | 13.1K | C++ | apache-2.0 |
| rust-ndarray/ndarray | 4.3K | Rust | Apache-2.0 |
| jax-ml/jax | 35.8K | Python | Apache-2.0 |