From e37e6b380cb8946c43f381f3fbb8c51e3c8d787f Mon Sep 17 00:00:00 2001 From: Roland Schwan Date: Fri, 28 Jul 2023 13:11:35 +0200 Subject: [PATCH] add status_val to Matlab interface --- interfaces/matlab/piqp_mex.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interfaces/matlab/piqp_mex.cpp b/interfaces/matlab/piqp_mex.cpp index cdd8777..658cf6f 100644 --- a/interfaces/matlab/piqp_mex.cpp +++ b/interfaces/matlab/piqp_mex.cpp @@ -53,6 +53,7 @@ const char* PIQP_SETTINGS_FIELDS[] = {"rho_init", "compute_timings"}; const char* PIQP_INFO_FIELDS[] = {"status", + "status_val", "iter", "rho", "delta", @@ -216,6 +217,7 @@ mxArray* result_to_mx_struct(const piqp::Result& result) mxArray* mx_info_ptr = mxCreateStructMatrix(1, 1, n_info_fields, PIQP_INFO_FIELDS); mxSetField(mx_info_ptr, 0, "status", mxCreateString(piqp::status_to_string(result.info.status))); + mxSetField(mx_info_ptr, 0, "status_val", mxCreateDoubleScalar((double) result.info.status)); mxSetField(mx_info_ptr, 0, "iter", mxCreateDoubleScalar((double) result.info.iter)); mxSetField(mx_info_ptr, 0, "rho", mxCreateDoubleScalar(result.info.rho)); mxSetField(mx_info_ptr, 0, "delta", mxCreateDoubleScalar(result.info.delta));