From 0609e64391d8941cff3939a55402b92dbaed17b3 Mon Sep 17 00:00:00 2001 From: Ralf Hartmann Date: Mon, 27 Feb 2006 12:34:41 +0000 Subject: [PATCH] Check fill function. git-svn-id: https://svn.dealii.org/trunk@12506 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/lac/lapack_fill.cc | 48 +++++++++++++++++++++++++++++++ tests/lac/lapack_fill/cmp/generic | 2 ++ 2 files changed, 50 insertions(+) create mode 100644 tests/lac/lapack_fill.cc create mode 100644 tests/lac/lapack_fill/cmp/generic diff --git a/tests/lac/lapack_fill.cc b/tests/lac/lapack_fill.cc new file mode 100644 index 0000000000..db50d750d1 --- /dev/null +++ b/tests/lac/lapack_fill.cc @@ -0,0 +1,48 @@ +//------------------------- lapack_fill.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2006 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. +// +//------------------------- lapack_fill.cc --------------------------- + + +#include "../tests.h" +#include +#include +#include + +// A.fill() produced an ExcIndexRange(r,0,m()) exception with +// the additional Information: Index 6 is not in [0,3[. +// Bug reported by Florian Prill + +int main () +{ + std::ofstream logfile("lapack_fill/output"); + deallog.attach(logfile); + deallog.depth_console(0); + + // matrix sizes + const unsigned int m = 3; + const unsigned int n = 10; + + LAPACKFullMatrix A(n); + FullMatrix C(m); + // fill some entries: + C(0,0) = 1.0; + C(m-1,m-1) = 1.0; + // insert C into A's middle: + A.fill(C, + 3,3, + 0,0); + // check some values + Assert(A(3,3)==1, ExcInternalError()); + Assert(A(5,5)==1, ExcInternalError()); + + deallog << "OK" << std::endl; +} diff --git a/tests/lac/lapack_fill/cmp/generic b/tests/lac/lapack_fill/cmp/generic new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/lac/lapack_fill/cmp/generic @@ -0,0 +1,2 @@ + +DEAL::OK -- 2.39.5