perfect_foresight_problem MEX: check the return code of mexCallMATLAB()

time-shift
Sébastien Villemot 2020-12-07 15:03:35 +01:00
parent eeb76803a5
commit 55e25bcb7f
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright © 2019 Dynare Team
* Copyright © 2019-2020 Dynare Team
*
* This file is part of Dynare.
*
@ -101,7 +101,8 @@ mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
// Call <model>.dynamic_g1_nz
mxArray *g1_nz_plhs[3];
mexCallMATLAB(3, g1_nz_plhs, 0, nullptr, (basename + ".dynamic_g1_nz").c_str());
if (mexCallMATLAB(3, g1_nz_plhs, 0, nullptr, (basename + ".dynamic_g1_nz").c_str()) != 0)
mexErrMsgTxt((std::string{"Could not call "} + basename + ".dynamic_g1_nz").c_str());
const mxArray *nzij_pred_mx = g1_nz_plhs[0];
const mxArray *nzij_current_mx = g1_nz_plhs[1];
const mxArray *nzij_fwrd_mx = g1_nz_plhs[2];