Debian Codegraph @

contrib/ms-sbvar/switch_dw/state_space/sbvar/sbvar_mdd.c

raw
1 /*
2 * Copyright (C) 1996-2011 Daniel Waggoner and Tao Zha
3 *
4 * This free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * It is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * If you did not received a copy of the GNU General Public License
15 * with this software, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include "dw_sbvar_command_line.h"
19 #include "VARio.h"
20 #include "dw_mdd_switch.h"
21 #include "dw_error.h"
22 #include "dw_parse_cmd.h"
23
24 void dw_sbvar_mdd_command_line(int nargs, char **args)
25 {
26 TVARCommandLine *cmd;
27 T_VAR_Parameters *p;
28
29 // Setup model and initial parameters
30 if (!(cmd=CreateTStateModel_VARCommandLine(nargs,args,(TVARCommandLine*)NULL)))
31 dw_Error(MEM_ERR);
32 else
33 if (!cmd->model)
34 dw_UserError("Unable to setup SBVAR from command line parameters");
35 else
36 if (!cmd->parameters_filename_actual)
37 dw_UserError("Unable to initialize parameters from command line parameters");
38 else
39 {
40 // Use WZ normalization
41 p=(T_VAR_Parameters*)(cmd->model->theta);
42 Setup_WZ_Normalization_VAR(p->A0,p);
43
44 /* printf("mdd new\n"); */
45 /* dw_marginal_data_density_command_line(nargs,args,cmd->model,dw_ParseInteger_String(nargs,args,"seed",0)); */
46 /* rename("mdd_t6_ms_bvar_7_chol_sv3.out","mdd_t6_ms_bvar_7_chol_sv3_new.out"); */
47 /* printf("mdd orig\n"); */
48 /* dw_marginal_data_density_command_line_1_1(nargs,args,cmd->model,dw_ParseInteger_String(nargs,args,"seed",0)); */
49 /* rename("mdd_t6_ms_bvar_7_chol_sv3.out","mdd_t6_ms_bvar_7_chol_sv3_orig.out"); */
50
51 dw_marginal_data_density_command_line(nargs,args,cmd->model,dw_ParseInteger_String(nargs,args,"seed",0));
52 }
53
54 Free_VARCommandLine(cmd);
55 }