sparsemat / sprs

sparse linear algebra library for rust
Apache License 2.0
394 stars 46 forks source link

Revamp constructors #274

Closed mulimoen closed 3 years ago

mulimoen commented 3 years ago

This moves and renames the constructors of CsMatBase. This makes construction of matrices for non-Copy types easier, and unifies constructors.

Modified:

New:

Removed:

Maybe we could remove new_vecview_raw? This is not in use by any of our crates, and suffers from the same problems as new_view_raw.

Fixes #273

mulimoen commented 3 years ago

On second thought I think it would be ok to have both new and try_new. I will however change try_new so it returns the owned data.

mulimoen commented 3 years ago

@vbarrielle What is your though on new_vecview_raw? This can easily be replaced by new_unchecked as was done with sprs-ldl

vbarrielle commented 3 years ago

@vbarrielle What is your though on new_vecview_raw? This can easily be replaced by new_unchecked as was done with sprs-ldl

I think the more we can use new_unchecked or new_trusted to replace these calls, the better. If we can have a very coherent API it'll be easier to code against sprs.