Re: Re: Re: Creating a symmetric matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg46897] Re: [mg46876] Re: [mg46857] Re: [mg46853] Creating a symmetric matrix
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Sun, 14 Mar 2004 03:24:18 -0500 (EST)
- References: <200403110850.DAA13986@smc.vnet.net> <200403120702.CAA25478@smc.vnet.net> <200403130439.XAA15074@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
An equivalent but perhaps even simpler version is:
A + Transpose[A] - IdentityMatrix[First[Dimensions[A]]*A
Andrzej
On 13 Mar 2004, at 05:39, Andrzej Kozlowski wrote:
> It seems that I was the only one who thinks that a "triangular matrix"
> is a "strick triangular matrix", that is with zeros on the diagonal.
> had I not made this assumption I would have suggested:
>
>
> A+Transpose[A]*Array[KroneckerDelta[#1 != #2,True]&,Dimensions[A]]
>
>
> Andrzej
>
>
> On 12 Mar 2004, at 08:02, Andrzej Kozlowski wrote:
>
>>
>> On 11 Mar 2004, at 09:50, Mark Coleman wrote:
>>
>>> Greetings,
>>>
>>> How can I efficiently build a symmetric matrix from an upper
>>> triangular
>>> one, i.e., extract the upper triangular elements and insert them into
>>> the lower triangle in such a way as to make the resulting square
>>> matrix
>>> symmetric?
>>>
>>> Thanks,
>>>
>>> Mark
>>>
>>>
>>>
>>
>> The most natural way must be
>>
>> A+Tranpose[A]
>>
>> e.g.
>>
>> A = Array[KroneckerDelta[#1 < #2, True] & , {3, 3}];
>>
>>
>> {{0, 1, 1}, {0, 0, 1}, {0, 0, 0}}
>>
>>
>> A + Transpose[A]
>>
>>
>> {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}
>>
>>
>>
>> Andrzej Kozlowski
>> Chiba, Japan
>> http://www.mimuw.edu.pl/~akoz/
>>
>>
>
>
- References:
- Creating a symmetric matrix
- From: Mark Coleman <mark@markscoleman.com>
- Re: Creating a symmetric matrix
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Re: Creating a symmetric matrix
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Creating a symmetric matrix