1 /// @file 2 /// Test QR Factorization 3 /// \test Test QR Factorization 4 #include <ceed.h> 5 6 int main(int argc, char **argv) { 7 Ceed ceed; 8 CeedScalar qr[12] = {1, -1, 4, 1, 4, -2, 1, 4, 2, 1, -1, 0}; 9 CeedScalar tau[3]; 10 11 CeedInit(argv[1], &ceed); 12 13 CeedQRFactorization(ceed, qr, tau, 4, 3); 14 for (int i=0; i<12; i++) { 15 if (qr[i] <= 1E-14 && qr[i] >= -1E-14) qr[i] = 0; 16 fprintf(stdout, "%12.8f\n", qr[i]); 17 } 18 for (int i=0; i<3; i++) { 19 if (tau[i] <= 1E-14 && qr[i] >= -1E-14) tau[i] = 0; 20 fprintf(stdout, "%12.8f\n", tau[i]); 21 } 22 CeedDestroy(&ceed); 23 return 0; 24 } 25