allsubhypercubes {magic}R Documentation

Subhypercubes of magic hypercubes

Description

Extracts all subhypercubes from an n-dimensional hypercube.

Usage

allsubhypercubes(a)

Arguments

a The magic hypercube whose subhypercubes are computed

Value

Returns a list, each element of which is a subhypercube. Note that major diagonals are also returned (as n-by-1 arrays).

Note

This function is a dog's dinner. It's complicated, convoluted, and needs two absurd uses of the eval(parse(text=...)) construction. Basically it sucks big time.

BUT... I cannot for the life of me see a better way that gives the same results, without loops, on hypercubes of arbitrary dimension.

The function cannot cope with d as high as 5, for n=4. Heigh ho.

Author(s)

Robin K. S. Hankin

See Also

is.perfect

Examples

  library(abind)
  a <- magichypercube.4n(1,d=4)
  allsubhypercubes(a)

[Package Contents]