]> https://gitweb.dealii.org/ - dealii.git/commitdiff
quick-test: do not use lapack/create_matrix.h in scalapack test 6591/head
authorDenis Davydov <davydden@gmail.com>
Sun, 13 May 2018 21:14:11 +0000 (23:14 +0200)
committerDenis Davydov <davydden@gmail.com>
Sun, 13 May 2018 22:46:21 +0000 (00:46 +0200)
tests/quick_tests/scalapack.cc

index 2e3876b040d763984ec09e7b2f87f4893d7e9244..f87dbbba66ebf3ce7c180919e2967fef49cfea6c 100644 (file)
@@ -14,7 +14,6 @@
 // ---------------------------------------------------------------------
 
 #include "../tests.h"
-#include "../lapack/create_matrix.h"
 
 // adaptation of /scalapack/scalapack_02.cc to a quick test
 
 #include <iostream>
 
 
+
+template <typename FullMatrix>
+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<typename FullMatrix::value_type>();
+        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 <typename NumberType>
 void test(const unsigned int size, const unsigned int block_size)
 {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.