Commit Graph

240 Commits

Author SHA1 Message Date
Saurabh f795f0f872 tests don't need to test the unchecked kernel separately 2022-03-21 16:56:22 -06:00
Saurabh c6f832d1d8 put back checked kernels and refactor upper layer 2022-03-21 16:55:46 -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
Saurabh 6d26f4f32c Merge branch 'dev' of github.com:smr97/nalgebra into dev 2022-03-12 15:12:32 -07:00
Saurabh b19f0d7473 unnecessary index information 2022-03-12 15:04:08 -07:00
Saurabh a2422ee02b filter out only matrix files 2022-03-12 15:04:08 -07:00
Saurabh 424207914b run over a directory 2022-03-12 15:04:08 -07:00
Saurabh 8c1186db3c Added missing example file 2022-03-12 15:04:08 -07:00
Saurabh ff3d1e4e35 prealloc everything, remove hashset, make it 4x faster 2022-03-12 15:04:08 -07:00
Saurabh e7d8a00836 add spmm example and change the kernel 2022-03-12 15:04:08 -07: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
Saurabh 46a757fc42 Added missing example file 2022-02-26 18:24:24 -07:00
Hantao Hui 0cae584262 use writeln! macro; replace unsafe with expect 2022-02-25 18:10:34 +01:00
Saurabh 1323b37607 prealloc everything, remove hashset, make it 4x faster 2022-02-18 11:22:43 -07:00
Saurabh 776fef26c3 add spmm example and change the kernel 2022-02-15 17:38:20 -07:00
Hantao Hui 9e0dfd14de use std::io::Write trait when export to matrix market 2022-02-13 21:16:16 +01:00
Hantao Hui 8904c01c7b export to file directly; add a new trait for export 2022-02-03 11:49:15 +01:00
Hantao Hui d511e372de add support for matrix market export 2022-01-24 23:17:30 +01:00
Fabian Loeschner 99eb8c1589 Revert "Rename nrows/ncols args for try_from_*_data functions for consistency"
This reverts commit 2a3e657b56.
2022-01-13 10:28:00 +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 38989ed5f0 Move sparse matrix serialization to separate files 2022-01-11 10:35:07 +01:00
Fabian Löschner 583fde05fe Add comment explaining intermediate types for serialization 2022-01-11 10:35:07 +01:00
Fabian Löschner fe70a80e41 Partial revert "Use custom serde errors, make all sparse errs lowercase" 2022-01-11 10:35:07 +01:00
Fabian Loeschner 513178e03e Revert "Updated more error messages"
This reverts commit a42eae45e045c391ede37a7a4328c09cbbb87a0f.
2022-01-11 10:35:07 +01:00
Fabian Löschner 647455dadd Move serialization code to submodules 2022-01-11 10:35:07 +01:00
Fabian Löschner 837ded932e Replace usage of Cow with generic type 2022-01-11 10:35:07 +01:00
Fabian Löschner 9b87fa4ffa Add cfg attribute to Cow imports 2022-01-11 10:35:07 +01:00
Fabian Löschner a8fa7f71c0 Unify separate (de)serialization helper structs by using Cow<'a, [T]> 2022-01-11 10:35:07 +01:00
Fabian Loeschner 3be81be2e3 Updated more error messages 2022-01-11 10:35:07 +01:00
Fabian Loeschner 7e67d920a7 Use custom serde errors, make all sparse errs lowercase w/o punctuation 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 e2c33b48ac Simplify Deserialize bound 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 2a3e657b56 Rename nrows/ncols args for try_from_*_data functions for consistency 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 Loeschner 18b694dad2 Move serialization helper structs into trait 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
Sébastien Crozet e8b9c40123 Release v0.30.0 2022-01-02 15:30:15 +01:00
Sébastien Crozet 1576a1517a
Merge pull request #1017 from losanc/matrixmarket-io
added reading matrix market data to sparse coomatrix
2021-12-21 01:51:08 -08:00
Hantao Hui 96b65c430f using no_run in doc code example 2021-12-17 14:48:14 +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 6e10efe862 Remove redundant proptest patch 2021-12-01 12:44:07 +01:00
Andreas Longva e2820316a8 Fix typos 2021-12-01 12:17:47 +01:00
Andreas Longva 4569484aa0 Line breaks 2021-12-01 12:08:42 +01:00
Andreas Longva e3d1119bff Hide MatrixMarketScalar implementation details for now
The existing MatrixMarketScalar is relatively closely tied to the way
oru parser is implemented. I've moved these internals into an internal
trait and sealed the public trait.

