circulant {magic}R Documentation

Circulant matrices of any order

Description

Circulant matrices of any order

Usage

circulant(n, vec=1:n)
is.circulant(m)

Arguments

n Order of circulant matrix
vec Vector of elements of the first row, defaulting to 1:n.
m Matrix to be tested for circulantism

Details

A matrix a is circulant if all (major) diagonals are uniform, ie if a[i,j]==a[k,j] when i-j=k-l (modulo n). The standard values to use give 1:n for the top row.

Author(s)

Robin K. S. Hankin

References

Arthur T. Benjamin and K. Yasuda. Magic “Squares” Indeed!, American Mathematical Monthly, vol 106(2), pp152-156, Feb 1999

Examples

circulant(5)
circulant(5,vec=2^(0:4))
is.circulant(circulant(5))

[Package magic version 1.3-12 Index]