Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CsVec constructors #275

Merged
merged 9 commits into from
Jan 25, 2021
Merged

Conversation

mulimoen
Copy link
Collaborator

This is the vector analouge to #274

The new API consists of

  • new: Constructors which panics on failure
  • try_new: Returns all buffers and the error
  • new_sorted: A constructors that may sort the indices and data
  • new_unchecked: Does zero checking of constraints

Internal:

  • new_trusted: The internal version of new_unchecked

A bunch of the other constructors were removed. These can be expressed in some form of the above. The unsafe view constructors are removed in preference to new_unchecked, where the caller must ensure valid lifetimes

Fixes #273

src/sparse/vec.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@vbarrielle vbarrielle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's debate a bit on the naming of new_sorted vs new_unsorted vs new_from_unsorted, and maybe remove new_, and it'll be done.

Thanks!

src/sparse/vec.rs Outdated Show resolved Hide resolved
@mulimoen mulimoen force-pushed the feature/vec_constructors branch from 0fcc741 to 6e3888e Compare January 25, 2021 20:42
Copy link
Collaborator

@vbarrielle vbarrielle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good now, thanks a lot!

@vbarrielle vbarrielle merged commit b5a8f66 into sparsemat:master Jan 25, 2021
@mulimoen mulimoen deleted the feature/vec_constructors branch January 25, 2021 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-sorting constructor
2 participants