From 55e7dd65a6f5d931d0da4ab266f5c0fa0d310f51 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sun, 13 May 2018 23:14:11 +0200 Subject: [PATCH] quick-test: do not use lapack/create_matrix.h in scalapack test --- tests/quick_tests/scalapack.cc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) 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) { -- 2.39.5