From 7478f067cdba03aa1990ddced4572b000e1df02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Tue, 19 Mar 2024 15:51:03 +0100 Subject: [PATCH] =?UTF-8?q?Simplify=20calls=20to=20=E2=80=9Cilu=E2=80=9D?= =?UTF-8?q?=20function=20by=20dropping=20options=20at=20their=20default=20?= =?UTF-8?q?value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../solve_two_boundaries_stacked.m | 6 +----- mex/sources/bytecode/Interpreter.cc | 7 ++----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/matlab/perfect-foresight-models/solve_two_boundaries_stacked.m b/matlab/perfect-foresight-models/solve_two_boundaries_stacked.m index 9d9ed979ce..3fdee24fac 100644 --- a/matlab/perfect-foresight-models/solve_two_boundaries_stacked.m +++ b/matlab/perfect-foresight-models/solve_two_boundaries_stacked.m @@ -25,7 +25,7 @@ function [y, T, success, max_res, iter] = solve_two_boundaries_stacked(fh, y, x, % ALGORITHM % Newton with LU or GMRES or BiCGStab -% Copyright © 1996-2023 Dynare Team +% Copyright © 1996-2024 Dynare Team % % This file is part of Dynare. % @@ -59,10 +59,6 @@ iter=0; correcting_factor=0.01; ilu_setup.droptol=1e-10; ilu_setup.type = 'ilutp'; -%ilu_setup.milu = 'col'; -ilu_setup.milu = 'off'; -ilu_setup.thresh = 1; -ilu_setup.udiag = 0; max_resa=1e100; lambda = 1; % Length of Newton step (unused for stack_solve_algo=4) reduced = 0; diff --git a/mex/sources/bytecode/Interpreter.cc b/mex/sources/bytecode/Interpreter.cc index b6357f2197..2753c116de 100644 --- a/mex/sources/bytecode/Interpreter.cc +++ b/mex/sources/bytecode/Interpreter.cc @@ -3138,16 +3138,13 @@ Interpreter::Solve_Matlab_BiCGStab(mxArray* A_m, mxArray* b_m, bool is_two_bound else if (preconditioner == 1) { /*[L1, U1] = ilu(g1a=;*/ - std::array field_names {"type", "droptol", "milu", "udiag", "thresh"}; - const int type = 0, droptol = 1, milu = 2, udiag = 3, thresh = 4; + std::array field_names {"type", "droptol"}; + const int type {0}, droptol {1}; std::array dims {static_cast<mwSize>(1)}; mxArray* Setup = mxCreateStructArray(dims.size(), dims.data(), field_names.size(), field_names.data()); mxSetFieldByNumber(Setup, 0, type, mxCreateString("ilutp")); mxSetFieldByNumber(Setup, 0, droptol, mxCreateDoubleScalar(lu_inc_tol)); - mxSetFieldByNumber(Setup, 0, milu, mxCreateString("off")); - mxSetFieldByNumber(Setup, 0, udiag, mxCreateDoubleScalar(0)); - mxSetFieldByNumber(Setup, 0, thresh, mxCreateDoubleScalar(1)); std::array<mxArray*, 2> lhs0; std::array rhs0 {A_m, Setup}; if (mexCallMATLAB(lhs0.size(), lhs0.data(), rhs0.size(), rhs0.data(), "ilu")) -- GitLab