]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New test case
authorMartin Kronbichler <martin.kronbichler@rub.de>
Tue, 20 May 2025 12:39:03 +0000 (14:39 +0200)
committerMartin Kronbichler <martin.kronbichler@rub.de>
Tue, 20 May 2025 20:21:44 +0000 (22:21 +0200)
tests/lac/householder.cc
tests/lac/householder.output

index 7da1d670faca52873dd0fb0fd278cd3c6b873581..d7a007253beef99b5ad4855b07ac8fe1c4dabd74 100644 (file)
@@ -16,6 +16,7 @@
 // Tests Householder class for QR-decomposition
 
 #include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/full_matrix.templates.h>
 #include <deal.II/lac/householder.h>
 #include <deal.II/lac/vector.h>
 
@@ -36,11 +37,29 @@ main()
   FullMatrix<double>  A(4, 3, &rect[0][0]);
   Householder<double> H(A);
 
-  Vector<double> u(4);
-  Vector<double> v1(3);
-  Vector<double> v2(3);
+  {
+    Vector<double> u(4);
+    Vector<double> v1(3);
 
-  for (unsigned int i = 0; i < u.size(); ++i)
-    u(i) = i * i;
-  deallog << "Distance " << H.least_squares(v1, u) << std::endl;
+    for (unsigned int i = 0; i < u.size(); ++i)
+      u(i) = i * i;
+    deallog << "Distance " << H.least_squares(v1, u) << std::endl;
+  }
+
+  // make a rudimentary complex test
+  FullMatrix<std::complex<double>> B(A.m(), A.n());
+  for (unsigned int i = 0; i < A.m(); ++i)
+    for (unsigned int j = 0; j < A.n(); ++j)
+      B(i, j) = A(i, j);
+
+  Householder<std::complex<double>> HB(B);
+
+  {
+    Vector<std::complex<double>> u(4);
+    Vector<std::complex<double>> v1(3);
+
+    for (unsigned int i = 0; i < u.size(); ++i)
+      u(i) = i * i;
+    deallog << "Distance " << H.least_squares(v1, u) << std::endl;
+  }
 }
index 71fb7aaaf4726134ff80cb36fdb3cfe9496b604b..59ec92d92f65c98e23abc88ae95fdb7078473b1b 100644 (file)
@@ -1,2 +1,3 @@
 
 DEAL::Distance 1.75
+DEAL::Distance (1.75,0.00)

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.