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 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9
10 * Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12
13 * Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in
15 the documentation and/or other materials provided with the
16 distribution.
17
18 * Neither the name of Hirosaki University, Kyoto University, The
19 University of Tokyo, nor the names of its contributors may be
20 used to endorse or promote products derived from this software
21 without specific prior written permission.
22
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35*/
36#ifndef __INGOR_ARGS_H
37#define __INGOR_ARGS_H
38
39#include "filter/Filter.h"
40#include "score/Score.h"
41
42#include "math/ytGraph.h"
43#include "math/ytRNG.h"
44
45#define INGOR_DEFAULT_INFILE_TYPE "gdf"
46#define INGOR_DEFAULT_OUTPUT_TYPE "nodelist"
47#ifdef INGOR_OSS
48#define INGOR_DEFAULT_SCORE_NAME "bnrc"
49#define INGOR_DEFAULT_ALGO_NAME "hc"
50#else
51#define INGOR_DEFAULT_SCORE_NAME "bndc"
52#define INGOR_DEFAULT_ALGO_NAME "cghc"
53#endif
54#define INGOR_DEFAULT_CANDIDATES 10
55#define INGOR_DEFAULT_CANDIDATES_CONT 0
56#define INGOR_DEFAULT_CANDIDATES_DISC 0
57#define INGOR_DEFAULT_MAX_PARENTS 10
58#define INGOR_DEFAULT_MAX_PARENTS_CONT 10
59#define INGOR_DEFAULT_MAX_PARENTS_DISC 10
60#define INGOR_DEFAULT_TOTAL_MEMORY (1000) /* in mega byte */
61#define INGOR_DEFAULT_CACHE_RATIO (0.3)
62
63typedef struct {
64 ytStrArray * infiles; /* Input file names */
65 ytStrArray * infileTypes; /* Input file types */
66 ytKeyValues * infileArgs; /* Input file args */
67
68 int output; /* if 0, do not output in the main program */
69 char * outfile; /* Output file name */
70 char * outfileType; /* Output file type */
71 ytKeyValues * outfileArgs; /* Output file args */
72
73 ytData * data; /* original data */
74
77 int candidatesCont;
78 int candidatesDisc;
79
80 int maxParents;
81 int maxParentsCont;
82 int maxParentsDisc;
83
84 char * scoreName;
85 ytKeyValues * scoreArgs;
86 Score * sc;
87
88 char * algoName;
89
92
95 ytStrArray * constrainFiles;
96 ytStrArray * constrainTypes;
97 ytArray * constrainArgs;
98 char * constrainWrite;
99 char * constrainWriteType;
100 ytKeyValues * constrainWriteArgs;
101
104 char * fixedFile;
105 char * fixedType;
106 ytKeyValues * fixedArgs;
107
110 char * bootstrapMode;
111 int blocks;
112 char * bootstrapFile;
117 int offset;
118
119 int dynamic;
120
123
124 int dbn; /* 1 for time expanded (multi-time steps) DBN */
125 int sdh; /* 1 for time expanded dynamic-static hybrid BN */
126
129
132
135
136 FilterArgs * filters;
137
139 double score;
140
143
144 int seed;
145
148 int logMode; /* 0: automatic */
149 char * logFile;
150
151 size_t totalMemory;
152 double cacheRatio;
153
154 int threads;
155
156 int fixRange; /* 1 if value range is fixed for bootstrapping. */
157 char * readRange; /* non NUll if value range is given by a file. */
158
159 char * outputData; /* If non NULL, output data used for modeling into *.X, *.Y, and *.PR.Y. */
160
161 int prompt; /* 1 if prompt mode specified. */
162
163 int showDataStat;
164
165 int mpi; /* true if USE_MPI is set. */
166
167 int MPI_rank; /* 0 if USE_MPI is disabled */
168 int MPI_size; /* 1 if USE_MPI is disabled */
169#ifdef USE_MPI
170 MPI_Comm MPI_comm; /* MPI communicator for grouping procs with simul mode. */
171#endif
172
173 char * saveData; /* non-NULL for saving preprocessed data. */
174 ytKeyValues * saveDataArgs;
175
176} Args;
177
178Args * Args_parse(int argc, char * argv[]);
179
180#endif /* __INGOR_ARGS_H */
181
182
Expandable array.
Interface class for handling graph structure.
key-value pairs.
Expandable array.
Definition Args.h:63
ytGraph * fixed
Fixed edges.
Definition Args.h:103
int singleFile
1 if multiple networks are output in a single file.
Definition Args.h:131
ytGraph * constrain
Constrain graph.
Definition Args.h:94
int bootstrap
not 0 if bootstrap enabled. The values are used as the ID of the execution.
Definition Args.h:109
int iteration
the number of iterations of performing network estimation.
Definition Args.h:128
double score
best score set by the algorithm.
Definition Args.h:139
int selfLoop
Definition Args.h:122
ytKeyValues * algoArgs
Definition Args.h:134
int candidates
The number of parent candidates.
Definition Args.h:76
ytGraph * init
Initial graph.
Definition Args.h:91
int verbose
verbose level.
Definition Args.h:147
ytRNG * rng
Random number generator.
Definition Args.h:142
ytData * bootstrapData
This is used for saving the ytData instance used in bootstrap resampling so that the generated instan...
Definition Args.h:113
Definition Score.h:45
General data container.
Definition ytData.h:73
Structure for encapsulating the random number generator.
Definition ytRNG.h:60