56 if (!usingExternFlow) {
65 : m_et(nullptr), m_flow(nullptr), m_G(nullptr), m_s(nullptr), m_t(nullptr) { }
74 : m_s(nullptr), m_t(nullptr)
102 usingExternFlow =
true;
105 usingExternFlow =
false;
159 if ((*m_cap)[e] < 0) {
void useEpsilonTest(const double &eps)
Change the used EpsilonTest from StandardEpsilonTest to a user given EpsilonTest. ...
Data type for general directed graphs (adjacency list representation).
virtual void init(const Graph &graph, EdgeArray< T > *flow=nullptr)
Initialize the problem with a graph and optional flow array. If no flow array is given, a new ("internal") array will be created. If a flow array is given, the algorithm uses this "external" array.
const node * m_t
Pointer to the sink node.
EpsilonTest * m_et
Pointer to the used EpsilonTest.
virtual void computeFlowAfterValue()=0
Compute the flow itself after the flow value is already computed. Only used in algorithms with 2 phas...
Dynamic arrays indexed with edges.
T computeFlow(EdgeArray< T > &cap, node &s, node &t, EdgeArray< T > &flow)
Only a shortcut for computeValue and computeFlowAfterValue.
const Graph * m_G
Pointer to the given graph.
Compare floating point numbers with epsilons and integral numbers with normal compare operators...
virtual ~MaxFlowModule()
Destructor that deletes m_flow if it is an internal flow array.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
const node * m_s
Pointer to the source node.
void computeFlowAfterValue(EdgeArray< T > &flow)
Compute the flow itself after the flow value is already computed. Only used in algorithms with 2 phas...
EdgeArray< T > * m_flow
Pointer to (extern) flow array.
Class for the representation of edges.
bool doingAReInit
Is the next "init" call a re-init?
Class for the representation of nodes.
bool isFeasibleInstance() const
Return whether the instance is feasible, i.e. the capacities are non-negative.
MaxFlowModule()
Empty Constructor.
Includes declaration of graph class.
virtual T computeValue(const EdgeArray< T > &cap, const node &s, const node &t)=0
Compute only the value of the flow.
bool usingExternFlow
Is an extern flow array given in the constructor?
The namespace for all OGDF objects.
const EdgeArray< T > * m_cap
Pointer to the given capacity array.
MaxFlowModule(const Graph &graph, EdgeArray< T > *flow=nullptr)
Constructor that calls init.