Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  matlab crashes using cplexmiqp

    Posted 02/12/14 08:01 AM

    Originally posted by: C1GP_Reinhold_Bertram


    Using this piece of code let matlab crash:

    n = 100;
    opts = cplexoptimset('cplex');
    cplexmiqp(0,rand(n,1),-rand(n),-0.5*ones(1,n),[],[],[],[],[],zeros(n,1),ones(n,1),repmat('I',1,n),[],opts);
    

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: matlab crashes using cplexmiqp

    Posted 02/12/14 08:42 AM

    I think the crash happens because you are supplying input to the function. When I additionally set (see here)

    opts.read.datacheck = 1;

    to make CPLEX explicitly check the input, then I get an error

    Error: bineq has incompatible dimensions

    And indeed, in your input bineq is a row vector but should be a column vector. Fixing this to be ones(n,1) I get the next error:

    Error: H not a valid H matrix

    To specify an empty matrix you need to use [], not 0.

    CPLEX by default does not check for all sorts of invalid input you can pass into the functions. If you want it to check everything then you have to set the data check parameter (as I did above).

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: matlab crashes using cplexmiqp

    Posted 02/12/14 10:17 AM

    Originally posted by: C1GP_Reinhold_Bertram


    Thanks for the fast answer.

    Thats is a nice option, I will use from now on.

    But can you may consider the problem. I don't like the idea that unintentionally giving wrong parameters crashes matlab with the need to restart it, (loosing everything in the workspace) Would make it more stable I think.

    Unfortunatly I can't see anything at the link you provided.

    Best Regards

    Reinhold


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: matlab crashes using cplexmiqp

    Posted 02/13/14 01:28 AM

    Hm, the link works fine for me. Here is it spelled out:

    http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r6/index.jsp?topic=%2Filog.odms.cplex.help%2FCPLEX%2FParameters%2Ftopics%2FDataCheck.html

    For making CPLEX matlab connector more robust I have filed a user wish to address this issue.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: matlab crashes using cplexmiqp

    Posted 02/12/14 11:33 AM

    Originally posted by: Mark L. Stone


    What kind of performance penalty, if any, is there for using opts.read.datacheck = 1?  If there is not a significant performance penalty, why not (other than backward compatibility) make this the default behavior, and require a user to set a parameter to disable input checking?  As a routine matter of course, MATLAB built in functions do do some error checking of inputs, so this suggestion would be in line with the standard MATLAB paradigm, in which users accept whatever performance penalty is associated with input error checking.


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: matlab crashes using cplexmiqp

    Posted 02/13/14 01:16 AM

    The performance penalty for datacheck=1 may be significant. With datacheck=1 CPLEX for example checks the matrix for bad numbers such as NaNs. This obviously requires a O(non-zeros) scan through the matrix which is prohibitively expensive for large models.

    I think the right thing to do here is what Reinhold suggested: Just always check for obvious errors that can be tested in constant time (dimension mismatch, invalid type of argument, ...). I have already filed a user wish for improving robustness in this sort of situations.


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: matlab crashes using cplexmiqp

    Posted 02/13/14 07:43 AM

    Originally posted by: Mark L. Stone


    Yes, perhaps datacheck = "0.5" as the default behavior, catching at least a lot of easy to find errors, such as dimension mismatches, which are relatively common errors in MATLAB.  As it is now, it appears to be an all or nothing proposition, with the default being nothing.


    #CPLEXOptimizers
    #DecisionOptimization