#include #include #include #include using namespace std; double n = 5.0; double epsilon = 0.0001; double mli = 30.0; double data[] = { 10, 1, 1, 1, 2, 15, 3, 20, 4, 2, 1, 30, 5, 1, 40, 9, 5, 60, 3, 0, 1, 10, 1, 15, 6, 2, 1, 1, 20, 30 }; //double data[] = { 10, -1, 1, 1, 2, 13, -3, 20, 4, 2, 1, 24, 5, -1, 40, 9, 5, 58, 3, 0, -1, 10, 1, 13, 6, -2, 1, 1, 20, 26 }; double A[5][5]; double Alfa[5][5]; double wektor[5]; double Beta[5]; double x_nowy[5], x_stary[5]; int x=0; void funkcja_b() { std::cout << "Macierz alfa"< epsilon && licznik < mli); cout << endl <<"Licznik iteracji " << licznik << endl << " norma2 " << norma2 << endl; } int main() { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { A[i][j] = data[x]; x++; } wektor[i] = data[x]; x++; } funkcja_b(); cout << "Macierz alfa" << endl; for (int i = 0; i < n; i++){ for (int j = 0; j < n; j++){ cout << Alfa[i][j] << "\t"; } cout << endl; } cout << endl<< "Wektor beta" << endl; for (int i = 0; i < n; i++){ cout << Beta[i] << endl; } funkcja_c(); return 0; }