Internal helper used by symmetrise(), split_matrix() and
per_capita() to align a user-supplied survey_pop data frame with the
participant strata of a contact matrix. The user provides one column per
grouping (named after the grouping) plus population; the helper joins
onto the canonical tuple ordering (column-major over the participant axes,
matching matrix()'s reshape) and returns the population in that order.
Works for any number of groupings, including single-grouping (age-only)
matrices.
joint_population_vector(survey_pop, matrix, groupings)a numeric vector of length T = prod(participant dim sizes)
in canonical (column-major) tuple order
a data frame with one column named after each grouping
of matrix plus a population column
the rank-2K contact matrix
the list of grouping triples stored on the
contact_matrix object