... | ... |
@@ -84,60 +84,63 @@ |
84 | 84 |
}; |
85 | 85 |
|
86 | 86 |
// Check the interface of an MCF algorithm |
87 | 87 |
template <typename GR, typename Value, typename Cost> |
88 | 88 |
class McfClassConcept |
89 | 89 |
{ |
90 | 90 |
public: |
91 | 91 |
|
92 | 92 |
template <typename MCF> |
93 | 93 |
struct Constraints { |
94 | 94 |
void constraints() { |
95 | 95 |
checkConcept<concepts::Digraph, GR>(); |
96 |
|
|
97 |
const Constraints& me = *this; |
|
96 | 98 |
|
97 |
MCF mcf(g); |
|
99 |
MCF mcf(me.g); |
|
98 | 100 |
const MCF& const_mcf = mcf; |
99 | 101 |
|
100 | 102 |
b = mcf.reset() |
101 |
.lowerMap(lower) |
|
102 |
.upperMap(upper) |
|
103 |
.costMap(cost) |
|
104 |
.supplyMap(sup) |
|
105 |
. |
|
103 |
.lowerMap(me.lower) |
|
104 |
.upperMap(me.upper) |
|
105 |
.costMap(me.cost) |
|
106 |
.supplyMap(me.sup) |
|
107 |
.stSupply(me.n, me.n, me.k) |
|
106 | 108 |
.run(); |
107 | 109 |
|
108 | 110 |
c = const_mcf.totalCost(); |
109 | 111 |
x = const_mcf.template totalCost<double>(); |
110 |
v = const_mcf.flow(a); |
|
111 |
c = const_mcf.potential(n); |
|
112 |
v = const_mcf.flow(me.a); |
|
113 |
c = const_mcf.potential(me.n); |
|
112 | 114 |
const_mcf.flowMap(fm); |
113 | 115 |
const_mcf.potentialMap(pm); |
114 | 116 |
} |
115 | 117 |
|
116 | 118 |
typedef typename GR::Node Node; |
117 | 119 |
typedef typename GR::Arc Arc; |
118 | 120 |
typedef concepts::ReadMap<Node, Value> NM; |
119 | 121 |
typedef concepts::ReadMap<Arc, Value> VAM; |
120 | 122 |
typedef concepts::ReadMap<Arc, Cost> CAM; |
121 | 123 |
typedef concepts::WriteMap<Arc, Value> FlowMap; |
122 | 124 |
typedef concepts::WriteMap<Node, Cost> PotMap; |
125 |
|
|
126 |
GR g; |
|
127 |
VAM lower; |
|
128 |
VAM upper; |
|
129 |
CAM cost; |
|
130 |
NM sup; |
|
131 |
Node n; |
|
132 |
Arc a; |
|
133 |
Value k; |
|
123 | 134 |
|
124 |
const GR &g; |
|
125 |
const VAM &lower; |
|
126 |
const VAM &upper; |
|
127 |
const CAM &cost; |
|
128 |
const NM ⊃ |
|
129 |
const Node &n; |
|
130 |
const Arc &a; |
|
131 |
const Value &k; |
|
132 | 135 |
FlowMap fm; |
133 | 136 |
PotMap pm; |
134 | 137 |
bool b; |
135 | 138 |
double x; |
136 | 139 |
typename MCF::Value v; |
137 | 140 |
typename MCF::Cost c; |
138 | 141 |
}; |
139 | 142 |
|
140 | 143 |
}; |
141 | 144 |
|
142 | 145 |
|
143 | 146 |
// Check the feasibility of the given flow (primal soluiton) |
0 comments (0 inline)