Debian Codegraph @

tests/block_bytecode/run_ls2003.m

raw
1 function run_ls2003(block, storage, solve_algo, stack_solve_algo, preconditioner)
2
3 % Copyright © 2010-2025 Dynare Team
4 %
5 % This file is part of Dynare.
6 %
7 % Dynare is free software: you can redistribute it and/or modify
8 % it under the terms of the GNU General Public License as published by
9 % the Free Software Foundation, either version 3 of the License, or
10 % (at your option) any later version.
11 %
12 % Dynare is distributed in the hope that it will be useful,
13 % but WITHOUT ANY WARRANTY; without even the implied warranty of
14 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 % GNU General Public License for more details.
16 %
17 % You should have received a copy of the GNU General Public License
18 % along with Dynare. If not, see <https://www.gnu.org/licenses/>.
19
20 if nargin < 5
21 preconditioner = '';
22 end
23
24 fprintf('TEST: ls2003 (block=%d, bytecode=%d, use_dll=%d, solve_algo=%d, stack_solve_algo=%d', block, storage==2, storage==1, solve_algo, stack_solve_algo)
25 if ~isempty(preconditioner)
26 fprintf(', preconditioner=%s', preconditioner)
27 end
28 fprintf(')...\n')
29 fid = fopen('ls2003_tmp.mod', 'w');
30 assert(fid > 0);
31 fprintf(fid, ['@#define block = %d\n@#define bytecode = %d\n' ...
32 '@#define use_dll = %d\n' ...
33 '@#define solve_algo = %d\n@#define stack_solve_algo = %d\n' ...
34 '@#define preconditioner = "%s"\n' ...
35 '@#include \"ls2003.mod\"\n'], block, storage==2, storage==1, ...
36 solve_algo, stack_solve_algo, preconditioner);
37 fclose(fid);
38 dynare('ls2003_tmp.mod','console')
39 end