On 09/28/2012 10:33 AM, Riccardo (Jack) Lucchetti wrote:
On Fri, 28 Sep 2012, Sven Schreiber wrote:
> Good morning,
>
> I just noticed the new (?) function diagcat() with the following help
> text:
>
> "Returns the direct sum of A and B, that is a block-diagonal matrix
> holding A in its north-west corner and B in its south-east corner. "
>
> Why would that be a _sum_?
Because that's its name :)
http://en.wikipedia.org/wiki/Matrix_addition#Direct_sum
Intuitively, you can think of this operator as a sum if you view
matrices as the space spanned by their columns. The direct sum of two
matrices results in a space which is equal to the two original spaces
"put together", so to speak.
Well, one never stops learning I guess. I trust you didn't write that
Wikipedia entry yourself ;-)
> Also, what happens if A and B are not square? (I know, I could just try
> that out, but too lazy, and that wouldn't necessarily answer what's
> intended as a result.)
Nothing spectacular. You just have non-square zero blocks in the
north-east and south-west corners of the result.
At the risk of being pedantic: so a block-diagonal matrix is only
returned if the inputs are square, otherwise it's just a block matrix.
(w.r.t. the help text)
thanks,
sven