performance/
mg_where_vs_histogram.pro
includes main-level program This 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: | Mon Nov 29 18:34:50 2010 |
Lines: | 49 |
Docformat: | rst rst |