Testsuite: check that stochastic solution in block decomposition mode is correct
Only test with mfs=0, since the result is wrong for other mfs values. Ref. #1726time-shift
parent
ef58f1329a
commit
58b2bc78c3
|
@ -162,6 +162,8 @@ MODFILES = \
|
|||
block_bytecode/lola_solve_one_boundary_mfs1.mod \
|
||||
block_bytecode/lola_solve_one_boundary_mfs2.mod \
|
||||
block_bytecode/lola_solve_one_boundary_mfs3.mod \
|
||||
block_bytecode/lola_stochastic.mod \
|
||||
block_bytecode/lola_stochastic_block.mod \
|
||||
k_order_perturbation/fs2000k2a.mod \
|
||||
k_order_perturbation/fs2000k2_use_dll.mod \
|
||||
k_order_perturbation/fs2000k_1_use_dll.mod \
|
||||
|
@ -703,6 +705,8 @@ block_bytecode/lola_solve_one_boundary_mfs2.m.trs: block_bytecode/lola_solve_one
|
|||
block_bytecode/lola_solve_one_boundary_mfs2.o.trs: block_bytecode/lola_solve_one_boundary.o.trs
|
||||
block_bytecode/lola_solve_one_boundary_mfs3.m.trs: block_bytecode/lola_solve_one_boundary.m.trs
|
||||
block_bytecode/lola_solve_one_boundary_mfs3.o.trs: block_bytecode/lola_solve_one_boundary.o.trs
|
||||
block_bytecode/lola_stochastic_block.m.trs: block_bytecode/lola_stochastic.m.trs
|
||||
block_bytecode/lola_stochastic_block.o.trs: block_bytecode/lola_stochastic.o.trs
|
||||
|
||||
histval_initval_file/ramst_initval_file.m.trs: histval_initval_file/ramst_initval_file_data.m.tls histval_initval_file/ramst_data_generate.m.trs
|
||||
histval_initval_file/ramst_initval_file.o.trs: histval_initval_file/ramst_initval_file_data.o.tls histval_initval_file/ramst_data_generate.o.trs
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
// Stochastic version of LOLA model, as benchmark for lola_stochastic_block.mod
|
||||
|
||||
@#define deterministic = false
|
||||
@#define block = false
|
||||
@#include "lola_common.inc"
|
|
@ -0,0 +1,26 @@
|
|||
/* Stochastic version of block decomposed LOLA model.
|
||||
Check that policy functions are the same as in non-block version. */
|
||||
|
||||
@#define deterministic = false
|
||||
@#define block = true
|
||||
@#define mfs = 0
|
||||
@#include "lola_common.inc"
|
||||
|
||||
[~, state_reorder] = sort(oo_.dr.state_var);
|
||||
|
||||
ref = load('lola_stochastic_results.mat');
|
||||
|
||||
[~, ref_state_reorder] = sort(ref.oo_.dr.state_var);
|
||||
|
||||
/* NB: With block, the rows of ghx and ghu are in declaration order (and not in
|
||||
DR-order as in non-block mode) */
|
||||
|
||||
if max(max(abs(oo_.dr.ghx(:, state_reorder) - ref.oo_.dr.ghx(ref.oo_.dr.inv_order_var, ref_state_reorder)))) > 2e-9
|
||||
error('Error in ghx')
|
||||
end
|
||||
|
||||
if max(max(abs(oo_.dr.ghu - ref.oo_.dr.ghu(ref.oo_.dr.inv_order_var, :)))) > 6e-9
|
||||
error('Error in ghu')
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue