Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Is class IloNumArray2 and IloNumArray3 now default in cplex?

  • 1.  Is class IloNumArray2 and IloNumArray3 now default in cplex?

    Posted Fri October 16, 2015 08:24 AM

    Originally posted by: YewenGu


    Hi everyone
     
    I am now learning to use C++ and cplex to do optimization. Have some AMPL experience before.
     
    I am trying to build 3D matrix for my 3D parameters.
    I remember we need to do typedef to define class for 2D or 3D matrix before, like
     
    typedef IloArray<IloNumArray>     IloNumArray2;
    typedef IloArray<IloNumArray2>    IloNumArray3;
     
    But now I find it seems to be no need to do so. It seems IloNumArray2 and IloNumArray3 are already built in cplex now and I can use them directly. Is that correct?

    I found it is very strange that after I sued "typedef IloArray<IloNumArray2> IloNumArray3" and "IloNumArray3 x (env)", I got red underline when I try to do file >> x for data input. The error is "no operator ">>" matches these operands". But if I remove the typedef thing and use IloNumArray3 directly. Its fine. Very strange.

     

    My Visual Studio should be 2010 version, but cplex should be the latest or at least very new.

    Please kindly help to answer if you know. Thanks in advance

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Is class IloNumArray2 and IloNumArray3 now default in cplex?

    Posted Fri October 16, 2015 08:34 AM

    Correct. As you can see in the ilconcert/iloenv.h header file, types IloNumArray2 and IloNumArray3 are types defined by CPLEX. For these types operator>> is also overloaded.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Is class IloNumArray2 and IloNumArray3 now default in cplex?

    Posted Fri October 16, 2015 08:59 AM

    Originally posted by: YewenGu


    Hi Daniel,

    Thanks for the reply.

     

     

     

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Is class IloNumArray2 and IloNumArray3 now default in cplex?

    Posted Mon January 25, 2016 01:24 AM

    Originally posted by: Girish Dey


    Hi  Daniel,

                  I am also facing the same problem while building 2D and 3D matrix.

        I have one boolean matrix. I have  defined it :

            typedef IloArray<IloBoolArray> BoolMatrix;

       after that  I declared it:

     BoolMatrix Assigned(env);

    but while trying input data by file >> Assigned, it is showing error (no operator ">>" matches these operands). Whatever suggestions you have already discussed here(removing typedef, and directly put IloBoolArray2 Assigned(env) ) I tried ,but it is not accepting IloBoolArray2. )

     

    Thanks 

     

     

            

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Is class IloNumArray2 and IloNumArray3 now default in cplex?

    Posted Wed January 27, 2016 06:22 AM

    Please don't ask the same question in multiple places. And if you ask the same question in multiple places then please at least cross-reference them. You asked the same question here.


    #CPLEXOptimizers
    #DecisionOptimization