![]() ![]() Note that is a symmetric Hankel matrix and is a circulant matrix.Īn elementary permutation matrix differs from in just two rows and columns, and, say. It can be written, where is the th column of. Such a matrix is symmetric and so satisfies, and it has determinant. A general permutation matrix can be written as a product of elementary permutation matrices, where is such that. It is easy to show that, which means that the eigenvalues of are, where is the th root of unity. The matrix has two diagonals of s, which move up through the matrix as it is powered: for and. The following animated gif superposes MATLAB spy plots of,, …. Recall that a matrix is irreducible if there does not exist a permutation matrix such that The shift matrix plays a fundamental role in characterizing irreducible permutation matrices. ![]() Where and are square, nonempty submatrices. There exists a permutation matrix such that.įor a permutation matrix the following conditions are equivalent. One consequence of Theorem 1 is that for any irreducible permutation matrix. The next result shows that a reducible permutation matrix can be expressed in terms of irreducible permutation matrices. ![]() Every reducible permutation matrix is permutation similar to a direct sum of irreducible permutation matrices.Īnother notable permutation matrix is the vec-permutation matrix, which relates to, where is the Kronecker product.Ī permutation matrix is an example of a doubly stochastic matrix: a nonnegative matrix whose row and column sums are all equal to. A classic result characterizes doubly stochastic matrices in terms of permutation matrices. A matrix is doubly stochastic if and only if it is a convex combination of permutation matrices. In coding, memory can be saved by representing a permutation matrix as an integer vector, where is the column index of the within the th row of. MATLAB functions that return permutation matrices can also return the permutation in vector form. Here is an example with the MATLAB lu function that illustrates how permuting a matrix can be done using the vector permutation representation. > A = gallery('frank',4), = lu(A) Pįor more on handling permutations in MATLAB see section 24.3 of MATLAB Guide.You are not returning the result in your function. =size(A) % number of rows and columnsįor j = 1:d % permute the elements of column j Perms = perms_of_(A) % save the result of the call in a variableįunction A = perms_of_(A) % declare the return variable to be A That is, you calculate a new A inside your function but you don't return it to the caller via the perms variable. This syntax of using the same variable name for input and output can sometimes result in inplace operations depending on how the function is called. E.g., calling the function like this inside another function will allow inplace operations: function some_functionĪ = perms_of_(A) % save the result of the call in a variable If you don't use specific inplace operation syntax in the caller then a deep copy will be returned to the caller. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |