]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
test for lapack eigenvalue solver for symmetric matrices with additional options...
authorwillems <willems@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 19 Mar 2012 13:57:10 +0000 (13:57 +0000)
committerwillems <willems@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 19 Mar 2012 13:57:10 +0000 (13:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@25301 0785d39b-7218-0410-832d-ea1e28bc413d

tests/lapack/full_matrix_05/exe
tests/lapack/full_matrix_06/exe
tests/lapack/full_matrix_07.cc [new file with mode: 0644]
tests/lapack/full_matrix_07/cmp/generic [new file with mode: 0644]
tests/lapack/full_matrix_07/exe [new file with mode: 0755]
tests/lapack/full_matrix_07/output [new file with mode: 0644]
tests/lapack/full_matrix_07/status [new file with mode: 0644]

index cbb9b4c329ee564a80228998184ec69b22233731..0c5a9e59e37e47ea06f1a991ee4c6477eb8372f0 100755 (executable)
Binary files a/tests/lapack/full_matrix_05/exe and b/tests/lapack/full_matrix_05/exe differ
index 87afd3a58479ef3f1bebd62bdf87f11c3c2dd3f3..80ece70cc34276a13bc0be186e6f3f2d341776c4 100755 (executable)
Binary files a/tests/lapack/full_matrix_06/exe and b/tests/lapack/full_matrix_06/exe differ
diff --git a/tests/lapack/full_matrix_07.cc b/tests/lapack/full_matrix_07.cc
new file mode 100644 (file)
index 0000000..da36861
--- /dev/null
@@ -0,0 +1,70 @@
+//--------------------------------------------------------------------
+//    $Id: full_matrix_05.cc 23710 2011-05-17 04:50:10Z bangerth $
+//    Version: $Name$ 
+//
+//    Copyright (C) 2005, 2006, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//--------------------------------------------------------------------
+
+// Tests eigenvalues of FullMatrix
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/lapack_full_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+#include <float.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+const double left[] =
+{
+  
+   1.75, -0.433012701892219, 0.0, 0.0,
+   -0.433012701892219, 1.25, 0.0, 0.0,
+   0.0, 0.0, 3.5, -0.5,
+   0.0, 0.0, -0.5, 3.5
+};
+
+
+
+int main()
+{
+  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  std::ofstream logfile(logname.c_str());
+  logfile.precision(1);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  
+  FullMatrix<double> A(4,4,left);
+  LAPACKFullMatrix<double> LA(4,4);                   
+  LA = A;
+  FullMatrix<double> eigenvectors;
+  Vector<double> eigenvalues(0);
+  
+  LA.compute_eigenvalues_symmetric (0.5, 2.5,
+                                   2.0*DBL_MIN,
+                                   eigenvalues,
+                                   eigenvectors);
+  
+  for (unsigned int i=0;i<eigenvalues.size();++i)
+    {
+      deallog << "eigenvalue "
+             << std::scientific << eigenvalues(i) << std::endl
+             << "eigenvector ";
+      for (unsigned int j=0;j<A.m();++j)
+       {
+         deallog << std::scientific 
+                 << eigenvectors(j,i)/eigenvectors(0,i)
+                 << '\t';
+       }
+      deallog << std::endl;
+    }
+}
diff --git a/tests/lapack/full_matrix_07/cmp/generic b/tests/lapack/full_matrix_07/cmp/generic
new file mode 100644 (file)
index 0000000..0e19f19
--- /dev/null
@@ -0,0 +1,5 @@
+
+DEAL::eigenvalue 1.000000e+00
+DEAL::eigenvector 1.000000e+00 1.732051e+00    0.000000e+00    0.000000e+00    
+DEAL::eigenvalue 2.000000e+00
+DEAL::eigenvector 1.000000e+00 -5.773503e-01   0.000000e+00    0.000000e+00    
diff --git a/tests/lapack/full_matrix_07/exe b/tests/lapack/full_matrix_07/exe
new file mode 100755 (executable)
index 0000000..a2a6b5e
Binary files /dev/null and b/tests/lapack/full_matrix_07/exe differ
diff --git a/tests/lapack/full_matrix_07/output b/tests/lapack/full_matrix_07/output
new file mode 100644 (file)
index 0000000..0e19f19
--- /dev/null
@@ -0,0 +1,5 @@
+
+DEAL::eigenvalue 1.000000e+00
+DEAL::eigenvector 1.000000e+00 1.732051e+00    0.000000e+00    0.000000e+00    
+DEAL::eigenvalue 2.000000e+00
+DEAL::eigenvector 1.000000e+00 -5.773503e-01   0.000000e+00    0.000000e+00    
diff --git a/tests/lapack/full_matrix_07/status b/tests/lapack/full_matrix_07/status
new file mode 100644 (file)
index 0000000..ce1b499
--- /dev/null
@@ -0,0 +1 @@
+diff ok

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.