C++ implementation of the Python Numpy library

Overview

NumCpp logo

GitHub watchers GitHub stars GitHub forks

Build status Build Status Codacy Badge

NumCpp: A Templatized Header Only C++ Implementation of the Python NumPy Library

Author: David Pilger [email protected]

Version: GitHub tag (latest by date)

License MIT license

Testing

C++ Standards:
C++14 C++17 C++20

Compilers:
Visual Studio: 2017, 2019, 2022
GNU: 6.5, 7.5, 8.4, 9.3, 10.1, 11.1
Clang: 6, 7, 8, 9, 10, 11, 12

Boost Versions:
1.68+

Documentation

GitHub

Installation

Building

Release Notes

From NumPy To NumCpp – A Quick Start Guide

This quick start guide is meant as a very brief overview of some of the things that can be done with NumCpp. For a full breakdown of everything available in the NumCpp library please visit the Full Documentation.

CONTAINERS

The main data structure in NumCpp is the NdArray. It is inherently a 2D array class, with 1D arrays being implemented as 1xN arrays. There is also a DataCube class that is provided as a convenience container for storing an array of 2D NdArrays, but it has limited usefulness past a simple container.

NumPy NumCpp
a = np.array([[1, 2], [3, 4], [5, 6]]) nc::NdArray<int> a = { {1, 2}, {3, 4}, {5, 6} }
a.reshape([2, 3]) a.reshape(2, 3)
a.astype(np.double) a.astype<double>()

INITIALIZERS

Many initializer functions are provided that return NdArrays for common needs.

NumPy NumCpp
np.linspace(1, 10, 5) nc::linspace<dtype>(1, 10, 5)
np.arange(3, 7) nc::arange<dtype>(3, 7)
np.eye(4) nc::eye<dtype>(4)
np.zeros([3, 4]) nc::zeros<dtype>(3, 4)
nc::NdArray<dtype>(3, 4) a = 0
np.ones([3, 4]) nc::ones<dtype>(3, 4)
nc::NdArray<dtype>(3, 4) a = 1
np.nans([3, 4]) nc::nans(3, 4)
nc::NdArray<double>(3, 4) a = nc::constants::nan
np.empty([3, 4]) nc::empty<dtype>(3, 4)
nc::NdArray<dtype>(3, 4) a

SLICING/BROADCASTING

NumCpp offers NumPy style slicing and broadcasting.

NumPy NumCpp
a[2, 3] a(2, 3)
a[2:5, 5:8] a(nc::Slice(2, 5), nc::Slice(5, 8))
a({2, 5}, {5, 8})
a[:, 7] a(a.rSlice(), 7)
a[a > 5] a[a > 0]
a[a > 5] = 0 a.putMask(a > 5, 0)

RANDOM

The random module provides simple ways to create random arrays.

NumPy NumCpp
np.random.seed(666) nc::random::seed(666)
np.random.randn(3, 4) nc::random::randN<double>(nc::Shape(3, 4))
nc::random::randN<double>({3, 4})
np.random.randint(0, 10, [3, 4]) nc::random::randInt<int>(nc::Shape(3, 4), 0, 10)
nc::random::randInt<int>({3, 4}, 0, 10)
np.random.rand(3, 4) nc::random::rand<double>(nc::Shape(3,4))
nc::random::rand<double>({3, 4})
np.random.choice(a, 3) nc::random::choice(a, 3)

CONCATENATION

Many ways to concatenate NdArray are available.

NumPy NumCpp
np.stack([a, b, c], axis=0) nc::stack({a, b, c}, nc::Axis::ROW)
np.vstack([a, b, c]) nc::vstack({a, b, c})
np.hstack([a, b, c]) nc::hstack({a, b, c})
np.append(a, b, axis=1) nc::append(a, b, nc::Axis::COL)

DIAGONAL, TRIANGULAR, AND FLIP

The following return new NdArrays.

