edward4324

ChisMethods

Sep 21st, 2021 (edited)
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. //// Последняя буква d в имени вектора - сокращение от diagonal
  2.     //// m - main, t - top, b - bottom diagonal (md, td, bd)
  3.     //
  4.     //// f - вектор правой части системы уравнений
  5.     //// uf - вектор, соответствующий правой части системы с единичным решением
  6.     //
  7.     //// fc, sc - первая и вторая испорченные колонки соответственно
  8. double evaluationAccuracy(vector<double> md, vector<double> td, vector<double> bd, vector<double>& uf, vector<double> fc, vector<double> sc)
  9. {
  10.     stepOne(md, td, bd, uf, fc, sc);
  11.     stepTwo(md, td, bd, uf);
  12.     stepThree(md, td, bd, uf, fc, sc);
  13.  
  14.     double max = -1;
  15.     double current;
  16.     for (int i = 0; i < uf.size(); i++)
  17.     {
  18.         current = abs(uf[i] - 1);
  19.         if (max < current)
  20.         {
  21.             max = current;
  22.         }
  23.     }
  24.     return max;
  25. }
Add Comment
Please, Sign In to add comment