-
Notifications
You must be signed in to change notification settings - Fork 62
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
Make LAGraph_random configurable with ranges #59
Labels
enhancement
New feature or request
Comments
szarnyasg
changed the title
LAGraph_random adds
LAGraph_random inserts explicit zero elements
Jan 21, 2020
Yes, it's intentional since explicit zeros are sometimes interesting. So
the feature should be kept, but we could add functionality.
For this case, and perhaps other uses (like int8 for example) it might be
nice to be able to specify a range of values that the entries can be
given. I do this in my GrB.random function in my MATLAB interface, where a
range can be specified (lo and hi).
…On Tue, Jan 21, 2020 at 1:32 PM Gabor Szarnyas ***@***.***> wrote:
Followup of issue Graphegon/pygraphblas#8
<Graphegon/pygraphblas#8>. LAGraph_random
<https://github.com/GraphBLAS/LAGraph/blob/master/Source/Utility/LAGraph_random.c>
fills zero-values in nonzero positions as demonstrated by the following
code:
int seed = 42;
GrB_Index nvals;LAGraph_random(&A, GrB_BOOL, 10, 10, 4, false, true, false, false, true, &seed);GrB_Matrix_nvals(A, &nvals);GrB_wait();GxB_print(A, GxB_SHORT);
row: 0 : 1 entries [0:0] column 9: 1 row: 1 : 1 entries [1:1] column 4: 1 row: 2 : 1 entries [2:2] column 6: 1 row: 3 : 1 entries [3:3] column 4: 0 row: 4 : 2 entries [4:5] column 1: 1 column 3: 0 row: 6 : 1 entries [6:6] column 2: 1 row: 9 : 1 entries [7:7] column 0: 1
I'm not sure whether this is the intended behaviour but based on the
random generators for INT and FP types, putting "explicit zeros" is
intentional. So maybe this should be kept as is but documented in the
header comment of LAGraph_random. What do you think?
PS: For booleans, setting the make_pattern parameter to true works around
the problem.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#59?email_source=notifications&email_token=AEYIIONSNLCC23RMKGSUT3LQ65EVJA5CNFSM4KJY33HKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IHXL7DQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEYIIOMA7GHKCXJ3SGVTVBTQ65EVJANCNFSM4KJY33HA>
.
|
szarnyasg
changed the title
LAGraph_random inserts explicit zero elements
Make LAGraph_random configurable with ranges
Mar 3, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Followup of issue Graphegon/pygraphblas#8.
LAGraph_random
fills zero-values in nonzero positions as demonstrated by the following code:I'm not sure whether this is the intended behaviour but based on the random generators for INT and FP types, putting "explicit zeros" is intentional. So maybe this should be kept as is but documented in the header comment of
LAGraph_random
. What do you think?PS: For booleans, setting the
make_pattern
parameter totrue
works around the problem.The text was updated successfully, but these errors were encountered: