Skip to content

Add gb.MAX_SIZE, which is GrB_INDEX_MAX + 1 #519

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

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

eriknw
Copy link
Member

@eriknw eriknw commented Nov 5, 2023

INDEX_MAX may be a nice global value to expose. The GraphBLAS spec doesn't have many of these globals.

This is the largest index value, not the size of the domain of indices. For example, create the largest vector via Vector(int, INDEX_MAX + 1). Also, note that the spec does not specify a value for GrB_INDEX_MAX, only that implementations define it, so it may be backend-dependent.

Alternatively, we could instead define MAX_SIZE, which would be GrB_INDEX_MAX + 1. I think this is much more natural to use; e.g., Matrix(int, MAX_SIZE, MAX_SIZE). I don't think we need both INDEX_MAX and MAX_SIZE.

So, which to y'all prefer, INDEX_MAX or MAX_SIZE? Feel free to suggest different names too.
CC @michelp @jim22k @SultanOrazbayev

This is the largest index, not the size of the domain of indices.
For example, create the largest vector via `Vector(int, INDEX_MAX + 1)`.
Also, note that the spec does not specify a value for `GrB_INDEX_MAX`,
only that the implementation define it, so it may be backend-dependent.
Copy link

codecov bot commented Nov 5, 2023

Codecov Report

Merging #519 (31da669) into main (c6d1e31) will decrease coverage by 0.27%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #519      +/-   ##
==========================================
- Coverage   99.69%   99.42%   -0.27%     
==========================================
  Files          95       95              
  Lines       21884    21889       +5     
  Branches     4138     4139       +1     
==========================================
- Hits        21818    21764      -54     
- Misses         40       78      +38     
- Partials       26       47      +21     

@michelp
Copy link

michelp commented Nov 5, 2023

+1 for MAX_SIZE

@eriknw eriknw changed the title Add gb.INDEX_MAX, which is GrB_INDEX_MAX Add gb.MAX_SIZE, which is GrB_INDEX_MAX + 1 Nov 5, 2023
Copy link
Member

@SultanOrazbayev SultanOrazbayev left a comment

Choose a reason for hiding this comment

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

LGTM!

@eriknw eriknw merged commit 1ecf333 into python-graphblas:main Nov 6, 2023
@eriknw
Copy link
Member Author

eriknw commented Nov 6, 2023

Thanks, this is in!

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.

3 participants