Switch rows!
- To: mathgroup at smc.vnet.net
- Subject: [mg32364] Switch rows!
- From: Rebeka Renko <irc_rebecca at yahoo.com>
- Date: Wed, 16 Jan 2002 03:30:27 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi! I have another question. While I was writting a program for partial pivoting, I used a program bellow for switching rows in a matrix. It works fine, when I use it separetly, but if I include it into a programm, it returns an error. I believe this is because of the BLOCK command, or am I wrong? How can it be changed, so that it would fit my programm? I am looking forward on your answer and am thanking you in advance! Regards, Rebeka Programm: RowSwop[ matrix_, row1_, row2_ ] := Block[{temp = matrix}, temp[[row1]] = matrix[[row2]]; temp[[row2]] = matrix[[row1]]; temp ] __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/