This commit is contained in:
Patrice Matz 2017-10-31 16:22:33 +01:00
parent f2737825fc
commit ce9f598059
1 changed files with 5 additions and 5 deletions

View File

@ -1,8 +1,7 @@
#include "lgs.h" #include "lgs.h"
#include "time.h" #include "time.h"
#include <iostream> #include <iostream>
#include<iostream>
#include<iomanip>
using namespace std; using namespace std;
void LGS::data_entry() void LGS::data_entry()
@ -101,6 +100,7 @@ float LGS::gauss()
GA[i][j] = GA[k][j]; GA[i][j] = GA[k][j];
GA[k][j] = temp; GA[k][j] = temp;
} }
cout << endl << "Matrix nach Pivot: " << endl; cout << endl << "Matrix nach Pivot: " << endl;
print(); print();
@ -124,10 +124,10 @@ float LGS::gauss()
x[i] = x[i] / GA[i][i]; //now finally divide the rhs by the coefficient of the variable to be calculated x[i] = x[i] / GA[i][i]; //now finally divide the rhs by the coefficient of the variable to be calculated
} }
cout << endl << "Loesung: " << endl; cout << endl << "Loesung: " << endl; // Print the values of x, y, z
for (i = 0; i<variables; i++){ for (i = 0; i<variables; i++){
int var1 = i + 65; int var1 = i + 65;
cout << (char)var1 << 1 << " = " << x[i] << endl; // Print the values of x, y,z,.... cout << (char)var1 << 1 << " = " << x[i] << endl;
} }
cout << endl; cout << endl;