ndarray 0.2.0
A NumPy-like ndarray library for C
Loading...
Searching...
No Matches
ndarray for C and Zig

A ndarray library for C, with Zig bindings.

  • Multi-dimensional arrays (ndim >= 2)
  • OpenMP parallelization
  • BLAS-optimized operations

Dependencies:

  • OpenMP
  • OpenBLAS

Documentation:

To add this library to your zig project, once you have the dependencies installed:

zig fetch --save "git+https://github.com/jailop/ndarray-c#main"

This library has also bidings for Nim:

Limitations

  • This library only implements basic operations to work with multi-dimensional arrays. The motivimation is to have a tool to implement algorithms that required multi-dimensional arrays.
  • Zig bindings are limited to a maximum of 64 dimensions. That parameter can be adjusted. That is because a pre-allocated buffer by thread is used to convert dimension types from Zig to C.

Disclaimers

  • This is a project for learning.
  • At this moment the API can change at any moment.
  • At this moment, the library is not intended for production use.
  • Feedback is welcomed

Pending decisions

  • It has not being decided the error management approach. At this moment, only asserts are applied. If an invariant is violated, the program is interrupted.
  • The intention is that function names indicate if the result is a new allocated array or it is only an scalar. Functions that doesn't have an indication about its return value, perform inplace operations over the first argument. This idea still needs to be refined.

License

BSD 3-Clause License. See [LICENSE](LICENSE) file for details.