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//#define INGOR_DEFAULT_ALGO_NAME "hc"
20#ifdef INGOR_OSS
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
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
68 ytStrArray * constrainFiles;
69 ytStrArray * constrainTypes;
70 ytArray * constrainArgs;
71 char * constrainWrite;
72 char * constrainWriteType;
73 ytKeyValues * constrainWriteArgs;
74
77 char * fixedFile;
78 char * fixedType;
79 ytKeyValues * fixedArgs;
80
83 char * bootstrapMode;
84 int blocks;
85 char * bootstrapFile;
90 int offset;
91
92 int dynamic;
93
96
97 int dbn; /* 1 for time expanded (multi-time steps) DBN */
98 int sdh; /* 1 for time expanded dynamic-static hybrid BN */
99
102
105
108
109 FilterArgs * filters;
110
112 double score;
113
116
117 int seed;
118
121 int logMode; /* 0: automatic */
122 char * logFile;
123
124 size_t totalMemory;
125 double cacheRatio;
126
127 int threads;
128
129 int fixRange; /* 1 if value range is fixed for bootstrapping. */
130 char * readRange; /* non NUll if value range is given by a file. */
131
132 char * outputData; /* If non NULL, output data used for modeling into *.X, *.Y, and *.PR.Y. */
133
134 int prompt; /* 1 if prompt mode specified. */
135
136 int showDataStat;
137
138 int mpi; /* true if USE_MPI is set. */
139
140 int MPI_rank; /* 0 if USE_MPI is disabled */
141 int MPI_size; /* 1 if USE_MPI is disabled */
142#ifdef USE_MPI
143 MPI_Comm MPI_comm; /* MPI communicator for grouping procs with simul mode. */
144#endif
145
146 char * saveData; /* non-NULL for saving preprocessed data. */
147 ytKeyValues * saveDataArgs;
148
149} Args;
150
151Args * Args_parse(int argc, char * argv[]);
152
153#endif /* __INGOR_ARGS_H */
154
155
Expandable array.
Interface class for handling graph structure.
key-value pairs.
Expandable array.
Definition Args.h:36
ytGraph * fixed
Fixed edges.
Definition Args.h:76
int singleFile
1 if multiple networks are output in a single file.
Definition Args.h:104
ytGraph * constrain
Constrain graph.
Definition Args.h:67
int bootstrap
not 0 if bootstrap enabled. The values are used as the ID of the execution.
Definition Args.h:82
int iteration
the number of iterations of performing network estimation.
Definition Args.h:101
double score
best score set by the algorithm.
Definition Args.h:112
int selfLoop
Definition Args.h:95
ytKeyValues * algoArgs
Definition Args.h:107
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:120
ytRNG * rng
Random number generator.
Definition Args.h:115
ytData * bootstrapData
This is used for saving the ytData instance used in bootstrap resampling so that the generated instan...
Definition Args.h:86
Definition Score.h:17
General data container.
Definition ytData.h:46
Structure for encapsulating the random number generator.
Definition ytRNG.h:33