STK++ 0.9.13
tutoQrUpdate.cpp
Go to the documentation of this file.
1#include <STKpp.h>
2using namespace STK;
4int main(int argc, char** argv)
5{
6 ArrayXX a(5,4), QR;
7 a << 0, 1, 2, 3,
8 2, 3, 4, 5,
9 2, 1, 6, 7,
10 0, 3,-1, 2,
11 3,-1, 1, 1;
12 stk_cout << "lapack QR decomposition:\n";
13 lapack::Qr lq(a); lq.run();
14 // remove column
15 lq.eraseCol(2);
16 stk_cout << "R matrix:\n";
17 stk_cout << lq.R();
18 QR = lq.Q() * lq.R();
19 stk_cout << "QR matrix:\n";
20 stk_cout << QR;
21 // insert constant column with value 1 in column 2
23 stk_cout << "\nR matrix:\n";
24 stk_cout << lq.R();
25 QR = lq.Q() * lq.R();
26 stk_cout << "QR matrix:\n";
27 stk_cout << QR;
28 return 0;
29}
#define stk_cout
Standard stk output stream.
This file include all the header files of the STK++ project.
Define the constant point.
virtual bool run()
Compute the QR decomposition.
Definition STK_IQr.h:227
Array const & Q() const
give the matrix Q of the QR decomposition.
Definition STK_IQr.h:155
ArrayUpperTriangularXX const & R() const
give the matrix R of the QR decomposition.
Definition STK_IQr.h:159
void eraseCol(int pos)
Delete the column pos and update the QR decomposition.
Definition STK_IQr.h:298
void insertCol(ColVector_ const &T, int pos)
Add a column with value T at the position pos and update the QR decomposition.
Definition STK_IQr.h:370
The namespace STK is the main domain space of the Statistical ToolKit project.
int main(int argc, char **argv)