-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqr_alg.cpp
25 lines (22 loc) · 867 Bytes
/
qr_alg.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
/******************************************************************************
Copyright (C) 2013 Karel Ha <[email protected]>
Distributed under the terms of the GNU General Public License (GPL)
as published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
http://www.gnu.org/licenses/
******************************************************************************/
#include "all.hpp"
#include<cmath>
#include<iomanip>
int main(int argc, const char* argv[]) {
cout << "================QR factorization==============" << endl;
Matrix<> A, R;
SqrMtrx<> Q;
cin >> A;
SqrMtrx<> B = A;
unsigned it = 1000;
B = B.QR_algorithm(it);
cout << "A.QR_algorithm(" << it << "):\n" << B << endl;
cout << "===============/QR factorization==============" << endl;
return 0;
}