Changeset 1016:97975184f4aa in lemon-main
- Timestamp:
- 02/22/13 16:49:41 (12 years ago)
- Branch:
- default
- Parents:
- 1014:bc726f4892c7 (diff), 1015:d32e4453b48c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/cplex.cc
r989 r1016 41 41 int status; 42 42 _cnt = new int; 43 (*_cnt) = 1; 43 44 _env = CPXopenCPLEX(&status); 44 45 if (_env == 0) { -
lemon/cplex.cc
r1015 r1016 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2010 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 113 113 } 114 114 115 int CplexBase::_addRow(Value lb, ExprIterator b, 116 ExprIterator e, Value ub) { 117 int i = CPXgetnumrows(cplexEnv(), _prob); 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 133 std::vector<int> indices; 134 std::vector<int> rowlist; 135 std::vector<Value> values; 136 137 for(ExprIterator it=b; it!=e; ++it) { 138 indices.push_back(it->first); 139 values.push_back(it->second); 140 rowlist.push_back(i); 141 } 142 143 CPXchgcoeflist(cplexEnv(), _prob, values.size(), 144 &rowlist.front(), &indices.front(), &values.front()); 145 146 return i; 147 } 115 148 116 149 void CplexBase::_eraseCol(int i) { … … 456 489 457 490 void CplexBase::_applyMessageLevel() { 458 CPXsetintparam(cplexEnv(), CPX_PARAM_SCRIND, 491 CPXsetintparam(cplexEnv(), CPX_PARAM_SCRIND, 459 492 _message_enabled ? CPX_ON : CPX_OFF); 460 493 }
Note: See TracChangeset
for help on using the changeset viewer.