sparsemat / sprs

sparse linear algebra library for rust
Apache License 2.0
381 stars 45 forks source link

Add unit tests for DenseVector #310

Closed aadeg closed 2 years ago

aadeg commented 2 years ago

I've added some code to tests the DenseVector trait.

I used tarpaulin to evaluate the coverage improvement of the dense_vector.rs file: from 35% to 64%.

The tests are pretty simple. If you agree, I'd like to write some more unit tests to get confident with the library code and after that contributing on the algorithms.

I've a C++ dev background, and I've recently started learning Rust, so feel free to highlight any mistakes a did.

mulimoen commented 2 years ago

This looks great! You need to run cargo fmt to get the proper formatting, hence the failing CI

aadeg commented 2 years ago

Sorry for that. Now it should be fixed.

mulimoen commented 2 years ago

Seems miri is a bit more aggressive with borrowing rules. I've filed an error for this in https://github.com/rust-ndarray/ndarray/issues/1178 and will ignore this test for now

mulimoen commented 2 years ago

Thanks for your work on this @aadeg!