# HG changeset patch # User Jaroslav Hajek # Date 1238156341 -3600 # Node ID a1635f7c4cbeaf758dfde892c2a34bc1ae1d8532 # Parent 88bf56bbccca84f1800b460559bd8f3c7b07cb76 update diag-perm.txi diff -r 88bf56bbccca -r a1635f7c4cbe doc/ChangeLog --- a/doc/ChangeLog Fri Mar 27 12:22:05 2009 +0100 +++ b/doc/ChangeLog Fri Mar 27 13:19:01 2009 +0100 @@ -1,3 +1,7 @@ +2009-03-27 Jaroslav Hajek + + * interpreter/diagperm.txi: Mention mixing with sparse matrices. + 2009-03-25 John W. Eaton * interpreter/munge-texi.cc (process_texi_input_file): diff -r 88bf56bbccca -r a1635f7c4cbe doc/interpreter/diagperm.txi --- a/doc/interpreter/diagperm.txi Fri Mar 27 12:22:05 2009 +0100 +++ b/doc/interpreter/diagperm.txi Fri Mar 27 13:19:01 2009 +0100 @@ -258,6 +258,12 @@ happens to be diagonal (an is thus not a special object) is of course treated normally. +Multiplication and division by diagonal matrices works efficiently also when +combined with sparse matrices, i.e. @code{D*S}, where @var{D} is a diagonal +matrix and @var{S} is a sparse matrix scales the rows of the sparse matrix and +returns a sparse matrix. The expressions @code{S*D}, @code{D\S}, @code{S/D} work +analogically. + If @var{D1} and @var{D2} are both diagonal matrices, then the expressions @example D1 + D2 @@ -320,6 +326,12 @@ flag internally, and thus the choice between the two above equivalent expressions for inverse permuting is completely up to the user's taste. +Multiplication and division by permutation matrices works efficiently also when +combined with sparse matrices, i.e. @code{P*S}, where @var{P} is a permutation +matrix and @var{S} is a sparse matrix permutes the rows of the sparse matrix and +returns a sparse matrix. The expressions @code{S*P}, @code{P\S}, @code{S/P} work +analogically. + Two permutation matrices can be multiplied or divided (if their sizes match), performing a composition of permutations. Also a permutation matrix can be indexed by a permutation vector (or two vectors), giving again a permutation matrix. @@ -351,6 +363,8 @@ @dfn{abs}, @dfn{real}, @dfn{imag}, @dfn{conj}, @dfn{sqrt}. A diagonal matrix can also be returned from the @dfn{balance} and @dfn{svd} functions. +The @dfn{sparse} function will convert a diagonal matrix efficiently to a +sparse matrix. @node Permutation Matrix Functions @subsection Permutation Matrix Functions @@ -362,6 +376,11 @@ A permutation matrix can also be returned from the built-in functions @dfn{lu} and @dfn{qr}, if a pivoted factorization is requested. +The @dfn{sparse} function will convert a permutation matrix efficiently to a +sparse matrix. +The @dfn{find} function will also work efficiently with a permutation matrix, +making it possible to conveniently obtain the permutation indices. + @node Example Codes @section Some Examples of Usage