INGOR
Loading...
Searching...
No Matches
Args.h
1/*
2 Args.{h,c} : INGOR global arguments
3 Copyright (C) 2018-2021, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 See LICENSE.txt for details of the licensing agreement.
7*/
8#ifndef __INGOR_ARGS_H
9#define __INGOR_ARGS_H
10
11#include "filter/Filter.h"
12#include "score/Score.h"
13
14#include "math/ytGraph.h"
15#include "math/ytRNG.h"
16
17#define INGOR_DEFAULT_INFILE_TYPE "gdf"
18#define INGOR_DEFAULT_OUTPUT_TYPE "nodelist"
19
20#ifdef INGOR_PUB
21#define INGOR_DEFAULT_SCORE_NAME "bnrc"
22#define INGOR_DEFAULT_ALGO_NAME "hc"
23#else
24#define INGOR_DEFAULT_SCORE_NAME "bndc"
25#define INGOR_DEFAULT_ALGO_NAME "cghc"
26#endif /* INGOR_PUB */
27#define INGOR_DEFAULT_CANDIDATES 10
28#define INGOR_DEFAULT_CANDIDATES_CONT 0
29#define INGOR_DEFAULT_CANDIDATES_DISC 0
30#define INGOR_DEFAULT_MAX_PARENTS 10
31#define INGOR_DEFAULT_MAX_PARENTS_CONT 10
32#define INGOR_DEFAULT_MAX_PARENTS_DISC 10
33#define INGOR_DEFAULT_TOTAL_MEMORY (1000) /* in mega byte */
34#define INGOR_DEFAULT_CACHE_RATIO (0.3)
35
36typedef struct {
37 ytStrArray * infiles; /* Input file names */
38 ytStrArray * infileTypes; /* Input file types */
39 ytKeyValues * infileArgs; /* Input file args */
40
41 int output; /* if 0, do not output in the main program */
42 char * outfile; /* Output file name */
43 char * outfileType; /* Output file type */
44 ytKeyValues * outfileArgs; /* Output file args */
45
46 ytData * data; /* original data */
47
50 int candidatesCont;
51 int candidatesDisc;
52
53 int maxParents;
54 int maxParentsCont;
55 int maxParentsDisc;
56
57 char * scoreName;
58 ytKeyValues * scoreArgs;
59 Score * sc;
60
61 char * algoName;
62
65 char * initFile;
66 char * initType;
67 ytKeyValues * initArgs;
68
71 ytStrArray * constrainFiles;
72 ytStrArray * constrainTypes;
73 ytArray * constrainArgs;
74 char * constrainWrite;
75 char * constrainWriteType;
76 ytKeyValues * constrainWriteArgs;
77
80 char * fixedFile;
81 char * fixedType;
82 ytKeyValues * fixedArgs;
83
86 char * bootstrapMode;
87 int blocks;
88 char * bootstrapFile;
93 int offset;
94
95 int dynamic;
96
99
100 int dbn; /* 1 for time expanded (multi-time steps) DBN */
101 int sdh; /* 1 for time expanded dynamic-static hybrid BN */
102
105
108
111
112 FilterArgs * filters;
113
115 double score;
116
119
120 int seed;
121
124 int logMode; /* 0: automatic */
125 char * logFile;
126
127 size_t totalMemory;
128 double cacheRatio;
129
130 int threads;
131
132 int fixRange; /* 1 if value range is fixed for bootstrapping. */
133 char * readRange; /* non NUll if value range is given by a file. */
134
135 char * outputData; /* If non NULL, output data used for modeling into *.X, *.Y, and *.PR.Y. */
136
137 int prompt; /* 1 if prompt mode specified. */
138
139 int showDataStat;
140
141 int mpi; /* true if USE_MPI is set. */
142
143 int MPI_rank; /* 0 if USE_MPI is disabled */
144 int MPI_size; /* 1 if USE_MPI is disabled */
145#ifdef USE_MPI
146 MPI_Comm MPI_comm; /* MPI communicator for grouping procs with simul mode. */
147#endif
148
149 char * saveData; /* non-NULL for saving preprocessed data. */
150 ytKeyValues * saveDataArgs;
151
152} Args;
153
154Args * Args_parse(int argc, char * argv[]);
155
156#endif /* __INGOR_ARGS_H */
157
158
Expandable array.
Interface class for handling graph structure.
key-value pairs.
Expandable array.
Definition Args.h:36
ytGraph * fixed
Fixed edges.
Definition Args.h:79
int singleFile
1 if multiple networks are output in a single file.
Definition Args.h:107
ytGraph * constrain
Constrain graph.
Definition Args.h:70
int bootstrap
not 0 if bootstrap enabled. The values are used as the ID of the execution.
Definition Args.h:85
int iteration
the number of iterations of performing network estimation.
Definition Args.h:104
double score
best score set by the algorithm.
Definition Args.h:115
int selfLoop
Definition Args.h:98
ytKeyValues * algoArgs
Definition Args.h:110
int candidates
The number of parent candidates.
Definition Args.h:49
ytGraph * init
Initial graph.
Definition Args.h:64
int verbose
verbose level.
Definition Args.h:123
ytRNG * rng
Random number generator.
Definition Args.h:118
ytData * bootstrapData
This is used for saving the ytData instance used in bootstrap resampling so that the generated instan...
Definition Args.h:89
Definition Score.h:17
General data container.
Definition ytData.h:46
Structure for encapsulating the random number generator.
Definition ytRNG.h:33