Certificate, Potentials and Unmatched Units of a Result
Source:R/result_methods.R
result_accessors.RdAccessors 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()orassignment_duals(); forglance(), a certificate fromverify_assignment()orverify_flow().- ...
Ignored.
Details
certificate()returns the checked optimality certificate, anassignment_certificateorflow_certificate(seeverify_assignment()), orNULLwhen none was computed. A matching carries one when it was solved withcertify = TRUEor in implicit mode. Cardinality matching returns acardinality_certificaterecording 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 elementsleftandright(named by unit id) for a matching, oruandvfor an assignment of a cost matrix;NULLwhen the solver returned none.unmatched_units()returns the ids of the unmatched units as a list with elementsleftandright, 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.
Examples
set.seed(1)
cost <- matrix(runif(16), 4)
res <- assignment_duals(cost)
potentials(res)
certificate(assignment(cost, certify = TRUE))