daily pastebin goal
47%
SHARE
TWEET

Untitled

a guest Mar 25th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. double gauss(double tab[][SIZE], double b[SIZE]) {
  2.     double arr[SIZE][SIZE], D[SIZE], b2[SIZE], x2[SIZE], x1[SIZE] = { 1.,1.,1.,1. };
  3.     int n = 0;
  4.     for (int i = 0; i < SIZE; i++)
  5.     {
  6.         for (int j = 0; j < SIZE; j++)
  7.         {
  8.             arr[i][j] = tab[i][j];
  9.         }
  10.     }
  11.     //algroyytm
  12.     for (int k = 0; k < nmax; k++)
  13.     {
  14.         for (int i = 0; i < SIZE; i++)
  15.         {
  16.             x2[i] = b[i];
  17.             for (int j = 0; j < SIZE; j++)
  18.             {
  19.                 x2[i] += arr[i][j] * x1[j];
  20.             }
  21.             x2[i] = x2[i] / arr[i][i];
  22.         }
  23.         for (int i = 0; i < SIZE; i++)
  24.         {
  25.             std::cout << x2[i] << " ";
  26.         }
  27.     }
  28.     return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top