From: Denis Davydov Date: Sun, 13 May 2018 21:14:11 +0000 (+0200) Subject: quick-test: do not use lapack/create_matrix.h in scalapack test X-Git-Tag: v9.0.1~8^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b59812f46a0d4678487cb9cc651e189306fcb86d;p=dealii.git quick-test: do not use lapack/create_matrix.h in scalapack test --- diff --git a/tests/quick_tests/scalapack.cc b/tests/quick_tests/scalapack.cc index 2e3876b040..f87dbbba66 100644 --- a/tests/quick_tests/scalapack.cc +++ b/tests/quick_tests/scalapack.cc @@ -14,7 +14,6 @@ // --------------------------------------------------------------------- #include "../tests.h" -#include "../lapack/create_matrix.h" // adaptation of /scalapack/scalapack_02.cc to a quick test @@ -32,6 +31,33 @@ #include + +template +void create_spd (FullMatrix &A) +{ + const unsigned int size = A.n(); + Assert (size == A.m(), ExcDimensionMismatch(size,A.m())); + + for (unsigned int i = 0; i < size; ++i) + for (unsigned int j = i; j < size; ++j) + { + const double val = random_value(); + Assert (val >= 0. && val <= 1., + ExcInternalError()); + if (i==j) + // since A(i,j) < 1 and + // a symmetric diagonally dominant matrix is SPD + A(i,j) = val + size; + else + { + A(i,j) = val; + A(j,i) = val; + } + } +} + + + template void test(const unsigned int size, const unsigned int block_size) {