Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  getRay() arguments in version 12.4

    Posted 07/15/12 10:43 AM

    Originally posted by: SystemAdmin


    Hello. I am working in Java (with Eclipse) with 12.4 and having some issues with the getRay() method. The problem I run into is this, used as documentation tells me it should be, for instance

    IloLinearNumExpr ray = cplex.getRay();

    it will not run and give me an error that it needs an IloNumArray and IloNumVarArray argument:

    Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    The method getRay(IloNumArray, IloNumVarArray) in the type IloCplex is not applicable for the arguments ()

    looking through documentation for older versions, it seems that the method used to need these arguments, so I tried to use it by passing the two appropriate arguments and get

    Exception in thread "main" java.lang.UnsupportedOperationException
    at ilog.cplex.IloCplex.getRay(IloCplex.java:16129)
    at example.main(example.java:38)

    which I am guessing is something I am at fault for, but I don't think I should be seeing this error as I shouldn't need arguments.
    I'm also unable to run the BendersATSP.java example which uses getRay() as well.

    Thoughts on why I may be running into this issue with getRay() or what I can do (ideally) to have it function as it should without arguments?
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: getRay() arguments in version 12.4

    Posted 07/15/12 05:59 PM

    Originally posted by: SystemAdmin


    > XPMA_Amy_Pielow wrote:
    > Hello. I am working in Java (with Eclipse) with 12.4 and having some issues with the getRay() method. The problem I run into is this, used as documentation tells me it should be, for instance
    >
    > IloLinearNumExpr ray = cplex.getRay();
    >
    > it will not run and give me an error that it needs an IloNumArray and IloNumVarArray argument:
    >
    > Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    > The method getRay(IloNumArray, IloNumVarArray) in the type IloCplex is not applicable for the arguments ()

    I just reran (in Netbeans, using CPLEX 12.4) a program I wrote that calls getRay() with no arguments. It worked fine. My first inclination is to suggest that you double check that the library you are using during compilation (the cplex.jar file) and the library you are using during execution (probably specify in a VM argument, -Djava.library.path=...) are both for version 12.4. Using a 12.1 or maybe 12.2 jar file could account for the first error; adding the old (now unnecessary) arguments and then linking to a 12.4 object file might account for the second error.

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: getRay() arguments in version 12.4

    Posted 07/15/12 08:45 PM

    Originally posted by: SystemAdmin


    I checked out both the cplex.jar file and VM argument and they both link to the cplex 12.4 installation.
    For that matter, I've only had 12.3 and 12.4 installed on this machine, nothing prior. I should mention it's an Academic Initiative version, not that it should matter (?).
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: getRay() arguments in version 12.4

    Posted 07/16/12 01:37 AM

    Originally posted by: SystemAdmin


    You may be using the wrong JAR file or may be looking at the documentation for the wrong JAR file.
    Unfortunately, there are two JAR files in a COS distribution that define an ilog.cplex.IloCplex class:
    1. cplex.jar: This defines IloLinearNumExpr IloCplex.getRay().
    2. oplall.jar: This defines IloLinearNumExpr IloCplex.getRay(IloNumArray,IloNumVarArray).
    Make sure you use the same JAR when compiling as you use when running. Also make sure you are looking at the documentation for the correct JAR.
    If you don't use OPL in your code then I recommend to use cplex.jar.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: getRay() arguments in version 12.4

    Posted 07/17/12 11:09 AM

    Originally posted by: SystemAdmin


    That must be what it is. Both are linked to the project, and it sees oppall.jar file first. Without out that it runs fine.

    Thank you!
    #CPLEXOptimizers
    #DecisionOptimization