1#d note1 A set may either be an Array_Type or a List_Type object.\__newline__\ 2 For a homogeneous collection of objects, it is better to\__newline__\ 3 use an Array_Type. i.e., \exmp{[1,2,3]} instead of \exmp{\{1,2,3\}}. 4 5 6\function{complement} 7\synopsis{Extract the elements of a set that are not contained in other sets.} 8\usage{indices = complement (a, b, ..., c)} 9\description 10 This function computes the elements of the first argument (\exmp{a}) 11 that are not contained in the sets given by the other arguments 12 (\exmp{b,...,c}) and returns them in the form of indices into the 13 first argument. 14\example 15#v+ 16 a = {"foo", PI, 7}; 17 b = [1,2,3,PI]; 18 indices = complement (a, b); 19#v- 20 Upon return, \exmp{indices} will have the value \exmp{[0, 2]} since 21 \exmp{a[0]} and \exmp{a[2]} are not contained in \exmp{b}. 22\notes 23 \note1 24\seealso{intersection, ismember, union, unique} 25\done 26 27\function{intersection} 28\synopsis{Extract the common elements of two or more sets} 29\usage{indices = complement (a, b, ..., c)} 30\description 31 This function computes the common elements of two or more sets and 32 returns them in the form of indices into the first argument. 33\example 34#v+ 35 a = {"foo", 7, PI}; 36 b = {PI, "bar", "foo"}; 37 indices = intersection (a, b); 38#v- 39 Upon return, \exmp{indices} will have the value \exmp{[0, 2]} since 40 \exmp{a[0]} and \exmp{a[2]} are the common elements of the sets. 41\notes 42 \note1 43\seealso{complement, ismember, union, unique} 44\done 45 46\function{ismember} 47\synopsis{test to see if the elements of one set are members of another} 48\usage{val = ismember (a, b)} 49\description 50 This function may be used to see which of the elements of the set 51 \exmp{a} are members of the set \exmp{b}. It returns a boolean 52 array indicating whether or not the corresponding element of 53 \exmp{a} is a member of \exmp{b}. 54\notes 55 \note1 56\seealso{complement, intersection, union, unique} 57\done 58 59\function{union} 60\synopsis{Form a set of the unique elements of one ore more subsets} 61\usage{abc = union (a, b,..., c)} 62\description 63 This function interprets each of its arguments as a set, then merges 64 them together and returns only the unique elements. The returned 65 value may either be an \dtype{Array_Type} or a \dtype{List_Type} 66 object. 67\notes 68 \note1 69\seealso{complement, intersection, ismember, unique} 70\done 71 72\function{unique} 73\synopsis{Get the indices of the unique elements of a set} 74\usage{indices = unique (A)} 75\description 76 This function returns an array of the indices of the unique elements 77 of a set. 78\notes 79 \note1 80\seealso{complement, intersection, ismember, union} 81\done 82