-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
64 lines (32 loc) · 814 Bytes
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include "Mat.hpp"
#include "HouseHolder.hpp"
#include "functions.hpp"
int main(){
int l = 5;
vector<double> vec(l,1);
HH H(vec);
HH G(H);
cout << H(0,0) << endl;
Mat A;
char filename[] = "A1.txt";
A.Load(filename);
//cout << A;
int n = A.Row();
int m = A.Col();
vector<double> xN(m);
vector<double> xGS(m);
vector<double> xH(m);
vector<double> b(n,1);
NormalSolve(A,xN,b);
for(int i = 0; i < xN.size(); ++i){cout << xN[i] << endl;}
cout << endl << endl;
GramSchmidtSolve(A,xGS,b);
for(int i = 0; i < xGS.size(); ++i){cout << xGS[i] << endl;}
cout << endl << endl;
HouseholderSolve(A,xH,b);
for(int i = 0; i < xH.size(); ++i){cout << xH[i] << endl;}
}