Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Creating a symmetric matrix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46920] Re: [mg46889] Re: Creating a symmetric matrix
  • From: DrBob <drbob at bigfoot.com>
  • Date: Tue, 16 Mar 2004 02:37:24 -0500 (EST)
  • References: <c2p9ld$dns$1@smc.vnet.net> <200403130440.XAA15145@smc.vnet.net> <A8166766-7689-11D8-A63D-0003938BF55C@jeol.com>
  • Sender: owner-wri-mathgroup at wolfram.com

I didn't expect it to be the fastest method... it may use a lot less 
memory, but that's a temporary advantage.

Building a matrix that large (2000x2000), when half the information is 
redundant, is probably a bad idea in the first place; and that applies to 
the upper-triangular matrix you're taking it from as well.

Instead, you should write code that uses the necessary information more 
efficiently.

SparseArray also may be of help.

Bobby

On Mon, 15 Mar 2004 09:04:21 -0500, Sseziwa Mukasa,,(978) 536-2359 
<mukasa at jeol.com> wrote:

>
> On Mar 12, 2004, at 11:40 PM, Bobby R. Treat wrote:
>
>> How's this?
>>
>> symmetric[a_?MatrixQ] :=
>>   Array[a[[Min[#1, #2], Max[#1, #2]]] &, {Length@a, Length@a}]
>>
>
> It avoids forming the transpose, but it's no faster than those solutions 
> on my machine, 60 seconds to process a 2000x2000 array.
>
> Regards,
>
> Ssezi
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


  • Prev by Date: Re: Mathematica 5: Integration bug in quadratic found by the GEMM machine
  • Next by Date: Re: Mathematica 5: Integration bug in quadratic found by the GEMM machine
  • Previous by thread: Re: Re: Creating a symmetric matrix
  • Next by thread: Re: Re: Creating a symmetric matrix