Skip to content

Commit

Permalink
add status_val to Matlab interface
Browse files Browse the repository at this point in the history
  • Loading branch information
RSchwan committed Jul 28, 2023
1 parent 2999853 commit e37e6b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions interfaces/matlab/piqp_mex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const char* PIQP_SETTINGS_FIELDS[] = {"rho_init",
"compute_timings"};

const char* PIQP_INFO_FIELDS[] = {"status",
"status_val",
"iter",
"rho",
"delta",
Expand Down Expand Up @@ -216,6 +217,7 @@ mxArray* result_to_mx_struct(const piqp::Result<double>& 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));
Expand Down

0 comments on commit e37e6b3

Please sign in to comment.