Debian Codegraph @

tests/partitioning/partitions.mod

raw
1 var y (country='US', long_name='United States') z (country='EA', long_name='Euro Area') x (long_name='March');
2
3 varexo e (country='US', kind='toto')
4 f (country='US', kind='titi')
5 g (country='EA', kind='toto')
6 h (country='EA', kind='titi') ;
7
8 parameters aUS (country='US', colour='red')
9 aEA (country='EA', colour='red')
10 bUS (country='US', colour='blue')
11 bEA (country='EA', colour='blue')
12 cUS (country='US', colour='yellow')
13 cEA (country='EA', colour='yellow') ;
14
15 model;
16 y = .5*y(-1) + e-f^2 ;
17 z = .5*z(-1) + g-h^2 ;
18 x = e-g;
19 end;
20
21 if ~(isfield(M_.exo_partitions, 'country') && isequal(M_.exo_partitions.country, {'US' 'US' 'EA' 'EA'}))
22 error('First partition on exogenous variables is wrong!')
23 end
24
25 if ~(isfield(M_.exo_partitions, 'kind') && isequal(M_.exo_partitions.kind, {'toto' 'titi' 'toto' 'titi'}))
26 error('Second partition on exogenous variables is wrong!')
27 end
28
29 if ~(isfield(M_.endo_partitions, 'country') && isequal(M_.endo_partitions.country, {'US' 'EA' ''}))
30 error('Partition on endogenous variables is wrong!')
31 end
32
33 if ~(isfield(M_.param_partitions, 'colour') && isequal(M_.param_partitions.colour, {'red' 'red' 'blue' 'blue' 'yellow' 'yellow'}))
34 error('First partition on parameters is wrong!')
35 end
36
37 if ~(isfield(M_.param_partitions, 'country') && isequal(M_.param_partitions.country, {'US' 'EA' 'US' 'EA' 'US' 'EA'}))
38 error('Second partition on parameters is wrong!')
39 end
40
41 if isfield(M_.endo_partitions, 'long_name')
42 error('long_name should not be a member of endo_partitions!')
43 end
44
45 tmp = {'United States'; 'Euro Area'; 'March'};
46
47 if ~isequal(M_.endo_names_long, tmp)
48 error('M_.endo_names_long is wrong!')
49 end