Problem 691. Number of bytes required to store a sparse matrix
Solution Stats
Problem Comments
-
5 Comments
Aurelien,
Test Suite case 4 is a Diagonal Sparse matrix which is not a problem defined Sparse matrix and should be replaced by x = sparse(1000,100,0.01);
y_correct = 4016;.
Also, your inventive cheat detect needs to add assert(isempty(strfind(filetext, 'who'))). A re-scoring will see a new leader.
Currently Tests 4 and 5 are always pass as they lack asserts.
Enjoying the challenge.
yup, definitely need some asserts
@Richard, Thanks for your comments. I have added the assert with who and rescored all solutions.
All values at the test suite are currently wrong. Using whos in the first case, for instance, we obtain 8024 bytes and not 4016.
The values in the test suites have been corrected.
Solution Comments
-
1 Comment
This problem here only focused on real sparse matrix in a 32-bit system. For real sparse matrix in a 64-bit system, we should replace 4 by 8 and 12 by 16 in the calculation. For complex sparse matrix in a 64-bit system, we should replace 4 by 8 and 12 by 24.
-
1 Comment
Wrong solution(passed due to lack of asserts in tests)
-
2 Comments
yay research! i found a paper!
whoops, this solution is a fluke. lol, guess i should have trusted the paper more.
Problem Recent Solvers3
Suggested Problems
-
1528 Solvers
-
71 Solvers
-
Arrange Vector in descending order
8507 Solvers
-
Back to basics 4 - Search Path
356 Solvers
-
Sum of first n terms of a harmonic progression
365 Solvers
More from this Author30
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!