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

BB-35: New operation: GrB_subassign #20

Open
mcmillan03 opened this issue Sep 3, 2021 · 1 comment
Open

BB-35: New operation: GrB_subassign #20

mcmillan03 opened this issue Sep 3, 2021 · 1 comment

Comments

@mcmillan03
Copy link
Member

See SuiteSparse GxB_subassign function [someone fill in description here.]

@DrTimothyAldenDavis
Copy link
Member

GrB_assign computes C(I,J)+=A, where C and M have the same size.
GxB_subassign computes C(I,J)+=A where C(I,J), M, and A all have the same size.
They are the same if I and J are both GrB_ALL, or if the mask is NULL and the null mask is not complemented.

GrB_assign can be broken down into the following steps:
(1) S = C(I,J)
(2) S = S accum A
(3) Z = C
(4) Z(I,J) = S
(5) C=Z

GxB_subassign breaks down in the these steps:
(1) S = C(I,J)
(2) S = S accum A
(3) C(I,J) = S

So far, nearly all uses I have seen of GrB_assign and GxB_subassign fall into one of 3 categories:
(1) simple case: I and J are both GrB_ALL and there is no mask
(2) just the mask is present (in many forms, complemented or not, etc), but I and J are both NULL
(3) just I and J are present but the mask is NULL.

In all those cases, GrB_assign and GxB_subassign are identical. I still think a GrB_subassign is important, and should be considered as an addition to the spec, but after writing many algorithms for LAGraph, this is not as high a priority as I once thought.

I have a section in my user guide "Comparing GrB_assign and GxB_subassign", which is section 10.10 in my v5.1.7 user guide, page 223.

@jim22k jim22k added this to the Math Spec milestone Nov 28, 2022
@jim22k jim22k removed this from the Math Spec milestone Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants