rust-ndarray VS nalgebra

Compare rust-ndarray vs nalgebra and see what are their differences.

rust-ndarray

ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations (by rust-ndarray)

nalgebra

Linear algebra library for Rust. (by dimforge)
Our great sponsors
  • SonarQube - Static code analysis for 29 languages.
  • Scout APM - Less time debugging, more time building
  • SaaSHub - Software Alternatives and Reviews
rust-ndarray nalgebra
9 9
2,200 2,644
1.8% 2.0%
7.8 9.2
1 day ago 9 days ago
Rust Rust
GNU General Public License v3.0 or later Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

rust-ndarray

Posts with mentions or reviews of rust-ndarray. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-02-09.
  • Rust or C/C++ to learn as a secondary language?
    6 projects | reddit.com/r/Python | 9 Feb 2022
    ndarray and numpy crates provide good way to operate on numpy ndarrays from python
  • Enzyme: Towards state-of-the-art AutoDiff in Rust
    3 projects | reddit.com/r/rust | 12 Dec 2021
    I don't think any of the major ML projects have GPU acceleration because ndarray doesn't support it.
  • Announcing Rust CUDA 0.2
    3 projects | reddit.com/r/rust | 5 Dec 2021
    Not sure about ndarray: https://github.com/rust-ndarray/ndarray/issues/840
  • Signal processing library
    7 projects | reddit.com/r/rust | 6 Nov 2021
    I used basic_dsp a while back and found it lacking. I was hoping to find something that uses the ndarray datatype but i'm not seeing this yet. If you're primarily trying to learn though it might not really matter which library you contribute to. As for myself, I just picked the one that was most used and actively worked on at the time. However I keep an eye out on other libraries; if I see something take off, I might switch over. Either way you'll learn and can point to it as work accomplished.
  • Searching help for Rust Image Manipulation
    2 projects | reddit.com/r/rust | 31 Jul 2021
    Most libraries use either an older C/C++ dynamically or statically. I was looking into maybe rewriting some image manipulation functions in Rust using ndarray (which would then allow for both hardware, gpu and multithreading acceleration), but it would take a very long to get fully into the subject.
  • Dumb question: I want to overload operators like add on structs, what is the name for what I'm trying to do?
    3 projects | reddit.com/r/learnrust | 30 Apr 2021
    The best way would to use a crate for this, such as ndarray, which provides some good ways to do this.
  • Making Maintaining Easier
    5 projects | reddit.com/r/rust | 25 Apr 2021
    First, let me explain a crate, where old dependencies do matter. There is one very handy crate called nshare. It's used for converting images into ndarrays. The libraries between nshare converts are regularly updated, for example to support new formats or to make the usage more convenient. If one writes a new software there could be conflicts in versions of ndarray (for example), so we make sure, that nshare is always up-to-date and works with the newest versions in order to build the best code on it. Another example could be everything cryptographic. If there would be a security issue with ring we really want every dependent to be updated.
  • Linfa has a website now!
    4 projects | reddit.com/r/rust | 8 Mar 2021
    well you can represent categorical values in `ndarray` for sure (even structured arrays [here](https://github.com/rust-ndarray/ndarray/issues/32)), but the memory has to be contiguous for BLAS/LAPACK and therefore it is impossible to mix continuous and categorical values. I was thinking that we could emulate categorical values with a descriptor field for the type of each feature and then just use floats to represent them.
  • ndarray: Apply along axis
    2 projects | reddit.com/r/rust | 6 Mar 2021
    ndarray Readme links to matrix https://github.com/rust-ndarray/ndarray

nalgebra

Posts with mentions or reviews of nalgebra. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-12-18.
  • What is the state of linear algebra crates in Rust?
    1 project | reddit.com/r/rust | 3 Apr 2022
    The only crate I'm aware of is nalgebra. I'm not familiar enough with it or the libraries you mentioned to compare them.
  • -🎄- 2021 Day 19 Solutions -🎄-
    94 projects | reddit.com/r/adventofcode | 18 Dec 2021
    I coded it in rust, with the very good lib nalgebra for the vector, point, matrix and SVD computation and petgraph for the graph, and I'm very happy with my math heavy, computer vision and no brute force solution.
  • Announcing Rust CUDA 0.2
    3 projects | reddit.com/r/rust | 5 Dec 2021
    It looks like nalgebra is already working on adding support for rust CUDA: https://github.com/dimforge/nalgebra/pull/1031
  • What is Rust NOT suitable for, architecturally?
    6 projects | reddit.com/r/rust | 28 Nov 2021
    Actually I would disagree with this somewhat. It's not as built out as Julia or python with third party crates, but that is likely to keep improving. The ability to implement the traits in std::ops means that the natural use of +, *, etc to "add" or "multiply" custom types is possible. There is already rug for big number / high precision calculations, nalgebra for linear algebra, among a couple others for ode solving etc. Rust's iterators are also ergonomically magnificent for math involving iteration. Where I would agree it is less ergonomic is for scientists that don't care about the speed gains from the rust memory management system having to deal with the borrow checker. With a little understanding of the way that works, it doesn't get in the way much IMO. Not saying it will ever be a go to language for scientific computation, just that it's more than possible, and can be just as enjoyable.
  • Software for math research
    2 projects | reddit.com/r/math | 10 Oct 2021
    nalgebra
  • Software for Math Research
    2 projects | news.ycombinator.com | 10 Oct 2021
  • Integrating const-generics to nalgebra 0.26 (linear-algebra library)
    1 project | reddit.com/r/rust | 13 Apr 2021
    Well the size of the changes was massive with around 10K lines chanhged. But a lot of it could be done semi-automatically after the "core" changes to our trait system managing dimensions was done.
  • I have written a blog post about my experience using Rust for scientific numerical applications
    7 projects | reddit.com/r/rust | 8 Apr 2021
    During my Ph.D., I made a Hartree-Fock implementation using Haskell (https://github.com/felipeZ/Haskell-abinitio). What I learnt from it is that most of the work is actually in implementing the integrals. But with Rust, you can take the integrals from libraries like libint2 (https://github.com/evaleev/libint) and focus on the implementation's physics. The integrals and the diagonalization of the resulting operators are the bottlenecks in both Hartree-Fock and DFT. So, if you take something like libint2 for the integrals and Nalgebra (https://nalgebra.org/) for the linear algebra, the application is going to be lightning-fast. But if you decide to implement the integrals yourself, I think it would take a significant time until you can reach the current Fortran/C++ implementation performance.
  • Physics simulation with Rapier: 2021 roadmap
    1 project | reddit.com/r/rust | 1 Jan 2021
    I tried to use min-const-generics today, and I can say that, yes, we will use it once the version 1.51 is released! Here is a PR that makes nalgebra switch to const-generics for statically-sized matrices/vectors: https://github.com/dimforge/nalgebra/pull/820

What are some alternatives?

When comparing rust-ndarray and nalgebra you can also consider the following projects:

cgmath-rs - A linear algebra and mathematics library for computer graphics.

scirust - Scientific Computing Library in Rust

rulinalg - A linear algebra library written in Rust

image - Encoding and decoding images in Rust

rust-blas - BLAS bindings for Rust

neuronika - Tensors and dynamic neural networks in pure Rust.

rust-GSL - A GSL (the GNU Scientific Library) binding for Rust

arrayfire-rust - Rust wrapper for ArrayFire

nphysics - 2 and 3-dimensional rigid body physics engine for Rust.

dasp - The fundamentals for Digital Audio Signal Processing. Formerly `sample`.

lapack - Wrappers for LAPACK (Fortran)

rust-opencl - OpenCL bindings for Rust.