| Title: | Convex Optimal Designs for Group Testing Experiments |
|---|---|
| Description: | Finite candidate-set approximate optimal designs for group testing and related experiments, using convex optimization and equivalence checks. Implements the information matrix and cost structure for the prevalence / sensitivity / specificity model used in Huang and colleagues (2020), as in Chi-Kuang Yeh, Weng Kee Wong, and Julie Zhou (<doi:10.48550/arXiv.2508.08445>). |
| Authors: | Chi-Kuang Yeh [aut, cre] (ORCID: <https://orcid.org/0000-0001-7057-2096>), Julie Zhou [aut], Weng Kee Wong [ctb] |
| Maintainer: | Chi-Kuang Yeh <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-05-10 06:38:29 UTC |
| Source: | https://github.com/chikuang/gtdesign |
A-optimal approximate design for group testing experiments
calc_Aopt(u, f, solver = "CLARABEL", ..., drop_tol = 1e-08)calc_Aopt(u, f, solver = "CLARABEL", ..., drop_tol = 1e-08)
u |
Candidate design points (e.g. pool sizes or coded pool layouts). |
f |
Function returning a numeric vector at one design point. |
solver |
Solver name passed to CVXR. Default is |
... |
Additional arguments passed to |
drop_tol |
Threshold for removing near-zero weights. |
An object of class "gt_a_design" and "gt_design".
c-optimal approximate design for group testing experiments
calc_copt(u, f, cVec, solver = "CLARABEL", ..., drop_tol = 1e-10)calc_copt(u, f, cVec, solver = "CLARABEL", ..., drop_tol = 1e-10)
u |
Candidate design points (e.g. pool sizes or coded pool layouts). |
f |
Function returning a numeric vector at one design point. |
cVec |
Numeric vector specifying the linear combination |
solver |
Solver name passed to CVXR. Default is |
... |
Additional arguments passed to |
drop_tol |
Threshold for removing near-zero weights. |
An object of class "gt_c_design" and "gt_design".
Directional derivatives on a finite candidate set
calc_directional_derivatives( u, M, f, criteria = c("D"), cVec = NULL, use_ginv = TRUE, eig_tol = NULL )calc_directional_derivatives( u, M, f, criteria = c("D"), cVec = NULL, use_ginv = TRUE, eig_tol = NULL )
u |
Candidate design points. |
M |
Information matrix. |
f |
Regression function returning a numeric vector. |
criteria |
Character vector of criteria, e.g. |
cVec |
Optional vector for c-optimality. |
use_ginv |
Logical; if |
eig_tol |
Tolerance for grouping eigenvalues with
|
A named list of directional derivative vectors.
Implements from Sec.\ 4 (Eq.\ (9)) of Yeh, Wong, and Zhou
(arXiv:2508.08445): with orthonormal spanning the
eigenspace of and multiplicity ,
uses (trace one, positive
semi-definite), so
When , this is for a unit eigenvector .
Computes a D-optimal approximate design on a finite candidate set. The
regression map f typically encodes contributions to the Fisher information
matrix (e.g. score vectors or square-root information); see
gt_huang2020_regressor() for the Huang et al.\ (2020) three-parameter model.
calc_Dopt( u, f, solver = "CLARABEL", ..., drop_tol = 1e-08, ridge = 1e-08, use_matrix_form = FALSE )calc_Dopt( u, f, solver = "CLARABEL", ..., drop_tol = 1e-08, ridge = 1e-08, use_matrix_form = FALSE )
u |
Candidate design points (e.g. pool sizes or coded pool layouts). |
f |
Function returning a numeric vector at one design point. |
solver |
Solver name passed to CVXR. Default is |
... |
Additional arguments passed to |
drop_tol |
Threshold for removing near-zero weights. |
ridge |
Small diagonal ridge for numerical stability in |
use_matrix_form |
If |
An object of class "gt_d_design" and "gt_design".
Minimizes over on a finite
candidate set via CVXR::Minimize(-CVXR::lambda_min(...)). The
reported objective is ,
matching MATLAB loss = -lambda_min(FIM) (e.g.\ calc_loss_E).
calc_Eopt(u, f, solver = "CLARABEL", ..., drop_tol = 1e-08, ridge = 1e-08)calc_Eopt(u, f, solver = "CLARABEL", ..., drop_tol = 1e-08, ridge = 1e-08)
u |
Candidate design points (e.g. pool sizes or coded pool layouts). |
f |
Function returning a numeric vector at one design point. |
solver |
Solver name passed to CVXR. Default is |
... |
Additional arguments passed to |
drop_tol |
Threshold for removing near-zero weights. |
ridge |
Small diagonal ridge for numerical stability in |
This matches compute_design_SO() with criterion = "E" (same scalar loss).
An object of class "gt_e_design" and "gt_design". Components
value and optval are the minimization objective
: value is recomputed at the cleaned
support, optval is the solver optimum of the minimize objective (they may
differ slightly after drop_tol).
# Huang et al. (2020) model on {1,...,61}, q = 0 (same setting as D-opt example) theta <- c(p0 = 0.07, p1 = 0.93, p2 = 0.96) u <- seq_len(61L) f <- gt_huang2020_regressor(theta, q = 0) res_E <- calc_Eopt(u, f, drop_tol = 1e-6) res_E$design res_E$value # = -lambda_min(M), same as -min(eigen(M)$values) -res_E$value # lambda_min(M) at the optimum res_E$status# Huang et al. (2020) model on {1,...,61}, q = 0 (same setting as D-opt example) theta <- c(p0 = 0.07, p1 = 0.93, p2 = 0.96) u <- seq_len(61L) f <- gt_huang2020_regressor(theta, q = 0) res_E <- calc_Eopt(u, f, drop_tol = 1e-6) res_E$design res_E$value # = -lambda_min(M), same as -min(eigen(M)$values) -res_E$value # lambda_min(M) at the optimum res_E$status
Solves for nonnegative weights in the maximin equivalence theorem. The
returned vector eta satisfies the normalization condition induced by the
derivative of the active right-hand sides and enforces a nonpositive weighted
combination of directional derivatives across the candidate set.
calc_eta_weights_maximin( tstar, loss_ref, loss_model, directional_derivatives, criteria, q, tol = 1e-06, complementary_slack = TRUE, fallback_no_slack = TRUE, complementary_tol_mult = 100, solver = "CLARABEL", solvers_fallback = c("SCS", "ECOS"), ... )calc_eta_weights_maximin( tstar, loss_ref, loss_model, directional_derivatives, criteria, q, tol = 1e-06, complementary_slack = TRUE, fallback_no_slack = TRUE, complementary_tol_mult = 100, solver = "CLARABEL", solvers_fallback = c("SCS", "ECOS"), ... )
tstar |
Optimal maximin scalar returned by |
loss_ref |
Named list of reference losses from single-objective designs. |
loss_model |
Named list of achieved losses at the maximin design. |
directional_derivatives |
Named list of directional derivative vectors,
such as |
criteria |
Character vector of criteria, e.g. |
q |
Parameter dimension. |
tol |
Numerical tolerance for the combined directional derivative and (if used) complementary slackness. |
complementary_slack |
Logical; if |
fallback_no_slack |
Logical; default |
complementary_tol_mult |
Positive multiplier applied to |
solver |
Solver passed to |
solvers_fallback |
Character vector of solvers to try if the first attempt fails (default includes SCS and ECOS, which often succeed when CLARABEL reports infeasible on small LPs). |
... |
Additional arguments passed to |
The linear program from Gao et al.\ also imposes approximate complementary
slackness |eta_k * gap_k| <= tol. With tight tol, that set can be
empty together with the normalization constraint (common with three or
more criteria). By default this function retries without complementary
slackness if the strict problem is infeasible, and cycles a few solvers
(works well with CVXR 1.8.x).
A named numeric vector of eta weights.
Weighted multi-objective directional derivative
calc_multi_directional_derivative(dd_list, eta)calc_multi_directional_derivative(dd_list, eta)
dd_list |
A named list of directional derivative vectors. |
eta |
A named numeric vector of weights. |
A numeric vector of combined directional derivative values.
Uses the same directional derivatives as calc_directional_derivatives()
with a single criterion. For maximin designs, use
check_equivalence_maximin().
check_equivalence(design_obj, f, u = NULL, tol = 1e-06, use_ginv = TRUE)check_equivalence(design_obj, f, u = NULL, tol = 1e-06, use_ginv = TRUE)
design_obj |
Output from |
f |
Regression function returning a numeric vector. |
u |
Candidate design points. If omitted, uses |
tol |
Numerical tolerance for checking nonpositivity and equality. |
use_ginv |
Passed to |
A list with directional derivative values and theorem checks.
Computes the weighted combined directional derivative
over the candidate set and checks whether it is
nonpositive, with approximate equality at the support points.
check_equivalence_maximin( design_obj, directional_derivatives, eta, tol = 1e-06 )check_equivalence_maximin( design_obj, directional_derivatives, eta, tol = 1e-06 )
design_obj |
Output from |
directional_derivatives |
Named list of directional derivative vectors,
such as |
eta |
Named numeric vector of eta weights, typically returned by
|
tol |
Numerical tolerance used in the checks. |
A list of class gt_equivalence_maximin.
Solves a convex optimization problem over a finite candidate set for one
criterion. The regression function f encodes rank-one contributions to the
(approximate) information matrix, as in nonlinear design or group testing
Fisher information assembled from pool outcomes.
compute_design_SO( u, f, criterion = c("D", "A", "Ds", "c", "E"), opts = list(), info_weight = NULL, solver = "CLARABEL", ..., support_tol = 1e-04, drop_tol = 1e-08 )compute_design_SO( u, f, criterion = c("D", "A", "Ds", "c", "E"), opts = list(), info_weight = NULL, solver = "CLARABEL", ..., support_tol = 1e-04, drop_tol = 1e-08 )
u |
Candidate design points. |
f |
A function returning the regression vector at a single design point. |
criterion |
One of |
opts |
Named list of extra options. For |
info_weight |
Optional function returning a nonnegative scalar multiplier for each rank-one information contribution. |
solver |
Solver passed to |
... |
Additional arguments passed to |
support_tol |
Weights smaller than this are dropped from the reported support. |
drop_tol |
Numerical tolerance for tiny solver noise before support cleanup. |
A list of class "gt_so_design" and "gt_design".
Joint convex formulation for maximizing the minimum efficiency across several criteria, using reference losses from single-objective designs. Suitable when multiple experimental goals (e.g. overall prevalence versus contrasts) must be balanced in group testing allocation.
compute_maximin_design( u, f, loss_ref, criteria, opts = list(), info_weight = NULL, solver = "CLARABEL", ..., support_tol = 1e-04, drop_tol = 1e-08 )compute_maximin_design( u, f, loss_ref, criteria, opts = list(), info_weight = NULL, solver = "CLARABEL", ..., support_tol = 1e-04, drop_tol = 1e-08 )
u |
Candidate design points. |
f |
A function returning the regression vector at a single design point. |
loss_ref |
Named list of reference losses from single-objective
designs, on the same scale as |
criteria |
Character vector containing any of |
opts |
Named list of extra options. For |
info_weight |
Optional function returning a nonnegative scalar multiplier for each rank-one information contribution. |
solver |
Solver passed to |
... |
Additional arguments passed to |
support_tol |
Weights smaller than this are dropped from the reported support. |
drop_tol |
Numerical tolerance for tiny solver noise before support cleanup. |
Link to Yeh, Wong, and Zhou (arXiv:2508.08445, Sec. 4.1). Let
be the information
matrix on the candidate set, and let be the
single-objective functionals in their eq. (4), with efficiencies
in eq. (5).
Eq. (6) — Maximin objective:
At the optimum, for the scalar
below (paper’s ).
Eq. (7) — Equivalent convex program (Gao et al., 2025):
where is for D, for A,
for c / Ds, and for E, as in the paper.
This function minimizes tstar ( in the paper).
Eq. (8) — Bounds on the right-hand side (with ):
Implemented constraints (same structure; build loss_ref from
calc_Dopt(), calc_Aopt(), calc_copt(), calc_Eopt()):
D:
with .
A: .
c / Ds: .
E:
with as from calc_Eopt().
Reference losses must match the paper’s -scale and the same conventions as
compute_design_SO() (internal scalar loss).
A list of class "gt_maximin_design" and "gt_design".
Yeh, C.-K., Wong, W. K., Zhou, J. (2025). Single and multi-objective optimal designs for group testing experiments. arXiv 2508.08445. Sec. 4.1, eq. (6)–(8).
Computes criterion-wise efficiencies as in eq. (5) of Yeh, Wong, and Zhou
(arXiv:2508.08445), and their minimum (MinEff in Table 4). Use after
round_gt_design_budget() with a maximin approximate design: pass
M_exact = out$M_exact, the same loss_ref as in compute_maximin_design(),
and the same criteria vector.
exact_design_efficiency_maximin( M_exact, loss_ref, criteria, opts = list(), p = nrow(M_exact) )exact_design_efficiency_maximin( M_exact, loss_ref, criteria, opts = list(), p = nrow(M_exact) )
M_exact |
Information matrix of the exact (rounded) design (e.g.
|
loss_ref |
Named list of reference losses from single-objective designs,
on the same scale as |
criteria |
Character vector of criteria (e.g. |
opts |
Optional list for contrasts ( |
p |
Parameter dimension; defaults to |
A list with efficiencies (named numeric vector) and
min_efficiency ().
with for assay cost and enrollment cost
. Value gives .
gt_huang2020_cost(x, q)gt_huang2020_cost(x, q)
x |
Pool size (positive integer). |
q |
Cost ratio in |
Scalar cost.
for the Huang et al. (2020) modelPartial derivatives of with respect to
as in arXiv:2508.08445 (Eq. below their Eq. (1)).
gt_huang2020_f(x, theta)gt_huang2020_f(x, theta)
x |
Pool size. |
theta |
|
Length-3 numeric vector.
in the information matrix (Huang et al. 2020)
gt_huang2020_lambda(x, theta, q)gt_huang2020_lambda(x, theta, q)
x |
Pool size. |
theta |
Same as for |
q |
Same as for |
Scalar (positive when is interior).
gt_huang2020_pi(x, theta)gt_huang2020_pi(x, theta)
x |
Pool size (positive integer). |
theta |
|
Scalar probability in (0, 1) when well-defined.
for convex design codeThe information matrix in Huang et al. (2020) is
.
The same matrix equals with
, which matches the
regression form used by calc_Dopt() and check_equivalence() without an
info_weight argument.
gt_huang2020_regressor(theta, q = 0)gt_huang2020_regressor(theta, q = 0)
theta |
Nominal |
q |
Cost ratio in |
A function function(x) returning a length-3 vector.
Yeh, C.-K., Wong, W. K., and Zhou, J. (2025). Single and multi-objective optimal designs for group testing experiments. arXiv:2508.08445.
Huang, S.-Y., Chen, Y.-H., and Wang, W. (2020). Optimal group testing designs for estimating prevalence with imperfect tests. Journal of the Royal Statistical Society Series C.
Runs the usual multi-step maximin pipeline: single-objective designs to build
loss_ref, compute_maximin_design(), calc_directional_derivatives(),
calc_eta_weights_maximin(), and optionally check_equivalence_maximin().
maximin_design_workflow( u, f, criteria, opts = list(), drop_tol = 1e-06, q = NULL, tol_eta = 0.001, tol_equiv = 0.002, check_equiv = TRUE, keep_reference_designs = FALSE, info_weight = NULL, solver = "CLARABEL", eta_args = list(), deriv_args = list(), make_figure = FALSE, plot_args = list(), ... )maximin_design_workflow( u, f, criteria, opts = list(), drop_tol = 1e-06, q = NULL, tol_eta = 0.001, tol_equiv = 0.002, check_equiv = TRUE, keep_reference_designs = FALSE, info_weight = NULL, solver = "CLARABEL", eta_args = list(), deriv_args = list(), make_figure = FALSE, plot_args = list(), ... )
u |
Candidate design points. |
f |
Regression function (same as in single-objective and maximin calls). |
criteria |
Character vector of criteria, subset of |
opts |
Named list passed to contrast-based criteria; use |
drop_tol |
Passed to |
q |
Parameter dimension for |
tol_eta |
Tolerance passed to |
tol_equiv |
Tolerance for |
check_equiv |
If |
keep_reference_designs |
If |
info_weight |
Passed to |
solver |
Passed to all convex solves in this pipeline. |
eta_args |
Named list of extra arguments for |
deriv_args |
Named list of extra arguments for |
make_figure |
If |
plot_args |
Named list of extra arguments for |
... |
Additional arguments passed to |
Only criteria D, A, and c are supported end-to-end (directional
derivatives for Ds / E are not wired here). For c, supply
opts = list(cVec_c = ...) as in compute_maximin_design().
A list with components: loss_ref, maximin (output of
compute_maximin_design()), directional_derivatives, eta,
equivalence (or NULL if check_equiv is FALSE), q, and optionally
reference_designs. Plotting is a side effect when make_figure is TRUE.
Plot equivalence theorem directional derivative
plot_equivalence( eq_obj, main = NULL, xlab = "Design point", ylab = "Directional derivative", pch_support = 19, ... )plot_equivalence( eq_obj, main = NULL, xlab = "Design point", ylab = "Directional derivative", pch_support = 19, ... )
eq_obj |
Output from |
main |
Plot title. |
xlab |
X-axis label. |
ylab |
Y-axis label. |
pch_support |
Plotting symbol for support points. |
... |
Passed to |
Invisibly returns eq_obj.
Plot equivalence diagnostics for a maximin design
plot_equivalence_maximin( design_obj, directional_derivatives, eta, criteria = NULL, main_prefix = NULL, line_width = 2, show_support = TRUE, tol = 1e-06, cex_lab = 1.2, cex_axis = 1, cex_main = 1.1, mar = c(5, 6.5, 3, 1) )plot_equivalence_maximin( design_obj, directional_derivatives, eta, criteria = NULL, main_prefix = NULL, line_width = 2, show_support = TRUE, tol = 1e-06, cex_lab = 1.2, cex_axis = 1, cex_main = 1.1, mar = c(5, 6.5, 3, 1) )
design_obj |
Output from |
directional_derivatives |
Named list of directional derivative vectors. |
eta |
Named numeric vector of eta weights. |
criteria |
Character vector of criteria to display. |
main_prefix |
Optional prefix for panel titles. |
line_width |
Line width for curves. |
show_support |
Logical; if |
tol |
Numerical tolerance used for the horizontal reference line. |
cex_lab, cex_axis, cex_main, mar
|
Graphics parameters. |
Invisibly returns the object produced by check_equivalence_maximin().
Implements the floor allocation, zero-fix, extended-support search, and
best-merge steps in Sec. 5.1 of Yeh, Wong, and Zhou (arXiv:2508.08445), as
in the reference MATLAB scripts GT_Single_budget.m /
calc_budget_round_combinations.m.
round_gt_design_budget( approx_design, u, theta, C, q_cost, criterion = c("D", "A", "c", "Ds", "E"), opts = list(), n_index = 2L, fix_zero_floor = TRUE, repair_floor_budget = TRUE, ... )round_gt_design_budget( approx_design, u, theta, C, q_cost, criterion = c("D", "A", "c", "Ds", "E"), opts = list(), n_index = 2L, fix_zero_floor = TRUE, repair_floor_budget = TRUE, ... )
approx_design |
Output of |
u |
Integer candidate pool sizes (same grid as used for |
theta |
Nominal |
C |
Total cost budget (sum of run costs |
q_cost |
Cost ratio |
criterion |
One of |
opts |
Contrast options: |
n_index |
Half-width of the extended support window ( |
fix_zero_floor |
If |
repair_floor_budget |
If |
... |
Reserved. |
A list with design_round1 (2-row matrix: pool sizes, floor counts;
columns with zero runs are removed; no column names),
design_exact (same format after merge),
delta (2-row matrix: pool sizes x and Delta_n ; only pool sizes with nonzero change are columns),
M_approx,
M_exact, efficiency, loss_approx, loss_exact, C_remaining after
the floor step (with default repair_floor_budget, total cost is at most
C):
(never negative), extension_table (tibble::tibble() of tight extensions;
first columns named by extended-support pool sizes, then
used_cost, remaining, loss when present), and
criterion.
Applies cost-aware floor rounding, then modified Step II search over nearby
support points ( n_index) and selects the extension with the
largest minimum efficiency (MinEff) across criteria.
round_gt_design_budget_maximin( approx_design, u, theta, C, q_cost, loss_ref, criteria, opts = list(), n_index = 2L, fix_zero_floor = TRUE, repair_floor_budget = TRUE, ... )round_gt_design_budget_maximin( approx_design, u, theta, C, q_cost, loss_ref, criteria, opts = list(), n_index = 2L, fix_zero_floor = TRUE, repair_floor_budget = TRUE, ... )
approx_design |
A maximin/approximate design object with component
|
u |
Integer candidate pool sizes (same grid as used for
|
theta |
Nominal |
C |
Total cost budget (sum of run costs |
q_cost |
Cost ratio |
loss_ref |
Named list of reference losses from single-objective designs
(same scale as |
criteria |
Character vector of criteria to evaluate MinEff, e.g.
|
opts |
Contrast options: |
n_index |
Half-width of extension window around each support point. |
fix_zero_floor |
If |
repair_floor_budget |
If |
... |
Reserved. |
A list with design_round1, design_exact, delta, M_round1,
M_exact, efficiencies, min_efficiency, C_remaining after floor,
and extension_table (tibble sorted by decreasing min_efficiency).
Rounds a maximin approximate design to an exact design with total run size
n, then applies the modified Step II search over nearby support points
( n_index) and selects the extension with the largest
minimum efficiency (MinEff) across criteria.
round_gt_design_n_maximin( approx_design, u, theta, n, q_cost, loss_ref, criteria, opts = list(), n_index = 2L, ... )round_gt_design_n_maximin( approx_design, u, theta, n, q_cost, loss_ref, criteria, opts = list(), n_index = 2L, ... )
approx_design |
A maximin/approximate design object with component
|
u |
Integer candidate pool sizes (same grid as used for
|
theta |
Nominal |
n |
Total run size (fixed sample size). |
q_cost |
Cost ratio |
loss_ref |
Named list of reference losses from single-objective designs
(same scale as |
criteria |
Character vector of criteria to evaluate MinEff, e.g.
|
opts |
Contrast options: |
n_index |
Half-width of extension window around each support point. |
... |
Reserved. |
A list with design_round1, design_exact, delta,
M_round1, M_exact, efficiencies (named vector), min_efficiency,
and extension_table (tibble sorted by decreasing min_efficiency).
Converts a subject cap (n_subject_allow) into a test budget
C_tests = floor(n_subject_allow / sum(w_i x_i)) using the approximate
design, runs round_gt_design_budget(), then selects the best rounded
extension under the subject-count constraint.
round_gt_design_subject_budget( approx_design, u, theta, n_subject_allow, q_cost, criterion = c("D", "A", "c", "Ds", "E"), opts = list(), n_index = 2L, fix_zero_floor = TRUE, repair_floor_budget = TRUE, ... )round_gt_design_subject_budget( approx_design, u, theta, n_subject_allow, q_cost, criterion = c("D", "A", "c", "Ds", "E"), opts = list(), n_index = 2L, fix_zero_floor = TRUE, repair_floor_budget = TRUE, ... )
approx_design |
Output of |
u |
Integer candidate pool sizes. |
theta |
Nominal |
n_subject_allow |
Subject-count cap. |
q_cost |
Cost ratio |
criterion |
One of |
opts |
Contrast options: |
n_index |
Half-width of extension window. |
fix_zero_floor |
Passed to |
repair_floor_budget |
Passed to |
... |
Reserved. |
Selection rule follows the application script logic:
among feasible candidates (subjects <= n_subject_allow), prefer using
more subjects (closest to the cap), then smaller loss. If none are feasible,
pick the minimum-excess candidate.
A list with C_tests, n_subject_allow,
n_subjects_used, design_round1, design_exact,
delta, M_approx, M_exact, loss_approx,
loss_exact, efficiency, criterion, and
extension_table.
All nonnegative integer vectors with ,
then restricted to tight rows where remaining budget is insufficient for
any additional unit at minimum cost (Step II in Rounding Algorithm II,
arXiv:2508.08445, Sec. 5.1).
rounding_budget_combinations(cxx, Cr)rounding_budget_combinations(cxx, Cr)
cxx |
Per-unit costs |
Cr |
Remaining budget after floor allocation. |
Matrix whose first length(cxx) columns are counts, then used cost,
then remaining budget. Sorted like the MATLAB reference implementation.
All vectors with ,
max_run_size, matching the supplementary Rounding Algorithm I search
(arXiv:2508.08445, Sec. 5.1).
rounding_run_size_combinations(n_items, max_run_size)rounding_run_size_combinations(n_items, max_run_size)
n_items |
Number of locations (columns). |
max_run_size |
Upper bound on |
Numeric matrix with columns , then total count,
then remaining slots (max_run_size - total), sorted lexicographically
with the last coordinate changing fastest (MATLAB sortrows order).