Problem 955. ismember: Enhanced Time Performance for 'rows' - Speed Scoring (90% savings)
The Challenge is to perform very fast the 'ismember' function for a long and wide array.
The data is small integer representing data permutations of items like DNA and Rubik's cube faces and orientations.
Input: Array of uint8 of dimensions (m, 16) with values 0:3
Output: Array Equivalent to ismember(A,B,'rows')
Hints:
1) Columns can be merged to form a reduced number of columns 2) Unique has the option to provide an Array and a sorting Index
Solution Stats
Problem Comments
-
6 Comments
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.
Solution Comments
Show commentsProblem Recent Solvers17
Suggested Problems
-
7725 Solvers
-
Extract leading non-zero digit
2175 Solvers
-
Create a matrix X, where each column is a shifted copy of the vector v
205 Solvers
-
305 Solvers
-
Two-output anonymous function?
79 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!