This makes it less flexible for users for now, but gives us more freedom
to change internals in the future.
2021-12-01 11:45:11 +01:00
Andreas Longva 93f3d60005 Remove From<pest::Error> for MatrixMarketError
We want pest to remain an internal implementation detail, so it should
not leak into the public API.
2021-12-01 11:33:08 +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
Andreas Longva 1b73b2f991 Link to matrix market IO in lib.rs 2021-12-01 11:07:47 +01:00
Andreas Longva 3b67afcd9b Matrix market: Extend and reword documentation, rename some types 2021-12-01 11:07:13 +01:00
Hantao Hui 1cc5c7eba6 fix doc typo 2021-11-23 16:17:06 +01:00
Hantao Hui 920bd75b82 fix typo 2021-11-18 11:42:47 +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 89416baace Bring apply permutation function back to serial.rs 2021-10-20 20:28:38 +02: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 4a97989738 Improve checking requirements for sorting column indices 2021-10-11 23:01:12 +02:00
Anton 469765a4e5 Apply permutation 2021-10-08 00:36:40 +02:00
Anton a2a55cddca Check first and last offsets before sorting column indices 2021-10-05 00:07:04 +02:00
Anton 9e85c9e2b6 CSR/CSC: Provide constructor for unsorted but otherwise valid data 2021-10-03 14:59:28 +02:00
Sébastien Crozet d1d7422761 Bump the version of nalgebra-glm, nalgebra-lapack, and nalgebra-sparse. 2021-08-08 18:07:34 +02:00
Sébastien Crozet db63f6c031 Release v0.29.0 2021-08-08 17:54:35 +02:00
Sébastien Crozet 0b9a1acea5 Fix nalgebra-sparse. 2021-08-04 18:20:55 +02:00
Sébastien Crozet dd6c40016e Remove the Copy requirement from SimdRealField. 2021-08-04 17:34:25 +02:00
Sébastien Crozet 492ed8cc8d Fix nalgebra-sparse 2021-08-03 10:58:23 +02:00
Sébastien Crozet 8c6ebf2757 Implement the single-allocator-trait approach. 2021-08-02 18:41:46 +02:00
Sébastien Crozet d34fed45bc Merge branch 'dev' into ub3 2021-08-02 18:40:33 +02:00
Violeta Hernández 2243a11e89 Added some derives 2021-07-29 12:33:45 -05:00
Rémi Lauzier c35f792b4f
Fix some warnings 2021-07-27 19:24:55 -04:00
Violeta Hernández a753d84aae cargo fmt 2021-07-17 21:50:06 -05:00
Violeta Hernández c01d591478 We have reached compilation! 2021-07-17 13:01:03 -05:00
Violeta Hernández 87fe2b30df Checkpoint #9 2021-07-16 23:17:56 -05:00
Violeta Hernández c3f869e017 Checkpoint #8 2021-07-16 01:53:28 -05:00
Crozet Sébastien ca1297acfb Release v0.28.0 2021-07-11 17:42:45 +02:00
Violeta Hernández 6e96c28ad9 Trivial doc comment improvements 2021-07-06 21:05:25 -05: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
Malte Tammena 9eb9ad603f Add `get_mut` annotations (second try) 2021-06-07 17:24:43 +02:00
Malte Tammena 38e9a5da33 Annotate `get_mut`/`slice`-like functions with `#[must_use]` 2021-06-07 17:15:36 +02:00
Malte Tammena 9fb963017f Simplify default `#[must_use]` annotation 2021-06-07 16:34:03 +02:00
Malte Tammena 42a2c74571 Finish initial must_use annotations 2021-06-06 15:28:37 +02:00
Crozet Sébastien dfc8ad3d6a Release v0.27.0 2021-06-02 15:15:17 +02:00
Dave Farnham 79ef862fe9 Fix docs on csc_data(), csc_data_mut() 2021-05-09 14:58:26 -06:00
Sébastien Crozet d67aec80fd
Merge pull request #885 from chammika-become/coo-reserve
CooMatrix::reserve added
2021-05-09 16:58:43 +02:00
Andreas Longva b85335bd9c Update matrixcompare version to 0.3.0
Fixes some warnings produced by earlier versions since Rust 1.51.
See https://github.com/Andlon/matrixcompare/pull/5 for more details.

Note that we only update dev-dependencies, so there is no API breakage.
2021-05-07 09:23:46 +02:00
Chammika Mannakkara 5d638a32b8 correct all gramatical mistakes pointed by @Andlon 2021-05-04 12:29:25 +09:00
Chammika Mannakkara c420afde9e CooMatrix::reserve added 2021-05-02 20:43:16 +09:00
Crozet Sébastien c5c6c139ab Release v0.26.0 2021-04-12 16:15:08 +02:00
Crozet Sébastien 24d546d3b6 Rename generic parameter N -> T 2021-04-11 13:57:54 +02:00
Crozet Sébastien 7fdac06365 Fix cargo metadata to allow publishing nalgebra-lapack and nalgebra-sparse. 2021-03-01 14:49:03 +01:00
Crozet Sébastien 5b9b94c610 Release v0.25.0 2021-03-01 14:25:29 +01:00
Crozet Sébastien 80aa4faa38 Fix tests for nalgebra-sparse. 2021-03-01 12:42:54 +01:00
Crozet Sébastien 6cfd2bca14 Use proptest for all nalgebra tests. 2021-02-28 17:52:14 +01:00
Crozet Sébastien 660106255c nalgebra-sparse: re-export nalgebra. 2021-02-25 11:14:44 +01:00
Crozet Sébastien c6f7cae326 Move COO, CSC, CSR constructor at the top of the impls. 2021-02-25 11:11:29 +01:00
Crozet Sébastien 98ae4f3818 nalgebra-sparse: reexport CooMatrix, CscMatrix, and CsrMatrix at the root of the crate. 2021-02-25 11:03:47 +01:00
Andreas Longva 66b9185ec1 Test CsrMatrix::row_iter(_mut) and CscMatrix::col_iter(_mut) 2021-02-01 14:38:11 +01:00