5 int main(
int argc,
char **argv)
7 unsigned int dimX = 12;
10 vnl_matrix <double> testData (dimX,dimY);
11 vnl_vector <double> bVector(dimX);
16 unsigned int pos = 10;
17 for (
unsigned int i = 0;i < dimX;++i)
19 for (
unsigned int j = 0;j < dimY;++j)
20 testData(i,j) = pos++;
28 std::ifstream inputData(argv[1]);
29 for (
unsigned int i = 0;i < dimX;++i)
31 for (
unsigned int j = 0;j < dimY;++j)
32 inputData >> testData(i,j);
38 std::cout <<
"Test data " << testData << std::endl;
40 std::vector <double> betaValues(dimY,0.0);
41 std::vector <unsigned int> pivotVector(dimY);
42 unsigned int rank = 0;
46 std::cout.precision(20);
47 std::cout <<
"Matrix rank " << rank << std::endl;
48 std::cout <<
"Transformed matrix " << testData << std::endl;
50 std::cout <<
"Pivot vector ";
51 for (
unsigned int i = 0;i < pivotVector.size();++i)
52 std::cout << pivotVector[i] <<
" ";
53 std::cout << std::endl;
55 std::cout <<
"Beta Values ";
56 for (
unsigned int i = 0;i < betaValues.size();++i)
57 std::cout << betaValues[i] <<
" ";
58 std::cout << std::endl;
62 std::cout <<
"QtB " << bVector << std::endl;
64 vnl_matrix <double> qMatrix (dimX,dimX);
67 std::cout <<
"Q matrix " << qMatrix << std::endl;
void QRPivotDecomposition(vnl_matrix< ScalarType > &aMatrix, std::vector< unsigned int > &pivotVector, std::vector< ScalarType > &houseBetaValues, unsigned int &rank)
void GetQtBFromQRPivotDecomposition(vnl_matrix< ScalarType > &qrMatrix, vnl_vector< ScalarType > &bVector, std::vector< ScalarType > &houseBetaValues, unsigned int rank)
void GetQMatrixQRPivotDecomposition(vnl_matrix< ScalarType > &qrMatrix, std::vector< ScalarType > &houseBetaValues, vnl_matrix< ScalarType > &qMatrix, unsigned int rank)
int main(int argc, char **argv)