Problem 955. ismember: Enhanced Time Performance for 'rows' - Speed Scoring (90% savings)
Solution Stats
Problem Comments
-
6 Comments
I try but I don't understand the merge function (Alfonso and Richard solutions). Can you explain ?
since numbers only range from 0 to 3 you may consider each row of A or B as a 16-digit base-4 number and just convert it to a 32-bit integer...
Ok. Thanks.
But if we have less restrictions on the input range (for example values between 0 and 255) ?
Jean-Marie, the methodology of converting multiple column value words into a single value has limited but specific applications where value ranges are limited. In the case of DNA sequencing the values can be made numeric 0:3. For ranges up to 255 the width gets limited to stay under the 2^64, or 2^53 limit for double. This challenge was a demonstration of a method to improve performance for functions like ismember.
Thank you.
Problem Recent Solvers14
Suggested Problems
-
Remove the polynomials that have positive real elements of their roots.
1044 Solvers
-
838 Solvers
-
Cody Computer Part 4 : Are you a morning Cody player Addicted ?
77 Solvers
-
Combinations without using nchoosek
83 Solvers
-
Create matrix of replicated elements
337 Solvers
More from this Author255
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!