MathGroup Archive 2006

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

Search the Archive

Re: fast replace for matrix minor

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69507] Re: [mg69476] fast replace for matrix minor
  • From: Sseziwa Mukasa <mukasa at jeol.com>
  • Date: Thu, 14 Sep 2006 06:56:15 -0400 (EDT)
  • References: <200609130803.EAA18423@smc.vnet.net>

On Sep 13, 2006, at 4:03 AM, Christopher Arthur wrote:

> Is there a quick way to replace a small minor block in a large matrix?
> Using ReplacePart in a Do loop seems to be very inefficient with
> respect to timing

If you are replacing a block just use part eg:

In[188]:=
Block[{mat={{a,b,c},{d,e,f},{g,h,i}}},
   Print[mat];mat[[{2,3},{2,3}]]={{1,1},{1,1}};mat]
 From In[188]:=
{{a,b,c},{d,e,f},{g,h,i}}
Out[188]=
{{a,b,c},{d,1,1},{g,1,1}}

Regards,

Ssezi


  • Prev by Date: Re: fast replace for matrix minor
  • Next by Date: GUIKit Wizard Frame Sizing Problem
  • Previous by thread: Re: fast replace for matrix minor
  • Next by thread: Re: fast replace for matrix minor