NetOptim 1.2.8
Loading...
Searching...
No Matches
netoptim_detail Namespace Reference

Classes

struct  timing_edge
 Edge for the clock-skew scheduling oracle: delay and type. More...
struct  graph_traits
 Type trait deriving Node / Edge / Cycle from any supported graph container. More...
class  Ratio
 Adapter: evaluates the scaling-ratio constraint for one edge. More...

Concepts

concept  HasKeyType
concept  OracleFeas
 Feasibility oracle: assess x and produce a cutting plane if infeasible.
concept  OracleOptim
 Optimality oracle: assess x against a best-so-far value g.
concept  HasMakeWeightFn
 Detect an optional make_weight_fn(x) fast path on an edge oracle.

Functions

template<typename Graph, typename T, typename Fn1, typename Fn2, typename Mapping>
auto parametric_search (const Graph &gra, T &r_opt, Fn1 &&distrance, Fn2 &&zero_cancel, Mapping &&dist, size_t max_iters)
 Template Method: parametric max-problem search skeleton.
template<typename Fn, typename Edge, typename Arr>
auto make_get_weight (Fn &fn, const Arr &xval)
 Build the per-edge weight callable used by Howard's method.

Function Documentation

◆ make_get_weight()

template<typename Fn, typename Edge, typename Arr>
auto netoptim_detail::make_get_weight ( Fn & fn,
const Arr & xval )

Build the per-edge weight callable used by Howard's method.

Uses fn.make_weight_fn(x) when the oracle provides it; otherwise returns a lambda forwarding to fn.eval(edge, x).

Template Parameters
Fnedge-oracle type
Edgegraph edge type
Arriterate / point type
Parameters
[in]fnedge oracle
[in]xvalcurrent iterate
Returns
callable (const Edge&) -> double

◆ parametric_search()

template<typename Graph, typename T, typename Fn1, typename Fn2, typename Mapping>
auto netoptim_detail::parametric_search ( const Graph & gra,
T & r_opt,
Fn1 && distrance,
Fn2 && zero_cancel,
Mapping && dist,
size_t max_iters )

Template Method: parametric max-problem search skeleton.

The iteration structure is fixed here; the distance function and the zero-canceling function are injected as strategies. Returns the critical cycle that determines the optimal parameter (empty if none).

Template Parameters
Graphdirected graph type
Tnumeric type for the parameter r
Fn1distance callable (parameter, edge) -> weight
Fn2zero-canceling callable (cycle) -> parameter
Mappingdistance mapping (vertex -> distance)
Parameters
[in]gradirected graph containing the network structure
[in,out]r_optparameter to be maximized, updated with optimal value
[in]distrancemonotone decreasing function of parameter r
[in]zero_cancelfunction to compute new parameter from cycle
[in,out]distdistance mapping used in the algorithm
[in]max_itersmaximum number of iterations (default: 1000)
Returns
Cycle the critical cycle that determines the optimal parameter