Changes in / [1127:27d7d232fbcc:1126:043a787c3cee] in lemon-main
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/cplex.cc
r1125 r1092 116 116 ExprIterator e, Value ub) { 117 117 int i = CPXgetnumrows(cplexEnv(), _prob); 118 119 int rmatbeg = 0; 120 118 if (lb == -INF) { 119 const char s = 'L'; 120 CPXnewrows(cplexEnv(), _prob, 1, &ub, &s, 0, 0); 121 } else if (ub == INF) { 122 const char s = 'G'; 123 CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, 0, 0); 124 } else if (lb == ub){ 125 const char s = 'E'; 126 CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, 0, 0); 127 } else { 128 const char s = 'R'; 129 double len = ub - lb; 130 CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, &len, 0); 131 } 132 121 133 std::vector<int> indices; 134 std::vector<int> rowlist; 122 135 std::vector<Value> values; 123 136 … … 125 138 indices.push_back(it->first); 126 139 values.push_back(it->second); 127 } 128 129 if (lb == -INF) { 130 const char s = 'L'; 131 CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &ub, &s, 132 &rmatbeg, &indices.front(), &values.front(), 0, 0); 133 } else if (ub == INF) { 134 const char s = 'G'; 135 CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &lb, &s, 136 &rmatbeg, &indices.front(), &values.front(), 0, 0); 137 } else if (lb == ub){ 138 const char s = 'E'; 139 CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &lb, &s, 140 &rmatbeg, &indices.front(), &values.front(), 0, 0); 141 } else { 142 const char s = 'R'; 143 double len = ub - lb; 144 CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &ub, &s, 145 &rmatbeg, &indices.front(), &values.front(), 0, 0); 146 CPXchgrngval(cplexEnv(), _prob, 1, &i, &len); 147 } 148 140 rowlist.push_back(i); 141 } 142 143 CPXchgcoeflist(cplexEnv(), _prob, values.size(), 144 &rowlist.front(), &indices.front(), &values.front()); 145 149 146 return i; 150 147 }
Note: See TracChangeset
for help on using the changeset viewer.