From 0a57509533e7ec4346aff4b090aff9f95f98d953 Mon Sep 17 00:00:00 2001 From: guido Date: Sat, 16 Apr 2005 07:23:34 +0000 Subject: [PATCH] test HouseHolder git-svn-id: https://svn.dealii.org/trunk@10509 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/lac/Makefile | 2 +- tests/lac/householder.cc | 50 +++++++++++++++++++ .../lac/householder.output | 2 + 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/lac/householder.cc create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/lac/householder.output diff --git a/tests/lac/Makefile b/tests/lac/Makefile index ae0260f6e4..42fd73394d 100644 --- a/tests/lac/Makefile +++ b/tests/lac/Makefile @@ -21,7 +21,7 @@ default: run-tests ############################################################ tests_x = vector-vector \ - full_matrix tridiagonal_matrix \ + full_matrix householder tridiagonal_matrix \ sparsity_pattern sparse_matrices \ block_vector block_vector_iterator block_matrices \ matrix_lib matrix_out \ diff --git a/tests/lac/householder.cc b/tests/lac/householder.cc new file mode 100644 index 0000000000..d8597e9738 --- /dev/null +++ b/tests/lac/householder.cc @@ -0,0 +1,50 @@ +//-------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005 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 Householder class for QR-decomposition + +#include "../tests.h" +#include +#include +#include +#include + +#include +#include + +const double rect[] = +{ + 4., 3., 2., 1., + 5., 8., 1., -2., + 11., 13., -4., -5 +}; + + +int main() +{ + std::ofstream logfile("householder.output"); + logfile.precision(3); + deallog.attach(logfile); + deallog.depth_console(0); + + FullMatrix A(4,3,rect); + Householder H(A); + + Vector u(4); + Vector v1(3); + Vector v2(3); + + for (unsigned int i=0;i