ProteoWizard
Functions
HouseholderQRTest.cpp File Reference
#include "HouseholderQR.hpp"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 20 of file HouseholderQRTest.cpp.

21{
22 using namespace boost::numeric::ublas;
23 using namespace std;
24 matrix<double> A (3,3);
25 A(0,0) = 1;
26 A(0,1) = 1;
27 A(0,2) = 0;
28 A(1,1) = 1;
29 A(1,0) = 0;
30 A(1,2) = 0;
31 A(2,2) = 1;
32 A(2,0) = 1;
33 A(2,1) = 0;
34 cout << "A=" << A << endl;
35
36 cout << "QR decomposition using Householder" << endl;
37 matrix<double> Q(3,3), R(3,3);
38 HouseholderQR (A,Q,R);
39 matrix<double> Z = prod(Q,R) - A;
40 float f = norm_1 (Z);
41 cout << "Q=" << Q <<endl;
42 cout << "R=" << R << endl;
43 cout << "|Q*R - A|=" << f << endl;
44
45 return 0;
46}
#define A
void HouseholderQR(const ublas::matrix< T > &M, ublas::matrix< T > &Q, ublas::matrix< T > &R)
STL namespace.

References A, and pwiz::math::HouseholderQR().