NumPy NumCpp
np.diagonal(a) nc::diagonal(a)
np.triu(a) nc::triu(a)
np.tril(a) nc::tril(a)
np.flip(a, axis=0) nc::flip(a, nc::Axis::ROW)
np.flipud(a) nc::flipud(a)
np.fliplr(a) nc::fliplr(a)

ITERATION

NumCpp follows the idioms of the C++ STL providing iterator pairs to iterate on arrays in different fashions.

NumPy NumCpp
for value in a for(auto it = a.begin(); it < a.end(); ++it)
for(auto& value : a)

LOGICAL

Logical FUNCTIONS in NumCpp behave the same as NumPy.

NumPy NumCpp
np.where(a > 5, a, b) nc::where(a > 5, a, b)
np.any(a) nc::any(a)
np.all(a) nc::all(a)
np.logical_and(a, b) nc::logical_and(a, b)
np.logical_or(a, b) nc::logical_or(a, b)
np.isclose(a, b) nc::isclose(a, b)
np.allclose(a, b) nc::allclose(a, b)

COMPARISONS

NumPy NumCpp
np.equal(a, b) nc::equal(a, b)
a == b
np.not_equal(a, b) nc::not_equal(a, b)
a != b
rows, cols = np.nonzero(a) auto [rows, cols] = nc::nonzero(a)

MINIMUM, MAXIMUM, SORTING

NumPy NumCpp
np.min(a) nc::min(a)
np.max(a) nc::max(a)
np.argmin(a) nc::argmin(a)
np.argmax(a) nc::argmax(a)
np.sort(a, axis=0) nc::sort(a, nc::Axis::ROW)
np.argsort(a, axis=1) nc::argsort(a, nc::Axis::COL)
np.unique(a) nc::unique(a)
np.setdiff1d(a, b) nc::setdiff1d(a, b)
np.diff(a) nc::diff(a)

REDUCERS

Reducers accumulate values of NdArrays along specified axes. When no axis is specified, values are accumulated along all axes.

NumPy NumCpp
np.sum(a) nc::sum(a)
np.sum(a, axis=0) nc::sum(a, nc::Axis::ROW)
np.prod(a) nc::prod(a)
np.prod(a, axis=0) nc::prod(a, nc::Axis::ROW)
np.mean(a) nc::mean(a)
np.mean(a, axis=0) nc::mean(a, nc::Axis::ROW)
np.count_nonzero(a) nc::count_nonzero(a)
np.count_nonzero(a, axis=0) nc::count_nonzero(a, nc::Axis::ROW)

I/O

Print and file output methods. All NumCpp classes support a print() method and << stream operators.

NumPy NumCpp
print(a) a.print()
std::cout << a
a.tofile(filename, sep=’\n’) a.tofile(filename, "\n")
np.fromfile(filename, sep=’\n’) nc::fromfile<dtype>(filename, "\n")
np.dump(a, filename) nc::dump(a, filename)
np.load(filename) nc::load<dtype>(filename)

MATHEMATICAL FUNCTIONS

NumCpp universal functions are provided for a large set number of mathematical functions.

BASIC FUNCTIONS

NumPy NumCpp
np.abs(a) nc::abs(a)
np.sign(a) nc::sign(a)
np.remainder(a, b) nc::remainder(a, b)
np.clip(a, 3, 8) nc::clip(a, 3, 8)
np.interp(x, xp, fp) nc::interp(x, xp, fp)

EXPONENTIAL FUNCTIONS

NumPy NumCpp
np.exp(a) nc::exp(a)
np.expm1(a) nc::expm1(a)
np.log(a) nc::log(a)
np.log1p(a) nc::log1p(a)

POWER FUNCTIONS

NumPy NumCpp
np.power(a, 4) nc::power(a, 4)
np.sqrt(a) nc::sqrt(a)
np.square(a) nc::square(a)
np.cbrt(a) nc::cbrt(a)

TRIGONOMETRIC FUNCTIONS

NumPy NumCpp
np.sin(a) nc::sin(a)
np.cos(a) nc::cos(a)
np.tan(a) nc::tan(a)

