COIN-OR::LEMON - Graph Library

Changeset 2591:3b4d5bc3b4fb in lemon-0.x for lemon/lp_cplex.cc


Ignore:
Timestamp:
03/01/08 21:09:40 (16 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3473
Message:

In C++98 array size shall be an integral constant expression. Fixes
ticket 12.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_cplex.cc

    r2553 r2591  
    9292
    9393    storespace *= -1;
    94     char buf[storespace];
     94    std::vector<char> buf(storespace);
    9595    char *names[1];
    9696    int dontcare;
    9797    ///\bug return code unchecked for error
    98     CPXgetcolname(env, lp, names, buf, storespace, &dontcare, col, col);
     98    CPXgetcolname(env, lp, names, &*buf.begin(), storespace, &dontcare, col, col);
    9999    name = names[0];
    100100  }
     
    403403  bool LpCplex::_isBasicCol(int i) const
    404404  {
    405     int cstat[CPXgetnumcols(env, lp)];
    406     CPXgetbase(env, lp, cstat, NULL);
     405    std::vector<int> cstat(CPXgetnumcols(env, lp));
     406    CPXgetbase(env, lp, &*cstat.begin(), NULL);
    407407    return (cstat[i]==CPX_BASIC);
    408408  } 
Note: See TracChangeset for help on using the changeset viewer.