Post a reply
Username:
Note:If not registered, provide any username. For more comfort, register here.
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
Font size:
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.
   

Topic review - Reduced Row Echelon Form
Author Message
  Post subject:  Re: Reduced Row Echelon Form  Reply with quote
According to my definition in a reduced row echelon form the leading terms should all be one, and the remaining entries in the same column should be zero.
In the case of your example:

matrix m[4][3]=1,2,3,4,5,6,7,8,9,10,11,12;

Desired output is:

1 0 -1
0 1 2
0 0 0
0 0 0
Post Posted: Sat Jun 11, 2016 4:42 pm
  Post subject:  Re: Reduced Row Echelon Form  Reply with quote
Code:
ring R=0,x,dp;
matrix m[4][3]=1,2,3,4,5,6,7,8,9,10,11,12;
list L=ludecomp (m);
print(L[3]);
1,2, 3,
0,-3,-6,
0,0, 0,
0,0, 0 

Post Posted: Fri Jun 10, 2016 11:05 am
  Post subject:  ludecomp  Reply with quote
Hi Hannes,
I had actually had a look at the function you suggested before I posted my original message. However, I don't know how that decomposition can be used to get the reduced row echelon form. Can you please elaborate? Thanks.
Post Posted: Thu Jun 09, 2016 4:29 pm
  Post subject:  Re: Reduced Row Echelon Form  Reply with quote
see http://www.singular.uni-kl.de/Manual/4-0-3/sing_338.htm
Post Posted: Thu Jun 09, 2016 10:27 am
  Post subject:  My code for the Reduced Row Echelon Form  Reply with quote
Hi all,
I have written a code to implement conversion to the reduced row echelon form.
I used the Groebner Basis approach, which is most probably not the smartest way.
One needs to set the correct number of ring variables manually in the code, and of course, enter the matrix.
In case the number of rows of output is smaller than the number of rows of the matrix, those rows are all zero.

Code:
ring r=0,(x(1..4)),dp;    //number of variables must be the same as the number of columns of the matrix for which we want the reduced row echelon form

matrix m[4][4]=16,2,3,13,5,11,10,8,9,7,6,12,4,14,15,1; //enter an arbitrary matrix here

print("m=");print(m);

int nr=nrows(m);
int nc=ncols(m);
int j;
int k;
for(j=1;j<=nr;j=j+1){for(k=1;k<=nc;k=k+1){m[j,k]=m[j,k]*x(k);}};
kill j;
kill k;

matrix ONES[nc][1];
for(int j=1;j<=nc;j=j+1){ONES[j,1]=1;};
kill j;

ideal i=m*ONES;
option(redSB);
ideal g=std(i);
int L=size(g);
for(int j=1;j<=L;j=j+1) {g[j]=g[j]/leadcoef(g[j]);} // set the coefficients of the leading terms to unity
kill j;

matrix RREF[L][nc];
int k;
int j;
for (j=L;j>0;j=j-1){for (k=1;k<=nc;k=k+1){RREF[j,k]=jet(g[L+1-j]/x(k),0);}};

print("RREF=");print(RREF);print("RREF is the Reduced Row Echelon Form of the matrix m")


A) Do you think this code is correct? I have double-checked a few matrices with MATLAB and it seems to be OK.
B)Any suggestion how to improve my code?
Post Posted: Wed Jun 08, 2016 12:09 am
  Post subject:  Reduced Row Echelon Form  Reply with quote
Hi all,
how can one get the "Reduced Row Echelon Form" of a matrix in Singular, please?

example: (input is a 4x3 matrix)

input=
[1 2 3
4 5 6
7 8 9
10 11 12]

desired output=
[1 0 -1
0 1 2
0 0 0
0 0 0]
Post Posted: Tue Jun 07, 2016 3:27 pm


It is currently Fri May 13, 2022 11:02 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group