If any of you know what it means for a matrix to be in row-echelon form, I'm trying to create some code to check if a matrix is in that form, and if not put it in that form. Any ideas?
Printable View
If any of you know what it means for a matrix to be in row-echelon form, I'm trying to create some code to check if a matrix is in that form, and if not put it in that form. Any ideas?
What is the use of Row-Echelon form, Leeman? Is there one, or are you trying to make a program to do your math homework? Just curious.
Well, it's going to be a program that solves systems of equations. Yes, for my homework.
What I mean by "for my homework" is pre-calc homework lol. Not programming homework.
If all you want it for is your homework then do you have a graphing calculator. I know the TI-86 and TI-89 both can do what you ask. I own both and find the TI-86 easier to use when working with matrices.
James
Of course I could just do it with my calculator. Much more fun to make a program though.
reduced-echelon form:
1 x y
0 1 z
0 0 1
row-echelon form:Code:// begin program
int matrix[3][3]; // to hold matrix
bool echelon=TRUE;
// fill matrix in here
if(matrix[0][0]!=1 ||
matrix[1][0]!=0 ||
matrix[1][1]!=1 ||
matrix[2][0]!=0 ||
matrix[2][1]!=0 ||
matrix[2][2]!=1)
echelon=FALSE;
if(ecelon)
cout>>"echelon";
else
cout>>"not ecelon";
// end program
x y z
a b c
0 0 0
i'm not doing all your homework for you... just fill in the cout in the 'else' with code to put it in the lowest form if it's not already... but good luck with that...Code:// begin program
int i;
int matrix[3][3]; // to hold matrix
bool echelon=TRUE;
// fill matrix in here
for(i=0;i<3;i++)
{
if(matrix[2][i]!=0)
echelon=FALSE;
}
if(ecelon)
cout>>"echelon";
else
cout>>"not ecelon";
// end program