diff --git a/Gaussian Elimination/Gaussian Elimination.cpp b/Gaussian Elimination/Gaussian Elimination.cpp new file mode 100644 index 0000000..03ad239 --- /dev/null +++ b/Gaussian Elimination/Gaussian Elimination.cpp @@ -0,0 +1,30 @@ +/*Gaussian_Elimination.. +This program needs as a input, the original matrix and the number of rows and columns. +You are able to change the MAX value if you need to work with a bigger matrix*/ + +#include +#define MAX 2000 + +void Gaussian_Elimination (double matrix[][MAX],int total_row,int total_column) +{ + //Some variables for make my loops + int i,j,row,column; + int swap_row = 0; + + //This array will divide the row that is procesing + double divider[MAX]; + + for (row = 0; row < total_row; t++) + { + //This make a matrix that will multiply the current row + for (column = 1+swap_row; column < total_row; column++) + divider[column] = (double)m[column][row] / m[row][row]; + + //Now the divider's matrix will modify the original matrix + for (i = 1+swap_row; i