circulant(vec)
is.circulant(m,dir=rep(1,length(dim(m))))
circulant()
, vector of elements of the first
row. If of length one, interpret as the order of the matrix
and use 1:vec
.is.circulant()
, matrix to be tested for
circulantismis.circulant()
, the direction of the diagonal.
In a matrix, the default value (c(1,1)
) traces the major
diagonals.1:n
for the top row. In the case of arbitrary dimensional arrays, giving the default value
for dir
checks that
a[v]==a[v+rep(1,d)]==...=a[v+rep((n-1),d)]
for all
v
(that is, following lines parallel to the major diagonal);
indices are passed through process()
.
For general dir
, function is.circulant()
checks that
a[v]==a[v+dir]==a[v+2*dir]==...==a[v+(n-1)*d]
for all
v
.
A Toeplitz matrix is one in which a[i,j]=a[i',j']
whenever
|i-j|=|i'-j'|
. See function toeplitz()
of the
stats
package for details.
circulant(5)
circulant(2^(0:4))
is.circulant(circulant(5))
a <- outer(1:3,1:3,"+")%%3
is.circulant(a)
is.circulant(a,c(1,2))
is.circulant(array(c(1:4,4:1),rep(2,3)))
is.circulant(magic(5)%%5,c(1,-2))
Run the code above in your browser using DataLab