/*************************************************************************\
* Copyright (c) 2010 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2010 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* This file is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution.
\*************************************************************************/
/* program: sddsduplicate
* purpose: duplicate rows in a file according to a weight column
*
* Michael Borland, 2010
$Log: sddsduplicate.c,v $
Revision 1.2 2010/09/10 01:45:09 borland
Added -seed and -probabilistic options. If number of rows after duplication
is not an integer and -probabilistic is given, the non-integer part is taken
as a probability.
Revision 1.1 2010/09/08 19:40:41 borland
First version.
*
*/
#include "mdb.h"
#include "scan.h"
#include "SDDS.h"
#define SET_WEIGHT 0
#define SET_PIPE 1
#define SET_MAXFACTOR 2
#define SET_MINFACTOR 3
#define SET_FACTOR 4
#define SET_VERBOSITY 5
#define SET_SEED 6
#define SET_PROBABILISTIC 7
#define N_OPTIONS 8
static char *option[N_OPTIONS] = {
"weight", "pipe", "maxfactor", "minfactor", "factor", "verbosity", "seed", "probabilistic",
};
static char *USAGE="sddsduplicate [] [