; docformat = 'rst' ;+ ; Find the union of two sets of indices. A set of indices is represented by an ; array of non-negative integers where a scalar -1L indicates the empty set. ; ; :Returns: ; lonarr or -1L ; ; :Params: ; ind1 : in, required, type=lonarr or -1L ; array of indices where -1L indicates an empty set of indices ; ind2 : in, required, type=lonarr or -1L ; array of indices where -1L indicates an empty set of indices ;- function mg_setunion, ind1, ind2 compile_opt strictarr if (ind1[0] lt 0L) then return, ind2 if (ind2[0] lt 0L) then return, ind1 return, where(histogram([ind1, ind2], omin=omin)) + omin end