sparsemat / sprs

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

Checked constructors for CsVec and CsMat #236

Closed mulimoen closed 3 years ago

mulimoen commented 3 years ago

This is a first step in disallowing invalid structures from being created, to uphold the guarantees of sortedness of the structures. This limits the surface where non-sortedness could appear by calling new_trusted. We could add debug assertations to new_trusted if we are paranoid.

Methods to test if invariants are upheld has been moved to the utils module. They could be useful for library users, and could be made public.

mulimoen commented 3 years ago

This should not be a breaking change.

vbarrielle commented 3 years ago

Perfect then.