From 35409ba3be1e6a1ebb69c5f0fc360350ca0dc9e5 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Wed, 23 Mar 2005 15:22:44 +0000 Subject: [PATCH] bugs fixed git-svn-id: https://svn.dealii.org/trunk@10215 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/lapack_full_matrix.cc | 13 ++- tests/lac/Makefile | 2 +- tests/lac/lapack.cc | 108 +++++++++++++++++++++++ 3 files changed, 118 insertions(+), 5 deletions(-) create mode 100644 tests/lac/lapack.cc diff --git a/deal.II/lac/source/lapack_full_matrix.cc b/deal.II/lac/source/lapack_full_matrix.cc index 187b2b1c63..4d12f4e84c 100644 --- a/deal.II/lac/source/lapack_full_matrix.cc +++ b/deal.II/lac/source/lapack_full_matrix.cc @@ -14,6 +14,7 @@ #include #include #include +#include #include using namespace LAPACKSupport; @@ -55,10 +56,10 @@ template LAPACKFullMatrix & LAPACKFullMatrix::operator = (const FullMatrix& M) { - Assert (n() == M.m(), ExcDimensionMismatch(n(), M.m())); - Assert (n() == M.n(), ExcDimensionMismatch(n(), M.n())); - for (unsigned int i=0;i::Tvmult_add ( template LAPACKFullMatrix; +template LAPACKFullMatrix & +LAPACKFullMatrix::operator = (const FullMatrix& M); +template LAPACKFullMatrix & +LAPACKFullMatrix::operator = (const FullMatrix& M); diff --git a/tests/lac/Makefile b/tests/lac/Makefile index 6884ed1878..ae0260f6e4 100644 --- a/tests/lac/Makefile +++ b/tests/lac/Makefile @@ -26,7 +26,7 @@ tests_x = vector-vector \ block_vector block_vector_iterator block_matrices \ matrix_lib matrix_out \ solver eigen \ - sparse_ilu + sparse_ilu lapack # from above list of regular expressions, generate the real set of diff --git a/tests/lac/lapack.cc b/tests/lac/lapack.cc new file mode 100644 index 0000000000..0999e9b87f --- /dev/null +++ b/tests/lac/lapack.cc @@ -0,0 +1,108 @@ +//-------------------------------------------------------------------- +// $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 all aspects of LAPACKFullMatrix + +#include "../tests.h" +#include +#include +#include +#include + +#include +#include + +const double symm[] = +{ + 4., 1., -1., 1., + 1., 4., 1., -1., + -1., 1., 4., 1., + 1., -1., 4., 1. +}; + +const double rect[] = +{ + 4., 3., 2., 1., + 5., 8., 1., -2., + 11., 13., -4., -5 +}; + + +int main() +{ + std::ofstream logfile("lapack.output"); + logfile.precision(4); + deallog.attach(logfile); + deallog.depth_console(0); + +#ifdef HAVE_LIBLAPACK + FullMatrix A(3,4,rect); + LAPACKFullMatrix LA(3,4); + LA = A; + + Vector u(4); + Vector v1(3); + Vector v2(3); + + for (unsigned int i=0;i