Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Lp file could not import

    Posted 06/16/08 04:04 PM

    Originally posted by: SystemAdmin


    [Ningning said:]

    what's wrong with my program?

    #include <ilcplex/ilocplex.h>

    ILOSTLBEGIN

    void main()
    {
      IloEnv env;
      try {
          IloModel model(env);
          IloCplex cplex(env);
          IloObjective  obj;
          IloNumVarArray var(env);
          IloRangeArray  rng(env);

          cplex.importModel(model,"qpex.lp",obj,var,rng );

          cplex.extract(model);
          cplex.solve();

          env.out() << "Solution status = " << cplex.getStatus() << endl;<br />      env.out() << "Solution value  = " << cplex.getObjValue() << endl;<br />
        }
          catch (IloException& ex) {
          cerr << "Error: " << ex << endl;<br />    }
        catch (...) {
          cerr << "Error" << endl;<br />    }

    env.end();
    }


    The result is"CPLEX Error:1423:Could not open file 'qpex.lp' for reading"."qpex.lp" is one example published with CPLEX and is definitely right.
    But what's wrong with my program ?
    Hope for your help !
    Thanks a lot !
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Lp file could not import

    Posted 06/16/08 06:23 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    From what I read in the error message, CPLEX could not 'open' the file - this does not mean that the file has errors but that CPLEX could not find it. It's probably that the file is not in your working directory when you run the program.

    Hope this helps.

    Didier.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Lp file could not import

    Posted 07/11/08 02:42 PM

    Originally posted by: SystemAdmin


    [Jenny said:]

    Dear Ningning,

    I copied your program and ran it, it  worked very well.

    So your program is definitely right. There must be something wrong with your lp file.

    Attaches is your program in my workspace. [b]Remenber to copy "Cplex90.dll" into the program working directory when you run it.[/b]
    Hope it can helps you!

    Yan From xjtu.
    #CPLEXOptimizers
    #DecisionOptimization