Index: trunk/SRC/Matrix/cmset_op.pro
===================================================================
--- trunk/SRC/ToBeReviewed/MATRICE/cmset_op.pro	(revision 114)
+++ trunk/SRC/Matrix/cmset_op.pro	(revision 133)
@@ -1,19 +1,29 @@
 ;+
-; NAME:
-;   CMSET_OP
-;
-; AUTHOR:
-;   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
-;   craigm@lheamail.gsfc.nasa.gov
-;
-; PURPOSE:
-;   Performs an AND, OR, or XOR operation between two sets
-;
-; CALLING SEQUENCE:
-;   SET      = CMSET_OP(A, OP, B)
-;
-; DESCRIPTION: 
-;
-;   SET_OP performs three common operations between two sets.  The
+; @hidden
+;
+; @todo seb
+;-
+;
+;; Simplified version of CMSET_OP_UNIQ which sorts, and takes the
+;; "first" value, whatever that may mean.
+function cmset_op_uniq, a
+;
+  compile_opt idl2, strictarrsubs
+;
+  if n_elements(a) LE 1 then return, 0L
+
+  ii = sort(a) & b = a[ii]
+  wh = where(b NE shift(b, +1L), ct)
+  if ct GT 0 then return, ii[wh]
+
+  return, 0L
+;
+end
+;+
+;
+; @file_comments 
+; Performs an AND, OR, or XOR operation between two sets
+;
+;   Description: SET_OP performs three common operations between two sets.  The
 ;   three supported functions of OP are:
 ;
@@ -55,26 +65,30 @@
 ;   benefit.
 ;
-; INPUTS:
-;
-;   A, B - the two sets to be operated on.  A one dimensional array of
+; @categories array
+;
+; @param A {in}{required} The two sets to be operated on.  A one dimensional array of
 ;          either numeric or string type.  A and B must be of the same
 ;          type.  Empty sets are permitted, and are either represented
 ;          as an undefined variable, or by setting EMPTY1 or EMPTY2.
 ;
-;   OP - a string, the operation to be performed.  Must be one of
+; @param B {in}{required} See A
+;
+; @param OP {in}{required} a string, the operation to be performed.  Must be one of
 ;        'AND', 'OR' or 'XOR' (lower or mixed case is permitted).
 ;        Other operations will cause an error message to be produced.
 ;
-; KEYWORDS:
-;
-;   NOT1, NOT2 - if set and OP is 'AND', then the complement of A (for
+; @keyword NOT1 If set and OP is 'AND', then the complement of A (for
 ;                NOT1) or B (for NOT2) will be used in the operation.
 ;                NOT1 and NOT2 cannot be set simultaneously.
 ;
-;   EMPTY1, EMPTY2 - if set, then A (for EMPTY1) or B (for EMPTY2) are
-;                    assumed to be the empty set.  The actual values
-;                    passed as A or B are then ignored.
-;
-;   INDEX - if set, then return a list of indices instead of the array
+; @keyword NOT2 See NOT1
+;
+; @keyword EMPTY1 If set, then A (for EMPTY1) or B (for EMPTY2) are
+;                 assumed to be the empty set.  The actual values
+;                 passed as A or B are then ignored.
+;
+; @keyword EMPTY2 See EMPTY1
+;
+; @keyword INDEX if set, then return a list of indices instead of the array
 ;           values themselves.  The "slower" set operations are always
 ;           performed in this case.
@@ -85,11 +99,9 @@
 ;           from NA to NA+NB-1 refer to B[I-NA].
 ;
-;   COUNT - upon return, the number of elements in the result set.
+; @keyword COUNT upon return, the number of elements in the result set.
 ;           This is only important when the result set is the empty
 ;           set, in which case COUNT is set to zero.
 ;
-; RETURNS:
-;
-;   The resulting set as a one-dimensional array.  The set may be
+; @returns The resulting set as a one-dimensional array.  The set may be
 ;   represented by either an array of data values (default), or an
 ;   array of indices (if INDEX is set).  Duplicate elements, if any,
@@ -104,6 +116,5 @@
 ;   SET_UTILS.PRO by RSI
 ;
-; MODIFICATION HISTORY:
-;   Written, CM, 23 Feb 2000
+; @history Written, CM, 23 Feb 2000
 ;   Added empty set capability, CM, 25 Feb 2000
 ;   Documentation clarification, CM 02 Mar 2000
@@ -133,19 +144,14 @@
 ;      range of the input variable (thanks to Will Maddox), CM, 16 Jan 2006
 ;
-;  $Id: cmset_op.pro,v 1.6 2006/01/16 19:45:22 craigm Exp $
-;
-;-
-; Copyright (C) 2000, 2004, 2005, 2006, Craig Markwardt
-; This software is provided as is without any warranty whatsoever.
-; Permission to use, copy, modify, and distribute modified or
-; unmodified copies is granted, provided this copyright and disclaimer
-; are included unchanged.
-;-
-
-;; Utility function, similar to UNIQ, but allowing choice of taking
-;; first or last unique element, or non-unique elements.
-;; Unfortunately this doesn't work because of implementation dependent
-;; versions of the SORT() function.
-
+;   Author: Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
+;   craigm@lheamail.gsfc.nasa.gov
+;
+; @version $Id: cmset_op.pro,v 1.6 2006/01/16 19:45:22 craigm Exp $
+;
+; @examples Utility function, similar to UNIQ, but allowing choice of taking
+; first or last unique element, or non-unique elements.
+; Unfortunately this doesn't work because of implementation dependent
+; versions of the SORT() function.
+;
 ; function cmset_op_uniq, a, first=first, non=non, count=ct, sort=sortit
 ;   if n_elements(a) LE 1 then return, 0L
@@ -168,18 +174,9 @@
 ; end
 
-;; Simplified version of CMSET_OP_UNIQ which sorts, and takes the
-;; "first" value, whatever that may mean.
-function cmset_op_uniq, a
-;
-  compile_opt idl2, strictarrsubs
-;
-  if n_elements(a) LE 1 then return, 0L
-
-  ii = sort(a) & b = a[ii]
-  wh = where(b NE shift(b, +1L), ct)
-  if ct GT 0 then return, ii[wh]
-
-  return, 0L
-end
+; Simplified version of CMSET_OP_UNIQ which sorts, and takes the
+; "first" value, whatever that may mean.
+;
+;-
+
 
 function cmset_op, a, op0, b, not1=not1, not2=not2, count=count, $
