33 #define CMD_CLABELFILE 6 57 "Usage: fis [options] <mat-file>",
59 " Required parameters",
61 " The name of the file storing the transactions. The file is in ",
62 " Cluto's .mat format.",
64 " Optional parameters",
66 " Specifies the minimum length of the patterns. [default: 1]",
69 " Specifies the maximum length of the patterns. [default: none]",
72 " Specifies the minimum frequency of the patterns. [default: 10]",
75 " Specifies the maximum frequency of the patterns. [default: none]",
78 " Does not print the discovered itemsets.",
81 " Specifies the name of the file that stores the column labels.",
84 " Prints this message.",
90 " Usage: fis [options] <mat-file>",
91 " use 'fis -help' for a summary of the options.",
104 int ntrans,
int *tranind);
110 int main(
int argc,
char *argv[])
128 for (i=0; i<mat->
ncols; i++) {
129 sprintf(line,
"%zd", i);
135 for (i=0; i<mat->
ncols; i++) {
136 if (fgets(line, 8192, fpin) ==
NULL)
150 printf(
"Total itemsets found: %zd\n", params->nitemsets);
162 printf(
"*******************************************************************************\n");
164 printf(
"Matrix Information ---------------------------------------------------------\n");
165 printf(
" input file=%s, [%d, %d, %zd]\n",
169 printf(
"Options --------------------------------------------------------------------\n");
170 printf(
" minlen=%zd, maxlen=%zd, minfeq=%zd, maxfreq=%zd\n",
174 printf(
"Finding patterns... -----------------------------------------------------\n");
184 printf(
"Memory Usage Information -----------------------------------------------------\n");
187 printf(
"********************************************************************************\n");
237 for (i=0; strlen(
helpstr[i]) > 0; i++)
243 printf(
"Illegal command-line option(s)\nUse %s -help for a summary of the options.\n", argv[0]);
249 printf(
"Unrecognized parameters.");
278 printf(
"%4zd %4d %4d => ", params->
nitemsets, nitems, ntrans);
279 for (i=0; i<nitems; i++)
280 printf(
" %s", params->
clabels[itemids[i]]);
282 for (i=0; i<ntrans; i++)
283 printf(
" %d\n", transids[i]);
The structure that stores the information about the command-line options.
FILE * gk_fopen(char *, char *, const char *)
void errexit(char *f_str,...)
char * gk_strtprune(char *, char *)
Prunes characters from the end of the string.
int gk_optind
Index in ARGV of the next element to be scanned.
void print_final_info(params_t *params)
size_t gk_GetMaxMemoryUsed()
static struct gk_option long_options[]
int gk_fexists(char *fname)
static const SmartProjectionParams params
params_t * parse_cmdline(int argc, char *argv[])
size_t gk_GetCurMemoryUsed()
void gk_csr_CreateIndex(gk_csr_t *mat, int what)
void print_an_itemset(void *stateptr, int nitems, int *itemind, int ntrans, int *tranind)
static char shorthelpstr[][100]
char * gk_strdup(char *orgstr)
Duplicates a string.
char * gk_optarg
For communication arguments to the caller.
int main(int argc, char *argv[])
void * gk_malloc(size_t nbytes, char *msg)
void print_init_info(params_t *params, gk_csr_t *mat)
static char helpstr[][100]
int gk_getopt_long_only(int argc, char **argv, char *options, struct gk_option *long_options, int *opt_index)
Parse command-line arguments with only long options.
gk_csr_t * gk_csr_Read(char *filename, int format, int readvals, int numbering)
void gk_find_frequent_itemsets(int ntrans, ssize_t *tranptr, int *tranind, int minfreq, int maxfreq, int minlen, int maxlen, void(*process_itemset)(void *stateptr, int nitems, int *itemind, int ntrans, int *tranind), void *stateptr)