COIN-OR::LEMON - Graph Library

Changeset 1436:e0beb94d08bf in lemon-0.x for lemon/lp_cplex.cc


Ignore:
Timestamp:
05/26/05 14:16:16 (15 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1910
Message:

_copyLp(), _newLp() implemented.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_cplex.cc

    r1435 r1436  
    2222 
    2323  LpCplex::LpCplex() : LpSolverBase() {
    24     env = NULL;
    25     lp = NULL;
    26     env = CPXopenCPLEXdevelop(&status);     
    27 //     if (Env == NULL)
    28 //     {
    29 //          fprintf(stderr,"A CPLEX környezet megnyitása sikertelen.\n");
    30 //       CPXgeterrorstring(Env, Status, ErrorMsg);
    31 //       fprintf(stderr,"%s",ErrorMsg);
    32 //       goto Terminate;
    33 //     }
    34    
    35     // *** A problema létrehozása ***
     24
     25    //    env = CPXopenCPLEXdevelop(&status);     
     26    env = CPXopenCPLEX(&status);     
    3627    lp = CPXcreateprob(env, &status, "LP problem");
    37    
    38     //    if (Problem == NULL)
    39 //     {
    40 //      fprintf(stderr,"Az LP létrehozása sikertelen");
    41 //      goto Terminate;
    42 //     }
    43    
     28    //CPXmsg (cpxresults, "Hello-bello\n");
    4429  }
    4530 
    4631  LpCplex::~LpCplex() {
    47     status = CPXfreeprob(env,&lp);
    48     //       if (Status != 0)
    49     //  {
    50 //        fprintf(stderr,"A CPLEX feladat törlése sikertelen.\n");
    51 //        CPXgeterrorstring(Env, Status, ErrorMsg);
    52 //        fprintf(stderr,"%s",ErrorMsg);
    53 //        goto Terminate;
    54 //      }
    55        
    56     status = CPXcloseCPLEX(&env);
    57     //       if (Status != 0)
    58     //  {
    59     //    fprintf(stderr,"A CPLEX környezet bezárása sikertelen.\n");
    60 //        CPXgeterrorstring(Env, Status, ErrorMsg);
    61 //        fprintf(stderr,"%s",ErrorMsg);
    62 //        goto Terminate;
    63 //      }
    64      
     32    CPXfreeprob(env,&lp);
     33    CPXcloseCPLEX(&env);
    6534  }
    6635 
    6736  LpSolverBase &LpCplex::_newLp()
    6837  {
    69     return *(LpSolverBase*)0;
    70   }
     38    //The first approach opens a new environment
     39    LpCplex* newlp=new LpCplex();
     40    return *newlp;
     41  }
     42
    7143  LpSolverBase &LpCplex::_copyLp() {
    72     return *(LpSolverBase*)0;
    73     //Ez lesz majd CPXcloneprob (env, lp, &status);
     44    //The first approach opens a new environment
     45    LpCplex* newlp=new LpCplex();
     46    //The routine CPXcloneprob can be used to create a new CPLEX problem
     47    //object and copy all the problem data from an existing problem
     48    //object to it. Solution and starting information is not copied.
     49    newlp->lp = CPXcloneprob (env, lp, &status);
     50    return *newlp;
    7451  }
    7552
     
    8360    return i;
    8461  }
     62
    8563 
    8664  int LpCplex::_addRow()
     
    9876
    9977  void LpCplex::_eraseCol(int i) {
    100     ///\todo Not implemented yet
     78    CPXdelcols (env, lp, i, i);
    10179  }
    10280 
    10381  void LpCplex::_eraseRow(int i) {
    104     ///\todo Not implemented yet
     82    CPXdelrows (env, lp, i, i);
    10583  }
    10684
Note: See TracChangeset for help on using the changeset viewer.