result_accessors: Certificate, Potentials and Unmatched Units of a Result

result_accessorsR Documentation

Certificate, Potentials and Unmatched Units of a Result

Description

Accessors for the parts of a matching or assignment result that later analyses read.

Usage

certificate(x, ...)

potentials(x, ...)

unmatched_units(x, ...)

## S3 method for class 'cardinality_certificate'
print(x, ...)

## S3 method for class 'cardinality_certificate'
summary(object, ...)

## S3 method for class 'cardinality_certificate'
glance(x, ...)

## S3 method for class 'assignment_certificate'
glance(x, ...)

## S3 method for class 'flow_certificate'
glance(x, ...)

Arguments

x, object

A result of match_couples(), full_match(), cardinality_match(), cem_match(), subclass_match(), match_path(), assignment() or assignment_duals(); for glance(), a certificate from verify_assignment() or verify_flow().

...

Ignored.

Details

  • certificate() returns the checked optimality certificate, an assignment_certificate or flow_certificate (see verify_assignment()), or NULL when none was computed. A matching carries one when it was solved with certify = TRUE or in implicit mode. Cardinality matching returns a cardinality_certificate recording its completed search and checked bounds. Its summary exposes the size, balance, and distance stages and the constraint report.

  • potentials() returns the dual potentials as a list with elements left and right (named by unit id) for a matching, or u and v for an assignment of a cost matrix; NULL when the solver returned none and no certificate was computed. A certified solve by a solver without potentials carries the ones its certificate was checked against. The values are double precision numbers. An exact certificate that reads ⁠recovered potentials⁠ was decided on potentials that doubles cannot hold; the certificate returns them as exact_u and exact_v (see verify_assignment()), and the doubles of potentials() then meet the conditions to rounding.

  • unmatched_units() returns the ids of the unmatched units as a list with elements left and right, or the unmatched row indices of an assignment.

glance() on a certificate returns one row with certified, arithmetic, primal_objective, dual_objective, duality_gap and, for an assignment certificate, max_suboptimality.

Value

See Details.

Examples

set.seed(1)
cost <- matrix(runif(16), 4)
res <- assignment_duals(cost)
potentials(res)
certificate(assignment(cost, certify = TRUE))


couplr documentation built on Nov. 26, 2026, 9:07 a.m.