Package {caverify}


Type: Package
Title: Fast Strength-t Coverage Verification for Covering Arrays
Version: 0.1.3
Description: Verifies that an array covers every t-way interaction, the certificate check for covering arrays, using compiled C code with optional 'OpenMP' threading. Missing values are treated as wildcard ("flexible") entries that count as every symbol. Designed to be easy to embed in other packages: a single C file with a registered .Call entry point and one R wrapper.
License: MIT + file LICENSE
URL: https://github.com/chrispbsmolen/ca-tools
BugReports: https://github.com/chrispbsmolen/ca-tools/issues
Encoding: UTF-8
Language: en-US
Imports: parallel
NeedsCompilation: yes
Packaged: 2026-08-23 06:53:46 UTC; axviam
Author: Christopher Smolen [aut, cre]
Maintainer: Christopher Smolen <chrispbsmolen@gmail.com>
Repository: CRAN
Date/Publication: 2026-08-23 10:10:18 UTC

Verify strength-t coverage of a covering array

Description

Checks that an N \times k array over v symbols covers every t-way interaction: for every choice of t columns and every one of the v^t value combinations, at least one row exhibits that combination. This is the certificate check for a covering array, run in compiled C at speeds suitable for large arrays and strengths.

Usage

ca_verify(x, t, v = NULL, threads = NULL, report = 10L)

Arguments

x

an integer matrix or data frame of integers; rows are runs, columns are factors. NA entries are wildcards ("flexible values") and count as every symbol.

t

interaction strength to verify (positive integer).

v

number of symbols per column; if NULL, inferred from the data range. Symbols may be coded 0..v-1 or 1..v; 1-based input is detected and shifted automatically.

threads

number of threads. NULL (the default) picks automatically: half the machine's logical cores, single-threaded for small jobs, capped during CRAN checks. Override with options(caverify.threads = n) or this argument. Long runs are interruptible without aborting R.

report

maximum number of missing-tuple examples to collect.

Value

An object of class ca_verify: a list with covered (logical), colsets, gaps, missing_tuples, examples (matrix; first t entries per row are 1-based column indices, the rest the missing value combination in the input coding), and t, v, N, k.

Examples

ca <- rbind(c(0,0,0), c(0,1,1), c(1,0,1), c(1,1,0))
ca_verify(ca, t = 2)          # a covering array of strength 2
ca_verify(ca[-1, ], t = 2)    # removing a run breaks coverage