-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
39 lines (34 loc) · 1.4 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include "RichardsonMethod.h"
using namespace std;
int main() {
double beta = 10;
double alpha = 1;
size_t n = 10;
double eps = 1e-5;
Generator generator(n, alpha, beta);
Vector x(n);
Matrix p = generator.getA();
for (size_t i = 0; i < x.getSize(); i++)
x(i) = 1;
Vector b = x;
double T = 0.0001;
Vector a = RichardsonMethod::Solve(p, b, T);
cout << "|| A || = " << generator.getNorm() << endl;
cout << "|| A_INV || = " << generator.getNorm_inv() << endl;
cout << "================================" << endl;
cout << "|| ABS_ERROR || = " << ABS_ERROR(a, x) << endl;
cout << "================================" << endl;
cout << "================================" << endl;
cout << "|| ABS_NEV || = " << ABS_NEV(p, a, b) << endl;
cout << "================================" << endl;
cout << "================================" << endl;
cout << "|| OTN_ERROR || = " << OTN_ERROR(a, x) << endl;
cout << "================================" << endl;
cout << "================================" << endl;
cout << "|| OTN_NEV || = " << OTN_NEV(p, a, b) << endl;
cout << "================================" << endl;
cout << "================================" << endl;
cout << "|| OBUSLOVLENNOST' || = " << generator.getObusl() << endl;
cout << "================================" << endl;
}