Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Removing Display Output from CPLEX 12.2 MATLAB API

    Posted Wed August 03, 2011 08:05 PM

    Originally posted by: BerkUstun


    I am wondering if anyone knows how to remove display output from the CPLEX MATLAB API. I am currently using the CPLEX 12.2 API with the 64 bit version of MATLAB 2011a on Unix. I will illustrate an issue with the following example:

    Say I create an LP object in MATLAB using:

    LP = Cplex()
    % Set LP.Model.A, LP.Model.lhs,LP.Model.rhs, LP.Model.ub, LP.Model.lb
    


    When I try to solve this object with the solve method, CPLEX usually generates some output. That is:

    >> LP.solve
     
    Using devex.
    Using devex.
     
    Primal simplex solved model.
     
    ans = 
     
              status: 1
        statusstring: 'optimal'
                time: 0.0217
              objval: -60
                   x: [4x1 double]
              method: 1
                dual: [3x1 double]
                  ax: [3x1 double]
         reducedcost: [4x1 double]
               basis: [1x1 struct]
    

    In the past, I could remove all of this output by replacing the Display Function with an empty matrix. That is

    LP.DispFunction = []
    


    Unfortunately, doing this now this only removes part of the output. When I now solve the LP, I still obtain:

    Using devex.
    Using devex.
     
    Primal simplex solved model.
    


    Does anyone know how to remove the remaining output? As a side note, using a semi-colon to suppress output does not resolve the issue (i.e. using "LP.solve;" instead of "LP.solve").
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Removing Display Output from CPLEX 12.2 MATLAB API

    Posted Wed August 03, 2011 08:31 PM

    Originally posted by: John Cui


    Actually, you should use:
    LP.DisplayFunc = []
    

    to disable the output.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Removing Display Output from CPLEX 12.2 MATLAB API

    Posted Wed August 03, 2011 08:51 PM

    Originally posted by: BerkUstun


    Sorry that was just a typo. I will correct it. The issue still stands with LP.DisplayFunc = [].
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Removing Display Output from CPLEX 12.2 MATLAB API

    Posted Wed August 03, 2011 09:33 PM

    Originally posted by: BerkUstun


    Also, I noticed that I do not get any additional output when I force CPLEX to solve the LP using Simplex.

    LP.Param.lpmethod.Cur = 1;
    


    My guess is that the following output:

    Using devex.
    Using devex.
    Primal simplex solved model.
    


    is created by the 'automatic' LP algorithm selection feature in CPLEX (i.e. when LP.Param.lpmethod.Cur = 0).

    Is there any setting to have it still select the LP algorithm automatically but not display this output?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Removing Display Output from CPLEX 12.2 MATLAB API

    Posted Wed August 03, 2011 10:13 PM

    Originally posted by: John Cui


    1. In my MATLAB 2008b + windows xp + cplex12.2, DisplayFunc works fine, let me check in MATLAB2011a.
    2. You can set simplex display to 2 by LP.Param.simplex.display.Cur = 2 to display more simplex log, then you will know which lpmethod you are using.
    And also, you can use LP.getChgParam method to get changed parameters.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Removing Display Output from CPLEX 12.2 MATLAB API

    Posted Thu August 04, 2011 08:30 PM

    Originally posted by: John Cui


    I tried MATLAB2011a, DisplayFunc works fine:
    LP = Cplex();
    LP.DisplayFunc = [];
    LP.solve()
    ans = 
     
              status: 1
        statusstring: 'optimal'
                time: 0.0160
              objval: 0
              method: 2
     
     
    LP = Cplex();
    LP.solve()
    Parallel mode: deterministic, using up to 2 threads for concurrent optimization.
    Tried aggregator 1 time.
    No LP presolve or aggregator reductions.
     
    Dual simplex solved model.
     
     
    ans = 
     
              status: 1
        statusstring: 'optimal'
                time: 0.0310
              objval: 0
              method: 2
    


    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Removing Display Output from CPLEX 12.2 MATLAB API

    Posted Fri August 05, 2011 03:46 PM

    Originally posted by: SystemAdmin


    These settings should allow CPLEX to select the LP algorithm automatically, but not display any output:
    LP.DisplayFunc = [];
    LP.Param.simplex.display.Cur = 0;
    LP.Param.barrier.display.Cur = 0;
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Removing Display Output from CPLEX 12.2 MATLAB API

    Posted Fri August 05, 2011 07:58 PM

    Originally posted by: John Cui


    Actually,
    LP.DisplayFunc = [];
    

    is enough.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization