MathGroup Archive 2006

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

Search the Archive

Re: fast replace for matrix minor


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