lemon/lp_glpk.cc
changeset 2599 b9905565d185
parent 2553 bfced05fa852
child 2605 852361980706
equal deleted inserted replaced
29:3f2ee5e251a1 30:ac72b49e7cf7
    62     messageLevel(0);
    62     messageLevel(0);
    63     //Coefficient matrix, row bounds
    63     //Coefficient matrix, row bounds
    64     LEMON_glp(add_rows)(lp, LEMON_glp(get_num_rows)(glp.lp));
    64     LEMON_glp(add_rows)(lp, LEMON_glp(get_num_rows)(glp.lp));
    65     LEMON_glp(add_cols)(lp, LEMON_glp(get_num_cols)(glp.lp));
    65     LEMON_glp(add_cols)(lp, LEMON_glp(get_num_cols)(glp.lp));
    66     int len;
    66     int len;
    67     int ind[1+LEMON_glp(get_num_cols)(glp.lp)];
    67     std::vector<int> ind(1+LEMON_glp(get_num_cols)(glp.lp));
    68     Value val[1+LEMON_glp(get_num_cols)(glp.lp)];
    68     std::vector<Value> val(1+LEMON_glp(get_num_cols)(glp.lp));
    69     for (int i=1;i<=LEMON_glp(get_num_rows)(glp.lp);++i)
    69     for (int i=1;i<=LEMON_glp(get_num_rows)(glp.lp);++i)
    70       {
    70       {
    71 	len=LEMON_glp(get_mat_row)(glp.lp,i,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,val);
    72 	LEMON_glp(set_mat_row)(lp, i,len,&*ind.begin(),&*val.begin());
    73 	LEMON_glp(set_row_bnds)(lp,i,
    73 	LEMON_glp(set_row_bnds)(lp,i,
    74 				LEMON_glp(get_row_type)(glp.lp,i),
    74 				LEMON_glp(get_row_type)(glp.lp,i),
    75 				LEMON_glp(get_row_lb)(glp.lp,i),
    75 				LEMON_glp(get_row_lb)(glp.lp,i),
    76 				LEMON_glp(get_row_ub)(glp.lp,i));
    76 				LEMON_glp(get_row_ub)(glp.lp,i));
    77       }
    77       }