COIN-OR::LEMON - Graph Library

Changeset 2591:3b4d5bc3b4fb in lemon-0.x


Ignore:
Timestamp:
03/01/08 21:09:40 (11 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.

Location:
lemon
Files:
2 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  } 
  • lemon/lp_glpk.cc

    r2553 r2591  
    6565    LEMON_glp(add_cols)(lp, LEMON_glp(get_num_cols)(glp.lp));
    6666    int len;
    67     int ind[1+LEMON_glp(get_num_cols)(glp.lp)];
    68     Value val[1+LEMON_glp(get_num_cols)(glp.lp)];
     67    std::vector<int> ind(1+LEMON_glp(get_num_cols)(glp.lp));
     68    std::vector<Value> val(1+LEMON_glp(get_num_cols)(glp.lp));
    6969    for (int i=1;i<=LEMON_glp(get_num_rows)(glp.lp);++i)
    7070      {
    71         len=LEMON_glp(get_mat_row)(glp.lp,i,ind,val);
    72         LEMON_glp(set_mat_row)(lp, i,len,ind,val);
     71        len=LEMON_glp(get_mat_row)(glp.lp,i,&*ind.begin(),&*val.begin());
     72        LEMON_glp(set_mat_row)(lp, i,len,&*ind.begin(),&*val.begin());
    7373        LEMON_glp(set_row_bnds)(lp,i,
    7474                                LEMON_glp(get_row_type)(glp.lp,i),
Note: See TracChangeset for help on using the changeset viewer.