Opened 6 years ago

#12700 new Bugs

Returned type mess with find_flow_cost

Reported by: Dmitrii Marin <dmitry.marin@…> Owned by: Jeremiah Willcock
Milestone: To Be Determined Component: graph
Version: Boost 1.62.0 Severity: Problem
Keywords: Cc:

Description

There are several overloads for find_flow_cost in find_flow_cost.hpp. However they differ by the return type. For example find_flow_cost(const Graph &g) returns edge capacity type while others return weight type. As a result the true flow cost can be lost due to type conversions, e.g. casting double (weight type) to int (capacity type).

It should be determined which type to return (weight or capacity type). I think there should be a process determining which type is the best. Something like decltype(weight_t(0)*capacity_t(0))

Change History (0)

Note: See TracTickets for help on using tickets.