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: [mg69515] Re: [mg69476] fast replace for matrix minor
  • From: "Carl K. Woll" <carlw at wolfram.com>
  • Date: Thu, 14 Sep 2006 06:56:43 -0400 (EDT)
  • References: <200609130803.EAA18423@smc.vnet.net>

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
> 
> Chris Arthur

Something like this?

m=Array[Plus,{5,5}];

Replace minor block with rows 2,3,4 and columns 4 and 5:

m[[Range[2,4],Range[4,5]]] = {{a,b},{c,d},{e,f}};

Now, the matrix m has had a minor block replaced with the above matrix.

Carl Woll
Wolfram Research


  • Prev by Date: Re: Animation crash
  • Next by Date: Re: fast replace for matrix minor
  • Previous by thread: fast replace for matrix minor
  • Next by thread: Re: fast replace for matrix minor