Closed mulimoen closed 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.
@vbarrielle What is your though on new_vecview_raw
? This can easily be replaced by new_unchecked
as was done with sprs-ldl
@vbarrielle What is your though on
new_vecview_raw
? This can easily be replaced bynew_unchecked
as was done withsprs-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
.
This moves and renames the constructors of
CsMatBase
. This makes construction of matrices for non-Copy
types easier, and unifies constructors.Modified:
new
: Now implemented onCsMatBase
instead ofCsMatI
. Does not sort indices. Panics on failurenew_csc
: Counterpart to abovetry_new
: Returns a tuple with all owned data + error on failuretry_new_csc
: Counterpart to aboveNew:
new_unchecked
: Unsafe constructor forCsMatBase
, does not do any data checks.Removed:
new_view
:new
can now be used insteadnew_view_raw
: This function is really unsafe, we are opening ourselves to a use-after-free by making a lifetime from nothing. I'd rather push this responsibility away from this crate.Maybe we could remove
new_vecview_raw
? This is not in use by any of our crates, and suffers from the same problems asnew_view_raw
.Fixes #273