EasyLocalAPI reference iolab-uniud/easylocal

easylocal::cost::hierarchical

A hierarchical cost: the hard cost has strict priority, the soft cost is compared only when the hard costs are equivalent (neither is less).

Synopsis

Declared in <easylocal/cost/hierarchical.hpp>

template<
    class HardCost,
    class SoftCost>
class hierarchical;

Description

Each branch may itself be scalar or structured. Its delta never accepts a hard degradation: minus infinity when the hard cost improves, plus infinity when it worsens, the soft delta otherwise.

Type Aliases

NameDescription
hard_cost_type The type of the hard cost.
soft_cost_type The type of the soft cost.

Member Functions

NameDescription
hierarchical [constructor]From its hard and soft costs.
hard The hard cost.
soft The soft cost.

Friends

NameDescription
easylocal::cost::operator-delta(candidate, current), when the soft cost has a delta.
easylocal::cost::operator==Whether the hard and the soft costs are equal.
easylocal::cost::operator<=>The order of the costs: by the hard costs, then by the soft costs; each branch compares with its <=>, or else with its <.

Non-Member Functions

NameDescription
deltaHard-preserving numeric delta: minus infinity when the hard cost improves, infinity when it worsens, the soft delta otherwise.