Ran sosdemo8.m in sostool returned error

I am a beginner in using sostool and sedumi. I am using matlab 2018a. Since I am a beginner using these tools, I want to make sure I installed them correctly. So I ran the demo scripts included in the sostool folder. All demo scripts ran ok, except for sosdemo8.m. I also tried findlyap.m using an example in the user's manual, the same error came up:
Error using psdinvjmul Assertion failed (m>1) at line 290 of file 'reflect.c'... then some stack trace error which I won't post here(not sure how useful that would be), then the following error... Error in wregion (line 98) psdinvjmul(vTAR,vfrm.s,dxmdz, K)];
Error in sedumi (line 478) wregion(L,Lden,Lsd,...
Error in sossolve (line 149) [x,y,info] = sedumi(At,b,c,K,pars);
Error in sosdemo8 (line 44) prog = sossolve(prog,solver_opt);
I suspect something is wrong with my sedumi installation, maybe compatibility issue with matlab? But if my sedumi installation is wrong, why would all other demos work?
Any insight is appreciated. Thank you very much in advance!

4 Comments

You should be asking the code authors https://github.com/sqlp/sedumi at the readme section, way bottom.
From what I can tell, the assertion failed - "m" was suppose to be greater than 1, but it is not. I don't know what this m is, but it seems like the index to a square matrix of some origin. Do you have an input to this function, where the size of a matrix is NOT greater than a 1x1? It looks like in needs at least a 2x2 matrix input.
Assertion failed (m>1) at line 290 of reflect.c
/* ************************************************************
PROCEDURE qxqt - computes tril(Qb * X * Qb')
Here, Qb = Q_1*Q_2*..*Q_{m-1}, where each Q_i is a Householder reflection.
(Qb is from a Qb * R decomposition.)
INPUT
beta - length m vector
c - m x m matrix, lower triangular gives Householder reflections
m - order
UPDATED
x - m x m. On output, Xnew = Qb * X * Qb'
This means: start with order 2 reflection, up to order m reflection.
WORK
fwork - length m working vector.
************************************************************ */
void qxqt(double *x, const double *beta, const double *c,
const mwIndex m, double *fwork)
{
mwIndex k, inz;
mxAssert(m>1,"");
inz = SQR(m) - (m+2);
Thank you very much for responding to my question. :) I will contact the authors you mentioned. I tried to debug this issue before, and found out that some of the input variables are null variables, hence the error. But since this is a demo code, I do not expect it to fail. I have not used sostool before, nor sedumi, so I suspect maybe this is a compatibility issue with matlab? I assume sedumi was verified on older versions of matlab? The latest update of sedumi seems to be 5 years ago from the website I got it from. Again, thank you very much!
It's possible that the authors failed to update the demo when they fixed their other codes. Just because the demo fails doesn't mean the algorithm is faulty. If this was a Unit Test though, then a failed unit test would be concerning.
Yes, that is also possible... I was doing one of the examples as explained in the sostools user's manual, and ran the findlyap() functions in the sostool, it also gave the same error. So I suspect it is either a compatibility issue between three softwares, or I messed up on the installation of either sostool or sedumi. I will follow your suggestion and contact sedumi and sostool to see if they might know about this. Thank you again for your insight and timely replies. :)

Sign in to comment.

Answers (1)

Bao Huang
Bao Huang on 29 Sep 2018
Edited: Bao Huang on 29 Sep 2018
I found out the answer to my question. Some of the binary files in sedumi is not compatible with matlab 2018a. They should be recompiled using install_sedumi -rebuild. However, if the matlab does not have MinGW-w64 C/C++ Compiler installed, the rebuild comes back as unsucessful with a general error message saying one or more codes failed to compile, and sedumi install is unsucessful. If I just use install_sedumi, it will claim installation is successful, because it looks for if the binary files exist, but not if they are compatible with current matlab version. This causes my confusion, as I do not know whether I have installed sedumi correctly. The example sedumi(1,1,1) also works even if I did not rebuild the binary file, which made me even more confused. Anyway, I installed the c++ compiler and used install_sedumi -rebuild, now it works. The sosdemo8 script works now.
hope this helps those trying to use sostool and sedumi for the first time. Thanks to those who commented on this post.

Categories

Products

Release

R2018a

Asked:

on 28 Sep 2018

Edited:

on 29 Sep 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!