Decision Optimization

Decision Optimization

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

 View Only
  • 1.  square linearNumExpr

    Posted Mon March 04, 2013 04:08 AM

    Originally posted by: SystemAdmin


    Hello!
    How can I take the square value of an iloLinearNumExpr ?
    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: square linearNumExpr

    Posted Mon March 04, 2013 05:15 AM

    Originally posted by: SystemAdmin


    To be more precise, I want to square each term of the expression
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: square linearNumExpr

    Posted Mon March 04, 2013 06:16 AM

    Originally posted by: SystemAdmin


    The IloLinearNumExpr class provides an iterator. You can use that iterator to iterate over the expression and build up a new expression that has each term of the original expression squared.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: square linearNumExpr

    Posted Mon March 04, 2013 07:43 AM

    Originally posted by: SystemAdmin


    When I use the cplex.square(it.nextNumVar()), where "it" is the iterator, the result is a numExpr. How will I put it in a linearNumExpr?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: square linearNumExpr

    Posted Mon March 04, 2013 08:38 AM

    Originally posted by: SystemAdmin


    Obviously this cannot be done: A squared variable is not a linear term and can therefore not be an element of a linear expression. You will have to use IloNumExpr or IloQuadNumExpr instead.
    #CPLEXOptimizers
    #DecisionOptimization