2-dimensional table Author Message
Harry
Member

 Post: #1 2-dimensional table Hello, I have small problem with 2-dimensional table. I have to cear some it's values to 0. You can see them on the attachment (x). I know how to clear values below or above the main diagonal but with this I have some problem. Coud you give me some tips? Attached File(s) Image(s)     (This post was last modified: 11-26-2010 11:43 AM by Harry.)
11-26-2010 11:41 AM
llynx
Member

 Post: #2 RE: 2-dimensional table Assuming this is gauss so assuming allowed *elementary row operations and no row exchanges reduced 3x3 example: PHP Code: `1 1 1x 1 1x x 11    1    1 0    1-x 1-x0    0    1-x1    1    10    1-x 00    0    1-x1    0    00    1-x 0        Row Operation (R1 - R2*(1/(1-x)) - R3*(1/(1-x)))0    0    1-x ` 4x4 PHP Code: `1 1 1 1x 1 1 1x x 1 1x 1 1 11    1    1    10    1-x 1-x 1-x0    0    1-x 1-x0    1-x 1-x 1-x1    1    1    10    1-x 1-x 1-x0    0    1-x 1-x0    1-x 1-x 1-x1    1    1    10    1-x  0   00    0    1-x 1-x0    1-x  0   01    1    1    10    1-x 0    00    0    1-x 1-x0    0    0    01    0    0    00    1-x 0    00    0    1-x 1-x0    0    0    0 ` and etc for nxn matrices You can also see that R2 can null out R10, R3 can null out R9, etc effectively giving you rows 1-6 and with rows 7-10 being all zeros. (This post was last modified: 11-26-2010 02:19 PM by llynx.)
11-26-2010 12:07 PM
Harry
Member

 Post: #3 RE: 2-dimensional table I don't know what Gaussian transformations exactly are (you mean this: http://en.wikipedia.org/wiki/Gaussian_elimination ?) but if I undestand your examples well after celaring elements which I ticked by X rest of elements can change their values? I don't want to have this. Fo example whole elements of table has a random number and I want set to 0 only elements which I ticked by X. Here is an example of clearing elements under main diagonal: Attached File(s) Image(s)     (This post was last modified: 11-26-2010 01:38 PM by Harry.)
11-26-2010 01:37 PM
Chris
Member

 Post: #4 RE: 2-dimensional table Isn't it just a simple case of having the right If statement then, when iterating the cells: Int n = Table.dimensions(); FREPD(x,n) FREPD(y,n) { if (y>x && y
11-26-2010 02:03 PM
llynx
Member

 Post: #5 RE: 2-dimensional table Hahaha I thought this was a linear algebra problem and you were doing matrix row ops to clear cells Chris is right for the programming example if you just want to set the values to zero
11-26-2010 02:17 PM
Harry
Member

 Post: #6 RE: 2-dimensional table Ok i get it. I didn't properly wrote the second condition. Thank you both for help. (This post was last modified: 11-26-2010 02:24 PM by Harry.)
11-26-2010 02:23 PM
 « Next Oldest | Next Newest »