Gaussian elimination method
More...
#include <iostream>
◆ main()
Main function
33 for (step = 0; step <
mat_size - 1; step++) {
34 for (i = step; i <
mat_size - 1; i++) {
35 double a = (mat[i + 1][step] / mat[step][step]);
38 mat[i + 1][j] = mat[i + 1][j] - (a * mat[step][j]);
43 <<
"Matrix using Gaussian Elimination method: " <<
std::endl;
52 <<
"Value of the Gaussian Elimination method: " <<
std::endl;
53 for (i =
mat_size - 1; i >= 0; i--) {
56 x[i][j] = x[j][j] * x[i][j];