recursiveBose: function to create a strength 2 CA based on recursive...

View source: R/recursiveBose.R

recBoseCAR Documentation

function to create a strength 2 CA based on recursive multiplication of Bose CAs

Description

recBoseCA applies productCA or productPCA recursively to Bose CAs. The number of levels must be a prime or prime power.

Usage

recBoseCA(t=2, k=NULL, v=4, type="PCA", ...)

recursiveBose(q, d=NULL, k=NULL, type="PCA", ...)

N_k_recursiveBose(q, d=2, type="PCA", ...)

N_d_recursiveBose(q, k, type="PCA", ...)

Dd(d, q)

kd(d, q)

Arguments

t

the requested strength; must be 2

k

NULL, or the number of columns;
if NULL, the maximum possible number for d is returned (with d defaulting to 2, if not specified).

v

the same as q

type

"CA" or "PCA", indicating whether productCA or productPCA should be used for the product

...

currently not used

q

a prime or prime power number of levels

d

NULL, or a small positive integer;
d=1 returns SCA_Bose(q) (q^2 x (q+1)), d > 1 the product (productCA or productPCA, depending on type) of d SCA_Bose(q);
For d=NULL, the minimum d for accommodating k is used.
If k is also NULL, the default is d=2.

Value

recBoseCA returns a uniform CA strength 2 CA with k v level columns (matrix of class ca); its rowsize can be determined a-priori with function N_recBoseCA.
recursiveBose returns a uniform strength 2 CA with q level columns.
For type="PCA" (default), the result has d*q^2 - (d-1)*q rows and q^d + d*q^(d-1) columns, levels are coded from 0 to q - 1.
For type="CA", the result has d*q^2 - (d-1)*2 rows (upper bound, may be slightly smaller depending on constant rows) and (q+1)^d columns, levels are coded from 0 to q - 1.
N_k_recursiveBose returns a named vector with the number of rows and the number of columns k for given q and d.
N_d_recursiveBose returns a named vector with the run size N, the d for its creation for the requested number of columns k, and the maximum possible number of columns kmax for that construction.

Details

The function recBoseCA uses function recursiveBose, which in turn uses SCA_Bose for creating the q^2 x (q+1) ingredient matrix, and either function productPCA or productCA for obtaining the recursive product (depending on the choice for argument type).

type=PCA: For a given v, the function can construct up to kd(d,v) columns in d*v^2-(d-1)*v runs, where d is the number of Bose CAs that are combined, and k(d,v) has been determined by experimentation; for d=2,3, k(d,v) coincides with the value stated in Colbourn et al. (2006) Lemma 3.5, which uses a recursively defined Dd(0,v)=0, Dd(1,v)=1, Dd(d+1,v)=v*(Dd(d,v) + Dd(d-1,v)) to yield k=(v+1)*Dd(d,v) + v*Dd(d-1,v). Different from the construction underlying Lemma 3.5 of Colbourn et al. (2006), this function improves the size of the left-hand side partition in each interim step; this is achieved by applying function CA_to_PCA after moving the first block of v rows Experimentation showed that this choice yielded the overall optimum result among blocks of v rows in all cases that were investigated.

For type=="CA": For a given v, the function can construct up to (v+1)^d columns in up to d*v^2-(d-1)*2 runs (type=="CA"), where d is the number of Bose CAs that are combined.

References

Colbourn et al. (2006)

Examples

D <- recBoseCA(k=12)   ## v=4 is the default, and type="PCA"
dim(D)
coverage(D,2)
eCAN(2, 12, 4)
Ns(2, 12, 4) ## the optimum CA is available

D <- recBoseCA(k=25)   ## v=4 is the default, and type="PCA"
dim(D)
coverage(D,2)
eCAN(2, 25, 4)
Ns(2, 25, 4) ## the optimum CA is available
## type="CA" gets close to optimal here
## because k=25 makes it still work with d=2 SCA_Bose
D <- recBoseCA(k=25, type="CA")
dim(D)

dim(D <- recursiveBose(3))
eCAN(2,15,3)  ## optimal
dim(recursiveBose(3, d=3))
eCAN(2,57,3)  ## reasonably close to optimal
dim(recursiveBose(3, d=3, type="CA"))
eCAN(2,64,3)  ## reasonably close to optimal

## query functions
N_k_recursiveBose(4)      ## d=2
N_k_recursiveBose(4, 3)   ## d=3
kd(3,4)   ## work horse function for k for default type PCA
N_k_recursiveBose(4, 3, type="CA")
N_d_recursiveBose(4, 12)  ## k=12


CAs documentation built on Nov. 29, 2026, 1:06 a.m.