CVX preprocessing takes 90 minutes for a problem that runs for 1 minute


CVX preprocessing time before calling Mosek is 90 minutes, while Mosek afterwards runs for 1 minute.
Is there a way to tell CVX to keep the preprocessing simple?

More details:
I have two different computers. They run the same CVX version, but one runs Matlab 2013a and the other runs Matlab 2015a. The preprocessing time before calling Mosek for the 2013a computer is a few seconds and for the 2015a computer is 90 minutes. In both cases Mosek afterwards runs for 1 minute.

(Michael C. Grant) #2

I’m afraid not. It’s likely that you’re going to need to perform the conversion by hand, outside of CVX.


It happens in Matlab 2016 as well. I noticed that usually it happens due to the slow Gaussian elimination inside cvx. A work around in this case is to perform it myself before calling cvx. For example, given constraints in the form:

Ceq * x == deq;

One can reduce them using:

function [Ceq2, deq2] = reduce_matrix(Ceq, deq)
    %rr = rref([Ceq deq]); % Reduced row echelon form    
    rr = frref([Ceq deq]); % fast
    % remove zero rows
    if 0
        rr(all(~rr,2), :) = []; 
        rs = sum(logical(rr),2);
        rr(rs==0, :) = [];

    Ceq2 = rr(:,1:end-1);
    deq2 = rr(:,end);

    %uCeq = unique(Ceq, 'rows');

Otherwise, as suggested, one would need to manually convert an (old) cvx code to yalmip.