From: kanschat Date: Mon, 18 Sep 2006 01:09:19 +0000 (+0000) Subject: test for new PointerMatrixVector X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7a0810d70a09f05b6f0f141a3c446f431c3c85b;p=dealii-svn.git test for new PointerMatrixVector git-svn-id: https://svn.dealii.org/trunk@13915 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/lac/Makefile b/tests/lac/Makefile index ea9dbddfb7..6be139206e 100644 --- a/tests/lac/Makefile +++ b/tests/lac/Makefile @@ -26,7 +26,7 @@ tests_x = vector-vector \ sparsity_pattern sparse_matrices matrices \ block_sparsity_pattern_01 \ block_vector block_vector_* block_matrices \ - matrix_lib matrix_out pointer_matrix \ + matrix_lib matrix_out pointer_matrix pointer_matrix_vector \ solver eigen \ sparse_ilu sparse_ilu_t lapack_fill block_minres \ identity_matrix* trace diff --git a/tests/lac/pointer_matrix_vector.cc b/tests/lac/pointer_matrix_vector.cc new file mode 100644 index 0000000000..1614bad513 --- /dev/null +++ b/tests/lac/pointer_matrix_vector.cc @@ -0,0 +1,61 @@ +//---------------------------------------------------------------------- +// $Id: pointer_matrix.cc 13349 2006-07-07 09:39:32Z guido $ +// 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. +// +//---------------------------------------------------------------------- + +// Test vmult and Tvmult of PointerMatrixVector + +#include +#include +#include + +#include + +int main() +{ + std::ofstream logfile("pointer_matrix_vector/output"); + deallog.attach(logfile); + deallog.depth_console(0); + + Vector u(5); + Vector v(5); + Vector w(1); + Vector x(5); + Vector y(5); + Vector z(1); + + + for (unsigned int i=0;i Mu(&u); + Mu.vmult(w,v); + deallog << "vmult " << w(0) << std::endl << "Tvmult"; + w(0) = 2.; + Mu.Tvmult(v,w); + for (unsigned int i=0;i Mx(&x); + Mx.vmult(z,y); + deallog << "vmult " << z(0) << std::endl << "Tvmult"; + z(0) = 2.; + Mx.Tvmult(y,z); + for (unsigned int i=0;i