easylocal::cost
Types
| Name | Description |
|---|---|
apply_expression | The node of cost::apply: a user function of its children's costs. |
approximately_expression | The node of cost::approximately: the cost of its child, compared within a tolerance. |
hard_soft_expression | The node of cost::hard_soft: a cost::hierarchical of a hard and a soft 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). |
in_order_expression | The node of cost::in_order: a cost::lexicographic of its children's costs. |
is_expression | Whether T is a node of a cost expression (sum, in_order, objectives, hard_soft, apply or approximately). |
lexicographic | A lexicographic cost: its values are compared in the order given, a later one only when the earlier ones are equal. |
objectives_expression | The node of cost::objectives: a cost::pareto of its children's costs. |
pareto | A multi-objective cost, every objective minimized, ordered by Pareto dominance. |
sum_expression | The node of cost::sum: the weighted sum of the costs of its terms. |
tolerance | The tolerance of an approximate comparison of costs; called on two values, whether they are approximately equal (see approximately_equal). |
weighted_term | A term of a cost::sum: an expression and its weight. |
zero_cost | The zero of a cost type: no violation, no penalty. |
Functions
| Name | Description |
|---|---|
apply | The value of function called with the children's costs. |
apply | The value of a Function built from parameters, called with the children's costs: cost::apply<Excess>({.bound = 8.0}, component<C>()). |
approximate_compare | The order of two costs, with floating-point values that are equal within within taken as equivalent. |
approximately | The cost of child, which the search compares within within: costs equal within it are equivalent, and a cost is better only by more than it (see cost::approximate_compare). |
approximately_equal | Whether two values are equal within within: numbers when either is floating point (integers exactly), lexicographic, hierarchical and pareto costs level by level, other values with ==. |
better | Whether candidate is better than reference. |
better_or_equivalent | Whether candidate is better than or equivalent to reference. |
delta | The numeric difference candidate - current of two arithmetic costs. |
delta | Hard-preserving numeric delta: minus infinity when the hard cost improves, infinity when it worsens, the soft delta otherwise. |
equivalent | Whether lhs and rhs are equivalent costs. |
from_text | The cost written by text: throws std::invalid_argument, with the reason, when the text does not describe a value of the type. |
hard_soft | A cost::hierarchical of the costs of hard and soft. |
in_order | A cost::lexicographic of the children's costs, compared in the order given. |
objectives | A cost::pareto of the costs of two or more children, compared by Pareto dominance. |
operator* | child * weight is cost::weighted(child, weight). |
operator* | weight * child is cost::weighted(child, weight). |
operator- | delta(candidate, current), when the soft cost has a delta. |
scalar | The cost as one number: a number as it is, a hierarchical cost as hard * weight + soft, a lexicographic cost of n values as the sum of each value times weight to the power of the number of values after it. |
sum | The weighted sum of the costs of its terms, which must be arithmetic. |
to_text | A cost in the text from_text reads back: numbers in their shortest exact form, [hard, soft]and [v1, v2, ...]for structured costs. |
weighted | The term child of a cost::sum with weight weight. |
zero | The zero of a cost type, zero_cost<Cost>::value(): no violation, no penalty. |
operator== | Whether every objective is equal. |
operator== | Whether the hard and the soft costs are equal. |
operator<=> | less: lhs dominates rhs; greater: rhs dominates lhs; equivalent: equal in every objective; unordered otherwise. |
operator<=> | The order of the costs: by the hard costs, then by the soft costs; each branch compares with its <=>, or else with its <. |
Variables
| Name | Description |
|---|---|
is_expression_v | Whether T, without cv and reference qualifiers, is a node of a cost expression. |
Concepts
| Name | Description |
|---|---|
approximately_comparable | A cost that approximate_compare orders: a number, a lexicographic, hierarchical or pareto cost of such costs, or a type with <=> or <. |
approximately_equality_comparable | Values that approximately_equal compares: two numbers, two lexicographic, hierarchical or pareto costs of the same type, or values with ==. |
arithmetic | An arithmetic cost: a signed integral or floating-point type other than bool. |
has_better | A SolutionManager whose costs have a better relation: defined by the compare of the root of its cost expression, or the cost type's <. |
has_better_or_equivalent | A SolutionManager whose costs have a better_or_equivalent relation: defined by the compare of the root of its cost expression, or the cost type's <=. |
has_delta | A cost type with a numeric difference: delta(candidate, current), convertible to long double. |
has_equivalent | A SolutionManager whose costs have an equivalent relation: defined by the compare of the root of its cost expression, or the cost type's ==. |
has_zero | A cost type with a zero: zero_cost<Cost> has a static value(). |
hierarchical_cost | A cost::hierarchical, possibly cv- or reference-qualified. |
lexicographic_cost | A cost::lexicographic, possibly cv- or reference-qualified. |
pareto_cost | A cost::pareto, possibly cv- or reference-qualified. |
scalar_convertible | Costs that cost::scalar turns into one number: numbers, and hierarchical and lexicographic costs of them. |
text_readable | Costs that from_text reads: arithmetic ones, and hierarchical, lexicographic and pareto costs of them. |