// ================================================================================================= // This file is part of the CodeVault project. The project is licensed under Apache Version 2.0. // CodeVault is part of the EU-project PRACE-4IP (WP7.3.C). // // Author(s): // Rafal Gandecki // // This example demonstrates the use of OpenMP for LU decomposition (Doolittle algorithm) and // compares execution time. // The example takes a single input argument, specifying the size of the matrices. // // See [http://www.openmp.org/] for the full OpenMP documentation. // // ================================================================================================= #include #include #include void fill_random(float *A, const int &n, const int &m) { std::mt19937 e(static_cast(time(nullptr))); std::uniform_real_distribution f; for(int i=0; ii) U[j*n+i] = 0; U[i*n+j] = A[i*n+j]; for(int k=0; kj) L[j*n+i] = 0; else if (j==i) L[j*n+i] = 1; else { L[j*n+i] = A[j*n+i] / U[i*n+i]; for(int k=0; ki) U[j*n+i] = 0; U[i*n+j] = A[i*n+j]; for(k=0; kj) L[j*n+i] = 0; else if (j==i) L[j*n+i] = 1; else { L[j*n+i] = A[j*n+i] / U[i*n+i]; for(k=0; k