Commit Graph

18 Commits

Author SHA1 Message Date
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
Sébastien Crozet
dd6c40016e Remove the Copy requirement from SimdRealField. 2021-08-04 17:34:25 +02:00
Rémi Lauzier
c35f792b4f
Fix some warnings 2021-07-27 19:24:55 -04:00
Malte Tammena
9eb9ad603f Add get_mut annotations (second try) 2021-06-07 17:24:43 +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
Andreas Longva
7473d54d74 rustfmt 2021-01-26 10:11:24 +01:00
Andreas Longva
5d5ed5be0b Various minor doc and comment fixes 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
c43a2b1679 Impl Csr/CscMatrix::into_pattern_and_values 2021-01-26 10:11:24 +01:00
Andreas Longva
e655fed4fa Replace Arc<SparsityPattern> with SparsityPattern
After much deliberation, I have come to the conclusion that the
benefits do not really outweigh the added complexity. Even though
the added complexity is relatively minor, it makes it somewhat
more complicated to inter-op with other sparse linear algebra
libraries in the future.
2021-01-26 10:11:24 +01:00
Andreas Longva
4b395523dd Fix issue with UninitVec and zero-sized types 2021-01-26 10:11:24 +01:00
Andreas Longva
ef3477f411 Remove Zero bound for transpose and impl SparsityPattern::transpose 2021-01-26 10:11:24 +01:00
Andreas Longva
5869f784e5 Implement CsrMatrix/CscMatrix::filter and associated helpers
Includes ::lower_triangle(), ::upper_triangle() and
::diagonal_matrix().
2021-01-26 10:11:24 +01:00
Andreas Longva
6e34c23d05 Implement Csr/CscMatrix::identity 2021-01-26 10:11:24 +01:00
Andreas Longva
dbdf5567fc Implement arithmetic operations for CSC matrices 2021-01-26 10:11:24 +01:00
Andreas Longva
e261e7c388 Remove use of unsafe for CsLaneIterMut 2021-01-26 10:11:24 +01:00
Andreas Longva
b59c4a3216 Refactor most of Csr/CscMatrix logic into helper type CsMatrix
Still need to update CSC API so that it mirrors CsrMatrix
in terms of get_entry and so on.
2021-01-26 10:11:24 +01:00