From: David Wells Date: Thu, 17 Dec 2015 21:10:19 +0000 (-0500) Subject: Add a test for the generalized shifted matrix. X-Git-Tag: v8.4.0-rc2~149^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a46b125ff416cdbdf6da42dcf8145410e64bfe32;p=dealii.git Add a test for the generalized shifted matrix. --- diff --git a/tests/lac/shifted_matrix_generalized_01.cc b/tests/lac/shifted_matrix_generalized_01.cc new file mode 100644 index 0000000000..47aa057a3d --- /dev/null +++ b/tests/lac/shifted_matrix_generalized_01.cc @@ -0,0 +1,43 @@ +#include + +#include +#include +#include + +#include + +int main() +{ + using namespace dealii; + + std::ofstream logfile("output"); + deallog << std::fixed; + deallog << std::setprecision(4); + deallog.attach(logfile); + deallog.threshold_double(1.e-10); + + FullMatrix m1(2, 2); + FullMatrix m2(2, 2); + + m1(0, 0) = 2.0; + m1(0, 1) = 1.0; + m1(1, 0) = 1.0; + m1(1, 1) = 2.0; + + m2(0, 0) = 1.0; + m2(0, 1) = 1.0; + m2(1, 0) = 1.0; + m2(1, 1) = 1.0; + + ShiftedMatrixGeneralized, FullMatrix, Vector > + shifted_matrix(m1, m2, 2.0); + + Vector src(2); + src[0] = 3.0; + src[1] = 7.0; + Vector dst(2); + shifted_matrix.vmult(dst, src); + + deallog << dst[0] << ", "; + deallog << dst[1] << std::endl; +} diff --git a/tests/lac/shifted_matrix_generalized_01.output b/tests/lac/shifted_matrix_generalized_01.output new file mode 100644 index 0000000000..e40ef7690c --- /dev/null +++ b/tests/lac/shifted_matrix_generalized_01.output @@ -0,0 +1,2 @@ + +DEAL::33.0000, 37.0000