performance/
mg_where_vs_histogram.pro
batch fileThis shows the IDL help is wrong when it says:
For example, make the histogram of array A:
H = HISTOGRAM(A, REVERSE_INDICES = R)
;Set all elements of A that are in the ith bin of H to 0.
IF R[i] NE R[i+1] THEN A[R[R[I] : R[i+1]-1]] = 0
The above is usually more efficient than the following:
bini = WHERE(A EQ i, count)
IF count NE 0 THEN A[bini] = 0
File attributes
Modification date: | Sat Jan 31 21:16:36 2015 |
Lines: | 23 |
Docformat: | rst rst |