Commit Graph

94 Commits

Author SHA1 Message Date
Sébastien Crozet c5276c90e1 cargo fmt 2023-11-12 23:17:33 +01:00
Alessandro Rocco Scisca 0887b875a5 Implement Default trait for sparse matrix types 2023-10-30 17:50:56 +00:00
Sébastien Crozet b39bd09eaa chore: swap test names 2023-09-30 17:55:04 +02:00
julianknodt 666b0fd2de Add `try_from_triplets_iter`
Calls `try_from_triplets` for now, and is mentioned in the documentation.
2023-08-22 22:19:42 -07:00
Andreas Longva 02caca0ece Update slice->view in nalgebra-sparse 2022-11-14 15:32:17 +01:00
lukas e227dd693e Refactor unit tests 2022-10-10 19:05:47 -07:00
lukas 9a38c554af add test case 2022-10-02 11:57:37 -07:00
lukas 0eb1f5c125 'fix error's 2022-08-16 20:10:17 -07:00
lukas 41e1cc0db2 extend test case 2022-08-16 00:20:13 -07:00
lukas bdfa643e3c clear_triplets 2022-08-16 00:15:03 -07:00
lukas bcc5527baa Switch return type to just T 2022-08-15 19:28:58 -07:00
lukas b90dc7c042 Add `clear_triplet()` 2022-08-15 19:14:38 -07:00
Andreas Borgen Longva 030f155dc3
Merge branch 'dev' into matrixmarket-io 2022-06-13 09:51:08 +02:00
Andreas Longva 9b32195558 Change write -> save in order to be consistent with load terminology 2022-05-09 09:51:55 +02:00
Hantao Hui 8424232dfb merge updates from dev branch 2022-05-07 13:46:52 +02:00
Hantao Hui 31fc498182 use tempdir to write matrix when running test 2022-05-07 13:40:25 +02:00
Andreas Borgen Longva 3981857f2b
Merge branch 'dev' into matrixmarket-io 2022-04-22 08:57:06 +02:00
Saurabh 19c7f19afa fix tests 2022-04-01 15:26:55 -06:00
Saurabh 04a97bb79e Merge branch 'dev' of https://github.com/dimforge/nalgebra into dev 2022-03-21 16:57:32 -06:00
Saurabh f795f0f872 tests don't need to test the unchecked kernel separately 2022-03-21 16:56:22 -06:00
Hantao Hui 8e48d26767 add more tests; use bufwritter; fix typo; use temp_dir to test with files 2022-03-21 12:19:34 +01:00
Anton Arsenij 757b99e843
CSC: Create constructor for unsorted but otherwise valid data (#1015)
* CSC: Create constructor for unsorted but otherwise valid data

* Test creating csc matrix from unsorted but valid data

* Add function for validation and sorting

* Move validation function to cs.rs

* Restore pattern unit test

* Add unit test for 'major offset out of bounds' case

* Avoid permutation allocations on 'happy path'

* Reuse allocated permutation

* Fix comments for test-data examples

* Remove unnecessary iter variable

* Set up buffers for sorting up front

* Use common apply_permutation function

* Use common compute_sort_permutation function

* Move unsafe down to unchecked call

* Add panic cases to documentation

* Remove unnecessary Zero bound

* Move buffer set up away from loop

* Lift T::Zero from cs.rs

* Improve checking if values are provided

* Simplify copying from slices & add test for wrong values length

* Check duplicates after sorting

* Fix formatting

* Check values length at the beginning

* Check length of values if values != None
2022-03-03 10:14:16 +01:00
Hantao Hui d511e372de add support for matrix market export 2022-01-24 23:17:30 +01:00
Fabian Loeschner 89f1e855bb Revert "Fix panic in SparsityPattern::try_from_* if major index is out of bounds"
This reverts commit 12afe2917af4c30fc4a17316e453d0830072642c to avoid conflict with #1015.
2022-01-11 10:35:07 +01:00
Fabian Loeschner e9b7718292 Fix panic in SparsityPattern::try_from_* if major index is out of bounds 2022-01-11 10:35:07 +01:00
Fabian Loeschner bfaf29393c Implement Serialize, Deserialize for SparsityPattern 2022-01-11 10:35:07 +01:00
Fabian Loeschner 40d8a904a3 Implement Serialize, Deserialize for Csc, Coo; move helper out of impls 2022-01-11 10:35:07 +01:00
Fabian Löschner f9aca24b15 Implement Serialize and Deserialize for CsrMatrix 2022-01-11 10:35:07 +01:00
Hantao Hui 656180f40e fix for empty dense matrix 2021-12-13 09:28:28 +01:00
Hantao Hui 92b324c007 code fmt; fix failing unit test and doc test 2021-12-12 12:10:20 +01:00
Andreas Longva 4d0f401882 Add (failing) test for empty matrix market matrix 2021-12-01 11:27:03 +01:00
Andreas Longva 4c039573f2 Make nalgebra-sparse unit tests require io feature 2021-12-01 11:26:51 +01:00
Hantao Hui 332fe8c0e4 update loading matrix market, including:
1. Several renamings
2. removed unnecessary traits
3. added support for dense matrix
4. removed unnecessary comparison when reading data line by line. (e.g.
   only read header line once)
2021-11-17 16:41:10 +01:00
Hantao Hui 7f9128c92d added reading matrix market data to sparse coomatrix 2021-11-02 10:59:59 +01:00
Anton 752d1f300d Permute values without unnecessary allocation 2021-10-20 01:50:42 +02:00
Anton f90bb8d64a Fix wrong csr-constructor call 2021-10-18 10:59:51 +02:00
Anton 86eeb192db Add module for unit test data examples 2021-10-17 22:29:59 +02:00
Anton 4b41be75b0 Add tests for some csr matrix related failure cases 2021-10-14 23:18:34 +02:00
Anton 469765a4e5 Apply permutation 2021-10-08 00:36:40 +02:00
Anton 9e85c9e2b6 CSR/CSC: Provide constructor for unsorted but otherwise valid data 2021-10-03 14:59:28 +02:00
Paul Jakob Schroeder e6e7efba8a COO: add push_matrix fn
- This function allows one to add entire dense matrices
to a sparse COO matrix.
- Added a small mention of this new function in the
example in lib.rs
2021-06-08 10:05:50 -04:00
Andreas Longva 66b9185ec1 Test CsrMatrix::row_iter(_mut) and CscMatrix::col_iter(_mut) 2021-02-01 14:38:11 +01:00
Andreas Longva 1ebb612d46 Test Csr/CscMatrix::{index_entry, index_entry_mut, get_entry, get_entry_mut} 2021-02-01 09:27:33 +01:00
Andreas Longva 0936c4fad9 Add tests for Csr/CscMatrix::identity 2021-02-01 08:52:13 +01:00
Andreas Longva 7473d54d74 rustfmt 2021-01-26 10:11:24 +01:00
Andreas Longva 7b6333e9d1 Rename some Csr/Csc/SparsityPattern methods 2021-01-26 10:11:24 +01:00
Andreas Longva 0bee9be6c7 Extend CSC/CSR * Dense to work for combinations of ref and owned 2021-01-26 10:11:24 +01:00
Andreas Longva 7a083d50f7 Increase tolerance to ensure tests pass
It's possible that some particularly bad inputs cause
severe loss of significance in the triangular solves.
This is exacerbated by the fact that the way we test
the (residual) error is also prone to loss of significance,
so that the error measure itself is problematic.

We could maybe improve this in the future by using arbitrary-
precision arithmetic to remove some sources of error and testing
against appropriate bounds.
2021-01-26 10:11:24 +01:00
Andreas Longva 31c911d4fb Change proptest strategies to use DimRange 2021-01-26 10:11:24 +01:00
Andreas Longva 9cd1540496 Improve and test proptest generators
Due to a bug in proptest, we were required to pull in and modify
parts of proptest::strategy::Shuffle. Once the below PR has been merged
and released on crates.io, we can remove this code.

https://github.com/AltSysrq/proptest/pull/217
2021-01-26 10:11:24 +01:00