Linear Search
Linear Search
void SetElement(float Matrix[3][6], int CurrRow, int PivotRow, float Pivot, float
curr) {
float temp = curr / Pivot;
FOR(i, 0, 6) {
if (Matrix[CurrRow][i] == curr) {
Matrix[CurrRow][i] = 0;
} else {
Matrix[CurrRow][i] -= temp * Matrix[PivotRow][i];
}
}
}
int main() {
cout << "Hello! This is a program to find the inverse of a matrix using the
Gauss-Jordan method in C++" << endl;
float Matrix[3][6] = {
{1, 2, -2, 1, 0, 0},
{-1, 3, 0, 0, 1, 0},
{0, -2, 1, 0, 0, 1}
};
GaussJordan(Matrix);
return 0;
}
Hello! This is a program to find the inverse of a matrix using the Gauss-Jordan
method in C++
THE ORIGINAL MATRIX IS:
1 2 -2 1 0 0
-1 3 0 0 1 0
0 -2 1 0 0 1
-_____________________________________-