Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

cplex Model with column vectors - What ist cplex doing with row vectors?

  • 1.  cplex Model with column vectors - What ist cplex doing with row vectors?

    Posted Fri November 08, 2013 05:23 AM

    Originally posted by: TF87


    The cplex documentation for the property Model states, that the fields

    • obj, lb, ub, lhs, rhs

    are of the type "column vector".

    I've got a program, where lhs, rhs are given as column vectors and obj, lb, ub as row vectors. In that case, the solution is completely different compared to the case, where column vectors are given to the listed fields. One might think, that in the first case cplex just transposes the row into column vectors but that is obviously not the case, because the solution is completely different.

    Do you know, what cplex is actually doing in that described case, with those row vectors? Because the behaviour makes a strange impression...


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: cplex Model with column vectors - What ist cplex doing with row vectors?

    Posted Wed November 13, 2013 03:02 AM

    The short answer is: just don't do that.

    For historical reasons CPLEX silently accepts row vectors here but it may not handle them correctly in all cases. Since the documentation says that these vectors must be column vectors, future versions of CPLEX may error out if you provide row vectors instead. In order to avoid using row vectors by accident you can set the data check parameter to 1. If this is set to 1 then CPLEX will check that the dimensions of the vectors in a problem object are as required.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: cplex Model with column vectors - What ist cplex doing with row vectors?

    Posted Wed November 13, 2013 05:14 AM

    Originally posted by: TF87


    Many thanks for your answer!


    #CPLEXOptimizers
    #DecisionOptimization