circulant {magic} | R Documentation |
Circulant matrices of any order
circulant(n, vec=1:n) is.circulant(m)
n |
Order of circulant matrix |
vec |
Vector of elements of the first row, defaulting to
1:n . |
m |
Matrix to be tested for circulantism |
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.
Robin K. S. Hankin
Arthur T. Benjamin and K. Yasuda. Magic “Squares” Indeed!, American Mathematical Monthly, vol 106(2), pp152-156, Feb 1999
circulant(5) circulant(5,vec=2^(0:4)) is.circulant(circulant(5))