introduction matrix.c is_sparse() function error
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- c
- Domain
- distributed-systems
Research direction
Read matrix.c around lines 54-55 and 186-189. Verify the sparse calculation against sparse_threshold and the pointer format specifiers, then compile the relevant program to confirm the warning is gone and the reported behavior is corrected.
Written by the indexing model from the issue text.
Description
Probably nobody is paying attention to this repo..i was going to try a pull request but its very old.
anyways... is_sparse does not work correctly because the formula is inverted, see here to fix it:
54 //if((matrix.cols * matrix.rows)/zero_elements >= sparse_threshold){ <-- BAD
55 if((zero_elements/(matrix.cols * matrix.rows)) >= sparse_threshold){
return 1;
}else{
return 0;
}
also to get rid of warnings about printf''ing pointers change the %d to %p here:
186 // Attempting to multiply m and n, should work
187 error = matrix_multiply(m,n,&p);
188 printf("&p: %p\n",&p);
189 printf("p: %p\n",p);
- Dominant language
- C
- Stars
- 14
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
task
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vsanthanam/JBird#429 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
es-ude/OnDeviceTraining#459 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
bilelmoussaoui/gobject-linter#199 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
bradcypert/plum#53 ·