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

empty matrices and vectors #58

Open
DrTimothyAldenDavis opened this issue Nov 3, 2021 · 0 comments
Open

empty matrices and vectors #58

DrTimothyAldenDavis opened this issue Nov 3, 2021 · 0 comments
Assignees
Milestone

Comments

@DrTimothyAldenDavis
Copy link
Member

GrB_Matrix_new and GrB_Vector_new should allow any or all dimensions of a matrix or vector to be zero. MATLAB, Python, and Julia all allow for this, and if GraphBLAS is to be used in such languages, it must support them. Empty matrices of size, say, 10-by-0 or 0-by-10, are important.

Example: say an algorithm searches a graph for nodes with a particular property, and wishes to return an INT64 GrB_Vector with a list of those k nodes. If no nodes are found, k is zero and the vector has length zero.

Suppose the set of neighbors of these k nodes is to be computed, one set per node. Then C = A (list,:) can be created using a list of such nodes. If the list is empty, C is 0-by-n, which is the correct answer and correct dimension of C.

There are many such examples. Empty matrices and vectors allow for clean handling of edge conditions in an algorithm. This issue should be considered for the v2.1 release.

@jim22k jim22k added this to the v2.1 milestone Mar 29, 2023
@rayegun rayegun self-assigned this Jun 28, 2023
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

No branches or pull requests

3 participants