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

GrB_PRINTSTRING #82

Open
rayegun opened this issue Jan 17, 2024 · 5 comments
Open

GrB_PRINTSTRING #82

rayegun opened this issue Jan 17, 2024 · 5 comments

Comments

@rayegun
Copy link
Collaborator

rayegun commented Jan 17, 2024

Something that would be nice for container objects to provide a formatted string summary using the GrB_get interface.

@eriknw
Copy link
Member

eriknw commented Jan 17, 2024

That seems like a good use for GrB_get 👍

@DrTimothyAldenDavis
Copy link
Member

How long of a string would this be? My GxB_print mechanism could be revised to print to a string instead of a FILE * pointer, but it has control parameter that defines how much detail is desired (one-line, a few lines, the first ~30 entries, or the whole thing). Would you want to control this somehow, perhaps with a GrB_set to set the print level, and then GrB_get to get the size of the string, and then another GrB_get to get the string?

@rayegun
Copy link
Collaborator Author

rayegun commented Jan 17, 2024

An initial GrB_set may be good, but of course that adds a field to each object. Maybe multiple different GrB_STRING_SUMMARY and GrB_STRING_LONG etc is better.

I think I strongly prefer to proliferate field enums than actual fields in the object

@DrTimothyAldenDavis
Copy link
Member

Oh, yes of course, that's a much better suggestion than mine.

GrB_get could use, say, 3 strings: GrB_STRING_SUMMARY (say 1 or a few lines at most), GrB_STRING_SHORT (which I would use to print about 30 entries of a matrix then "..."), and GrB_STRING_LONG (or GrB_STRING_FULL or GrB_STRING_VERBOSE) which would be a string that fully describes the object; it could take GBytes for a huge matrix.

If we add such a GrB_get, it would also be good to be able to use GrB_set to set a user-defined function that can print a single entry to a string. Currently there is no way to print a user-defined data value, not even in my GxB extensions.

@rayegun
Copy link
Collaborator Author

rayegun commented Jan 17, 2024

The udt printer is in my opinion slightly harder to justify for the same reason mentioned above, making GrB_Type heavier.

But still plenty of reason to do it I think

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