HYPERBOLIC FUNCTIONS

NumPy NumCpp
np.sinh(a) nc::sinh(a)
np.cosh(a) nc::cosh(a)
np.tanh(a) nc::tanh(a)

CLASSIFICATION FUNCTIONS

NumPy NumCpp
np.isnan(a) nc::isnan(a)
np.isinf(a) nc::isinf(a)

LINEAR ALGEBRA

NumPy NumCpp
np.linalg.norm(a) nc::norm(a)
np.dot(a, b) nc::dot(a, b)
np.linalg.det(a) nc::linalg::det(a)
np.linalg.inv(a) nc::linalg::inv(a)
np.linalg.lstsq(a, b) nc::linalg::lstsq(a, b)
np.linalg.matrix_power(a, 3) nc::linalg::matrix_power(a, 3)
Np.linalg.multi_dot(a, b, c) nc::linalg::multi_dot({a, b, c})
np.linalg.svd(a) nc::linalg::svd(a)
Comments
  • NdArrayCore.hpp Visual Studio error

    NdArrayCore.hpp Visual Studio error

    In https://github.com/dpilger26/NumCpp/blob/master/include/NumCpp/NdArray/NdArrayCore.hpp Line 4690, You've commented: // NOTE: this needs to be defined outside of the class to get rid of a compiler // error in Visual Studio

    But I see it's already outside of the class, yet I get a Visual Studio compilation error:

    Severity Code Description Project File Line Suppression State Error(active) E0135 class template "nc::NdArray<dtype, Allocator>" has no member "nonzero" my_lib C : \NumCpp - master\include\NumCpp\NdArray\NdArrayCore.hpp 4693

    What is needed to be done in order to fix this error ?

    opened by TomAvrech 8
  • Problem for random seed

    Problem for random seed

    nc::random::seed(unsigned int(time(NULL)));
    cout << nc::random::randFloat<float>(0, 1) << endl;
    

    Here is my code, but the final executable program products the same number every time it starts. However, the following code can generate different numbers each time.

    mt19937_64 generator;
    generator.seed(unsigned int(time(NULL)));
    boost::random::uniform_real_distribution<float> rand(0, 1);
    cout << rand(generator) << endl;
    
    question 
    opened by linlll 8
  • How to realize element-wise slice in Numcpp?

    How to realize element-wise slice in Numcpp?

    In Numpy, I can slice the array like this:

      test_np = np.array([1, 2, 3, 4, 5])
      indice = [2, 4]
      slice_np = test_np[indice]#[3, 5]
    

    However, I have not found any API that can slice the array in Numcpp like this. It seems either Slice() or at() can not slice the array like this. Does it exist any API in Numcpp that can slice like this? Thanks!

    enhancement 
    opened by TangToy 7
  • Compilation error: ambiguous overload for operator

    Compilation error: ambiguous overload for operator

    I just installed Numcpp on a new machine and tried to compile a piece of code which was working on another machine. However, on the new machine, I get compilation error: ambiguous overload for ‘operator+’ (operand types are ‘nc::NdArray<double>’ and ‘int’). There are errors related to the ambiguity for nearly all the operators. I was wondering if you could help me fix this issue. I am using Boost 1.7, Clang 6.0, and tried different versions of gcc, including 7 , 8.3.0, 9.2. Thanks in advance.

    opened by Houman-HM 7
  • Numpy diag in Numcpp

    Numpy diag in Numcpp

    Hey, I was wondering if you could let me know how I can get numpy.diag in Numcpp. I could not find anything regarding that method in the documentation. There is nc:diagonal, which is different with numpy.diag. Wondering if you have already implemented numpy.diag .

    Thanks in advance.

    enhancement 
    opened by Houman-HM 7
  • there are some bugs when i try to build Readme

    there are some bugs when i try to build Readme

    hi

    i try to build Numcpp on ubuntu1604. there are some bugs . cake is 3.15.2 and boost is 1.68. ***there is the log Scanning dependencies of target Example [ 50%] Building CXX object CMakeFiles/Example.dir/ReadMe.cpp.o In file included from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions.hpp:57:0, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp.hpp:37, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/ReadMe.cpp:1: /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp: In function 'nc::NdArray nc::asarray(const std::array<_Tp, _Nm>&)': /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp:55:23: error: missing template arguments before '(' token return NdArray(inArray); ^ /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp: In function 'nc::NdArray nc::asarray(const std::vector<_RealType>&)': /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp:72:23: error: missing template arguments before '(' token return NdArray(inVector); ^ /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp: In function 'nc::NdArray nc::asarray(const std::deque<_Tp>&)': /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp:89:23: error: missing template arguments before '(' token return NdArray(inDeque); ^ /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp: In function 'nc::NdArray nc::asarray(const std::set&)': /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp:106:23: error: missing template arguments before '(' token return NdArray(inSet); ^ /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp: In function 'nc::NdArray nc::asarray(std::initializer_list<Tp>&)': /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp:124:23: error: missing template arguments before '(' token return NdArray(inList); ^ /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp: In function 'nc::NdArray nc::asarray(std::initializer_list<std::initializer_list<Tp> >&)': /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Functions/asarray.hpp:142:23: error: missing template arguments before '(' token return NdArray(inList); ^ In file included from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/DCM.hpp:35:0, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations.hpp:31, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp.hpp:44, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/ReadMe.cpp:1: /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/Quaternion.hpp: At global scope: /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/Quaternion.hpp:61:70: error: array must be initialized with a brace-enclosed initializer std::array<double, 4> components = { 0.0, 0.0, 0.0, 1.0 }; ^ /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/Quaternion.hpp:61:70: error: too many initializers for 'std::array<double, 4ul>' In file included from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/DCM.hpp:35:0, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations.hpp:31, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp.hpp:44, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/ReadMe.cpp:1: /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/Quaternion.hpp: In static member function 'static nc::rotations::Quaternion nc::rotations::Quaternion::identity()': /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/Quaternion.hpp:357:35: error: use of deleted function 'constexpr nc::rotations::Quaternion::Quaternion()' return Quaternion(); ^ In file included from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/DCM.hpp:35:0, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations.hpp:31, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp.hpp:44, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/ReadMe.cpp:1: /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/Quaternion.hpp:179:13: note: 'constexpr nc::rotations::Quaternion::Quaternion() noexcept' is implicitly deleted because its exception-specification does not match the implicit exception-specification 'noexcept (false)' Quaternion() noexcept = default; ^ In file included from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/DCM.hpp:35:0, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations.hpp:31, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp.hpp:44, from /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/ReadMe.cpp:1: /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/Quaternion.hpp: In member function 'nc::NdArray nc::rotations::Quaternion::toNdArray() const': /home/lisas/numcpp_new/numcpp_new/NumCpp/examples/ReadMe/../../include/NumCpp/Rotations/Quaternion.hpp:655:31: error: missing template arguments before '(' token return NdArray(components); ^ CMakeFiles/Example.dir/build.make:62: recipe for target 'CMakeFiles/Example.dir/ReadMe.cpp.o' failed make[2]: *** [CMakeFiles/Example.dir/ReadMe.cpp.o] Error 1 CMakeFiles/Makefile2:75: recipe for target 'CMakeFiles/Example.dir/all' failed make[1]: *** [CMakeFiles/Example.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2


    best lisa shi

    opened by shixinlishixinli 6
  • can stack function change the input parameter type to list or vector?

    can stack function change the input parameter type to list or vector?

    i'm try to use vstack to stack a series ndarray,but the size of series is uncertain and the initializer_list can't convert from vector or list. so,can i change the implement of the stack function?

    opened by novioleo 6
  • Creating NdArray from cv::Mat having double values

    Creating NdArray from cv::Mat having double values

    Hi I am trying to use NumCpp in my iOS project. I have a cv::Mat object with double values in it. But I am unable to create NdArray from this source. It is only allowing me to use nc::uint8 as type.

    auto ncArray = nc::NdArray(textSource.data, textSource.rows, textSource.cols);

    What can I do to have NdArray with double type from cv::Mat object ? Kindly provide some guidance on it.

    question 
    opened by nasircsms 5
  • include problem in vscode

    include problem in vscode

    Describe the bug I clone the whole directory into my project file, and I wrote include "NumCpp/include/NumCpp.hpp". Then error shows up. It says that 'NumCpp/Coordinates/Coordinate.hpp' file not found. So I delete that line of code, and I found out that every include statements in NumCpp.hpp are causing errors. But I am not sure what is happening.

    Expected behavior Include NumCpp.hpp file without any error or warning occurring.

    Screenshots 截圖 2022-07-14 下午10 32 41

    截圖 2022-07-14 下午10 33 09 Additional context I am using vscode on arm64 m1 MacBook pro.

    Thanks.

    opened by Rocky14683 4
  • When compiling with NumCpp getting a lot of errors

    When compiling with NumCpp getting a lot of errors

    Describe the bug Installed NumCpp latest on ArchLinux using CMake, and when building using g++ getting a lot of errors. Except for the include line, I haven't even used it anywhere inside my code.

    To Reproduce Steps to reproduce the behavior:

    1. Install NumCpp using CMake
    2. Include in a cpp file like this: #include <NumCpp.hpp>
    3. Compile using g++ like this: g++ test.cpp -o test
    4. Get errors: log.txt

    Expected behavior Should compile normally

    Screenshots If applicable, add screenshots to help explain your problem.

    Additional context g++ verion: g++ (GCC) 11.2.0 c++ standard used: c++14

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Additional context Add any other context about the problem here.

    enhancement question 
    opened by erikthegamer1242 4
  • NumCpp on Ubuntu and macOS

    NumCpp on Ubuntu and macOS

    I am going to Numpy library C++ API on Ubuntu and macOS. how can i build NumCpp on Ubuntu and macOS? If possible, please share how to build on various platform.

    opened by mauricewells 4
  • max and min are already defined.

    max and min are already defined.

    minwindef.h from SDK 8.1 contains: #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif

    #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif

    those words are used in numcpp, please.

    opened by Angeliccare 1
  • RISC-V Support

    RISC-V Support

    Does this project support riscv? I was trying to build it on riscv plaform, but I failed because some of the cmath functions are not supported by riscv-toolchain. Had anyone tried to run it on RISCV?

    opened by cylindrical2002 1
  • Update it in vcpkg, last version of NumCpp in vcpkg is 2.6.0, update the latest one to vcpkg please

    Update it in vcpkg, last version of NumCpp in vcpkg is 2.6.0, update the latest one to vcpkg please

    Describe the solution you'd like Update the new 2.8.0 version to vcpkg, the current version available in vcpkg is only 2.6.0 from the last year (2021)

    opened by Rablidad 2
  • Question :: It could be used inside a CUDA kernel ?

    Question :: It could be used inside a CUDA kernel ?

    Hi, thanks for this great library!

    I was wondering if it could be used inside a CUDA kernel like Eigen?

    For example:

    __global__ void test_kernel(int n, float * r) {
      typedef Eigen::Matrix<thrust::complex<float>,2,2> cuMatrixXcf;
    
      cuMatrixXcf m;
      m << 1,0, 0,1;
      m *= threadIdx.x;
    
      Eigen::SelfAdjointEigenSolver< cuMatrixXcf > solver;
      solver.compute(m, Eigen::EigenvaluesOnly);
    
      auto const& D = solver.eigenvalues();
      
      for (int i = 0; i < n; ++i)
        r[n*threadIdx.x + i] = D(i);
    }
    

    Best regards, Andrews

    opened by andrewssobral 1
  • Multiply with BroadCasting. e.g. shape: [1,3] * [2,1] => [2 * 3]

    Multiply with BroadCasting. e.g. shape: [1,3] * [2,1] => [2 * 3]

    Thanks for you project. But I found that the broadcasting in numpy is likely not supported in NumCpp. For example, I have two matrixs: A=[1,2,3] B = [[1], [2], [3]] In numpy, A * B is [ [1,2,3], [2,4,6], [3,6,9]] However, in NumCpp, the error occured. Thus I want to ask that are the shapes of two matrixs must be the same in NumCpp?

    enhancement 
    opened by ValkyriaLenneth 0
Releases(Version_2.8.0)
  • Version_2.8.0(Jul 23, 2022)

    Version 2.8.0

    Source code(tar.gz)
    Source code(zip)
  • Version_2.7.0(Jan 5, 2022)

    • added bartlett, https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html
    • added blackman, https://numpy.org/doc/stable/reference/generated/numpy.blackman.html
    • added corrcoef, https://numpy.org/doc/stable/reference/generated/numpy.corrcoef.html
    • added cov, https://numpy.org/doc/stable/reference/generated/numpy.cov.html
    • added cov_inv, the inverse covariance matrix, aka the concentration matrix
    • added extract, https://numpy.org/doc/stable/reference/generated/numpy.extract.html
    • added geomspace, https://numpy.org/doc/stable/reference/generated/numpy.geomspace.html
    • added hamming, https://numpy.org/doc/stable/reference/generated/numpy.hamming.html
    • added hanning, https://numpy.org/doc/stable/reference/generated/numpy.hanning.html
    • added inner, https://numpy.org/doc/stable/reference/generated/numpy.inner.html
    • added isneginf, https://numpy.org/doc/stable/reference/generated/numpy.isneginf.html
    • added isposinf, https://numpy.org/doc/stable/reference/generated/numpy.isposinf.html
    • added kaiser, https://numpy.org/doc/stable/reference/generated/numpy.kaiser.html
    • added logb, logarithm of with an arbitrary base b
    • added logspace, https://numpy.org/doc/stable/reference/generated/numpy.logspace.html
    • added nth_root, the nth root of a value
    • added place, https://numpy.org/doc/stable/reference/generated/numpy.place.html
    • added select function, https://numpy.org/doc/stable/reference/generated/numpy.select.html
    • fmod and the modulus % operator now work with float dtypes
    • added Hamming EDAC (Error Dectection and Correction) encode and decode functions, https://en.wikipedia.org/wiki/Hamming_code
    • various minor performance improvements and bug fixes
    Source code(tar.gz)
    Source code(zip)
  • Version_2.6.2(Sep 29, 2021)

  • Version_2.6.1(Sep 28, 2021)

  • Version_2.6.0(Sep 27, 2021)

  • Version_2.5.1(Sep 17, 2021)

  • Version_2.5.0(Aug 5, 2021)

    • added additional NdArray slice overloads
    • Removed NO_MULTITHREAD compiler flag and replaced with NUMCPP_USE_MULTITHREAD so that single threaded is now the default
    • renamed NO_USE_BOOST compiler flag to NUMCPP_NO_USE_BOOST
    • renamed INCLUDE_BOOST_PYTHON_INTERFACE compiler flat to NUMCPP_INCLUDE_BOOST_PYTHON_INTERFACE
    • renamed INCLUDE_PYBIND_PYTHON_INTERFACE compiler flag to NUMCPP_INCLUDE_PYBIND_PYTHON_INTERFACE
    Source code(tar.gz)
    Source code(zip)
  • Version_2.4.2(May 8, 2021)

  • Version_2.4.1(Feb 5, 2021)

  • Version_2.4.0(Jan 31, 2021)

    • Compile with NO_USE_BOOST definition to remove the Boost libraries as a dependency, with reduced functionality:
      • gcd with a pair of values (still available using a C++17 compliant compiler)
      • gcd array
      • lcm with a pair of values (still available using a C++17 compliant compiler)
      • lcm array
      • polynomial::chebyshev_t
      • polynomial::chebyshev_u
      • polynomial::hermite (still available using a C++17 compliant compiler)
      • polynomial::laguerre (still available using a C++17 compliant compiler)
      • polynomial::legendre_p (still available using a C++17 compliant compiler)
      • polynomial::legendre_q
      • polynomial::spherical_harmonic
      • random::beta
      • random::laplace
      • random::nonCentralChiSquared
      • random::triangle
      • random::uniformOnSphere
      • special::airy_ai
      • special::airy_ai_prime
      • special::airy_bi
      • special::airy_bi_prime
      • special::bernoulli
      • special::bessel_in (still available using a C++17 compliant compiler)
      • special::bessel_in_prime
      • special::bessel_jn (still available using a C++17 compliant compiler)
      • special::bessel_jn_prime
      • special::bessel_kn (still available using a C++17 compliant compiler)
      • special::bessel_kn_prime
      • special::bessel_yn (still available using a C++17 compliant compiler)
      • special::bessel_yn_prime
      • special::beta (still available using a C++17 compliant compiler)
      • special::cyclic_hankel_1
      • special::cyclic_hankel_2
      • special::digamma
      • special::erf
      • special::erf_inv
      • special::erfc
      • special::erfc_inv
      • special::gamma
      • special::gamma1pm1
      • special::log_gamma
      • special::polygamma
      • special::prime
      • special::riemann_zeta (still available using a C++17 compliant compiler)
      • special::spherical_bessel_jn (still available using a C++17 compliant compiler)
      • special::spherical_bessel_yn (still available using a C++17 compliant compiler)
      • special::spherical_hankel_1
      • special::spherical_hankel_2
      • special::trigamma
    • Added replace option into random::choice
    • Added nan_to_num function
    • Added complete and incomplete elliptical integrals of the first, second, and third kind to special namespace (requires either Boost or C++17 compliant compiler)
    • Added exponential integral to special namespace (requires either Boost or C++17 compliant compiler)
    • Added NO_MULTITHREAD compile definition to turn off algorithm multithreading from compliant compilers
    Source code(tar.gz)
    Source code(zip)
  • Version_2.3.1(Sep 9, 2020)

  • Version_2.3.0(Aug 31, 2020)

  • Version_2.2.0(Aug 20, 2020)

  • Version_2.1.0(Jul 23, 2020)

  • Version_2.0.0(Jun 21, 2020)

    • Dropped support of C++11, now requires a C++14 or higher compiler
    • Added support for std::complex<T>, closing Issue #58
    • Added more NdArray constructors for STL containers including std::vector<std::vector<T>>, closing Issue #59
    • Added polyfit routine inline with Numpy polyfit, closing Issue #61
    • Added ability to use NdArray as container for generic structs
    • Non-linear least squares fitting using Gauss-Newton
    • Root finding routines
    • Numerical integration routines
    • lu_decomposition and pivotLU_decomposition added to Linalg namespace
    • New STL iterators added to NdArray
      • iterator
      • const_iterator
      • reverse_iterator
      • const_reverse_iterator
      • column_iterator
      • const_column_iterator
      • reverse_column_iterator
      • const_reverse_column_iterator
    • Added rodriguesRotation and wahbasProblem to Rotations namespace
    • Various efficiency and/or bug fixes
    Source code(tar.gz)
    Source code(zip)
  • Version_1.3.0(Nov 20, 2020)

C++17 implementation of constexpr double-array trie

constexpr_doublearray What is this? This library implements a double-array trie of compile-time constants using constexpr in C++17. As you know, compi

Shunsuke Kanda 8 May 6, 2022
SIMD (SSE) implementation of the infamous Fast Inverse Square Root algorithm from Quake III Arena.

simd_fastinvsqrt SIMD (SSE) implementation of the infamous Fast Inverse Square Root algorithm from Quake III Arena. Why Why not. How This video explai

Liam 6 Sep 18, 2022
Minimal matrix implementation in C++

min-matrix Minimal matrix implementation in C++. ?? Pull Request ?? ?? Post Issues ?? Brief ?? Eigen compiles too slow? ?? ?? Just want something simp

Shepard 5 Dec 17, 2021
MIRACL Cryptographic SDK: Multiprecision Integer and Rational Arithmetic Cryptographic Library is a C software library that is widely regarded by developers as the gold standard open source SDK for elliptic curve cryptography (ECC).

MIRACL What is MIRACL? Multiprecision Integer and Rational Arithmetic Cryptographic Library – the MIRACL Crypto SDK – is a C software library that is

MIRACL 498 Sep 28, 2022
A C library for statistical and scientific computing

Apophenia is an open statistical library for working with data sets and statistical or simulation models. It provides functions on the same level as t

null 186 Sep 11, 2022
P(R*_{3, 0, 1}) specialized SIMD Geometric Algebra Library

Klein ?? ?? Project Site ?? ?? Description Do you need to do any of the following? Quickly? Really quickly even? Projecting points onto lines, lines t

Jeremy Ong 621 Sep 30, 2022
linalg.h is a single header, public domain, short vector math library for C++

linalg.h linalg.h is a single header, public domain, short vector math library for C++. It is inspired by the syntax of popular shading and compute la

Sterling Orsten 746 Oct 1, 2022
LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C.

libtommath This is the git repository for LibTomMath, a free open source portable number theoretic multiple-precision integer (MPI) library written en

libtom 531 Sep 29, 2022
a lean linear math library, aimed at graphics programming. Supports vec3, vec4, mat4x4 and quaternions

linmath.h -- A small library for linear math as required for computer graphics linmath.h provides the most used types required for programming compute

datenwolf 708 Sep 22, 2022
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.

OpenBLAS Travis CI: AppVeyor: Drone CI: Introduction OpenBLAS is an optimized BLAS (Basic Linear Algebra Subprograms) library based on GotoBLAS2 1.13

Zhang Xianyi 4.8k Oct 2, 2022
The QuantLib C++ library

QuantLib: the free/open-source library for quantitative finance The QuantLib project (http://quantlib.org) is aimed at providing a comprehensive softw

Luigi Ballabio 3.4k Sep 30, 2022
A C++ header-only library of statistical distribution functions.

StatsLib StatsLib is a templated C++ library of statistical distribution functions, featuring unique compile-time computing capabilities and seamless

Keith O'Hara 404 Sep 28, 2022
SymEngine is a fast symbolic manipulation library, written in C++

SymEngine SymEngine is a standalone fast C++ symbolic manipulation library. Optional thin wrappers allow usage of the library from other languages, e.

null 895 Sep 30, 2022
nml is a simple matrix and linear algebra library written in standard C.

nml is a simple matrix and linear algebra library written in standard C.

Andrei Ciobanu 41 Oct 1, 2022
RcppFastFloat: Rcpp Bindings for the fastfloat C++ Header-Only Library

Converting ascii text into (floating-point) numeric values is a very common problem. The fast_float header-only C++ library by Daniel Lemire does this very well, and very fast at up to or over to 1 gigabyte per second as described in more detail in a recent arXiv paper.

Dirk Eddelbuettel 18 May 2, 2022
📽 Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C

Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C`. cglm provides lot of utils to help math operations to be fast and quick to write. It is community friendly, feel free to bring any issues, bugs you faced.

Recep Aslantas 1.5k Sep 25, 2022
✨sigmatch - Modern C++ 20 Signature Match / Search Library

sigmatch Modern C++ 20 Signature Match / Search Library ✨ Features ?? Header-only, no dependencies, no exceptions. ☕ Compile-time literal signature st

Sprite 48 Sep 6, 2022
C++ library for solving large sparse linear systems with algebraic multigrid method

AMGCL AMGCL is a header-only C++ library for solving large sparse linear systems with algebraic multigrid (AMG) method. AMG is one of the most effecti

Denis Demidov 552 Sep 30, 2022
Header only FFT library

dj_fft: Header-only FFT library Details This repository provides a header-only library to compute fourier transforms in 1D, 2D, and 3D. Its goal is to

Jonathan Dupuy 121 Sep 1, 2022