10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>
//
use crate::mcf;
use crate::problem::{
FirstOrderProblem as ParallelProblem, ResultSender, UpdateSender, UpdateState as ParallelUpdateState,
};
use crate::{DVector, Minorant, Real};
use log::{debug, warn};
use num_traits::Float;
|
|
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>
//
use crate::mcf::{self, Solver};
use crate::problem::{
FirstOrderProblem as ParallelProblem, ResultSender, UpdateSender, UpdateState as ParallelUpdateState,
};
use crate::{DVector, Minorant, Real};
use log::{debug, warn};
use num_traits::Float;
|
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
ind: usize,
val: Real,
}
/// A single MMCF subproblem, i.e. one network.
struct Subproblem {
/// The (net, cost) pair.
net: mcf::Solver,
c: DVector,
}
/// Constraint data of one subproblem.
struct SubData {
lhs: Vec<Vec<Elem>>,
/// The right-hand side ... might be empty.
|
|
|
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
ind: usize,
val: Real,
}
/// A single MMCF subproblem, i.e. one network.
struct Subproblem {
/// The (net, cost) pair.
net: mcf::NetSpxSolver,
c: DVector,
}
/// Constraint data of one subproblem.
struct SubData {
lhs: Vec<Vec<Elem>>,
/// The right-hand side ... might be empty.
|
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
return Err(ExtraNodField);
}
}
// read nodes
let mut nets = Vec::with_capacity(ncom);
for i in 0..ncom {
nets.push(mcf::Solver::new(i, nnodes)?)
}
{
let mut f = File::open(&format!("{}.sup", basename))?;
buffer.clear();
f.read_to_string(&mut buffer)?;
}
for line in buffer.lines() {
|
|
|
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
return Err(ExtraNodField);
}
}
// read nodes
let mut nets = Vec::with_capacity(ncom);
for i in 0..ncom {
nets.push(mcf::NetSpxSolver::new(i, nnodes)?)
}
{
let mut f = File::open(&format!("{}.sup", basename))?;
buffer.clear();
f.read_to_string(&mut buffer)?;
}
for line in buffer.lines() {
|