lionleaf / lionleaf/parallel-c-programs
introduction matrix.c is_sparse() function error
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
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);
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.
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.
Assessment
- Tech stack
- c
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100