ze-filter  (ze-filter-0.8.0-develop-180218)
ze-lr-sim.c File Reference
#include <ze-sys.h>
#include <libze.h>
#include <libml.h>
#include "ze-filter.h"

Go to the source code of this file.

Classes

struct  learn_evt_T
 
struct  pile_T
 
struct  cli_opts_T
 
struct  stcl_T
 

Macros

#define LR_CLASS2LABEL(class)
 
#define LR_LABEL2CLASS(label)
 
#define DHIST   100000
 
#define LR_EVT_FILL(evt, cmd, date, class, fname)
 
#define DPILE   20000
 
#define PILE_INIT(p)
 
#define CLI_NONE   0
 
#define CLI_CLASSIFY   1
 
#define CLI_LEARN   2
 
#define CLI_ONLINE   3
 
#define CLI_DELAY_FN_CTE   0
 
#define CLI_DELAY_FN_EXP   1
 
#define CLI_DELAY_FN_FIX   2
 
#define CLI_OPT_INIT   {FALSE, 7200, CLI_DELAY_FN_CTE, FALSE, -1., FALSE, -1., FALSE, 0, 0}
 
#define ST_DIM   0x10000
 
#define DPILE   20000
 
#define OPTION_BOOL(args, v)
 
#define OPTION_INT(args, v)
 
#define OPTION_DOUBLE(args, v)
 

Functions

void usage (char *)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ CLI_CLASSIFY

#define CLI_CLASSIFY   1

Definition at line 121 of file ze-lr-sim.c.

◆ CLI_DELAY_FN_CTE

#define CLI_DELAY_FN_CTE   0

Definition at line 125 of file ze-lr-sim.c.

◆ CLI_DELAY_FN_EXP

#define CLI_DELAY_FN_EXP   1

Definition at line 126 of file ze-lr-sim.c.

◆ CLI_DELAY_FN_FIX

#define CLI_DELAY_FN_FIX   2

Definition at line 127 of file ze-lr-sim.c.

◆ CLI_LEARN

#define CLI_LEARN   2

Definition at line 122 of file ze-lr-sim.c.

◆ CLI_NONE

#define CLI_NONE   0

Definition at line 120 of file ze-lr-sim.c.

◆ CLI_ONLINE

#define CLI_ONLINE   3

Definition at line 123 of file ze-lr-sim.c.

◆ CLI_OPT_INIT

#define CLI_OPT_INIT   {FALSE, 7200, CLI_DELAY_FN_CTE, FALSE, -1., FALSE, -1., FALSE, 0, 0}

Definition at line 153 of file ze-lr-sim.c.

◆ DHIST

#define DHIST   100000

Definition at line 44 of file ze-lr-sim.c.

◆ DPILE [1/2]

#define DPILE   20000

Definition at line 1154 of file ze-lr-sim.c.

◆ DPILE [2/2]

#define DPILE   20000

Definition at line 1154 of file ze-lr-sim.c.

◆ LR_CLASS2LABEL

#define LR_CLASS2LABEL (   class)
Value:
((class) == LR_CLASS_HAM ? "ham" : \
(class) == LR_CLASS_SPAM ? "spam" : "unknown")
#define LR_CLASS_SPAM
Definition: ze-lr-funcs.h:34
#define LR_CLASS_HAM
Definition: ze-lr-funcs.h:33

Definition at line 35 of file ze-lr-sim.c.

◆ LR_EVT_FILL

#define LR_EVT_FILL (   evt,
  cmd,
  date,
  class,
  fname 
)
Value:
do { \
if ((evt) != NULL) { \
memset((evt), 0, sizeof(*(evt))); \
(evt)->date = (date); \
(evt)->class = (class); \
strlcpy((evt)->fname, (fname), sizeof((evt)->fname)); \
(evt)->ok = TRUE; \
(evt)->cmd = (cmd); \
} \
} while (0)
bool ok
Definition: ze-connopen.c:59
#define TRUE
Definition: macros.h:157

Definition at line 76 of file ze-lr-sim.c.

◆ LR_LABEL2CLASS

#define LR_LABEL2CLASS (   label)
Value:
(STRCASEEQUAL((label), "spam") ? LR_CLASS_SPAM : \
STRCASEEQUAL((label), "ham") ? LR_CLASS_HAM : \
LR_CLASS_UNKNOWN)
#define LR_CLASS_SPAM
Definition: ze-lr-funcs.h:34
#define LR_CLASS_HAM
Definition: ze-lr-funcs.h:33
#define STRCASEEQUAL(a, b)
Definition: macros.h:72

Definition at line 39 of file ze-lr-sim.c.

◆ OPTION_BOOL

#define OPTION_BOOL (   args,
 
)
Value:
{ \
if (zeStrRegex((args), "^yes|true|ok$", NULL, NULL, TRUE)) \
(v) = TRUE; \
if (zeStrRegex((args), "^no|false|ko$", NULL, NULL, TRUE)) \
(v) = FALSE; \
}
#define FALSE
Definition: macros.h:160
bool zeStrRegex(char *, char *, long *, long *, bool)
Definition: zeStrings.c:544
#define TRUE
Definition: macros.h:157

Definition at line 1279 of file ze-lr-sim.c.

◆ OPTION_DOUBLE

#define OPTION_DOUBLE (   args,
 
)
Value:
{ \
(v) = zeStr2double(args, NULL, (v)); \
}
double zeStr2double(char *s, int *error, double dval)
Definition: zeStrConvert.c:202

Definition at line 1292 of file ze-lr-sim.c.

◆ OPTION_INT

#define OPTION_INT (   args,
 
)
Value:
{ \
(v) = zeStr2long(args, NULL, (v)); \
}
long zeStr2long(char *s, int *error, long dval)
Definition: zeStrConvert.c:35

Definition at line 1287 of file ze-lr-sim.c.

◆ PILE_INIT

#define PILE_INIT (   p)
Value:
do { \
if (p != NULL) \
memset(p, 0, sizeof(p)); \
} while(0)

Definition at line 98 of file ze-lr-sim.c.

◆ ST_DIM

#define ST_DIM   0x10000

Definition at line 701 of file ze-lr-sim.c.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 175 of file ze-lr-sim.c.

◆ usage()

void usage ( char *  arg)

Definition at line 1453 of file ze-lr-sim.c.