From: Wolfgang Bangerth Date: Tue, 6 Apr 2004 02:32:38 +0000 (+0000) Subject: New tests. X-Git-Tag: v8.0.0~15374 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2e383cea33aa2520d94b4afe61b0b798227932a;p=dealii.git New tests. git-svn-id: https://svn.dealii.org/trunk@8975 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/petsc_vector_assign_01.cc b/tests/bits/petsc_vector_assign_01.cc new file mode 100644 index 0000000000..2baccbbd3d --- /dev/null +++ b/tests/bits/petsc_vector_assign_01.cc @@ -0,0 +1,89 @@ +//---------------------------- petsc_vector_assign_01.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2004 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. +// +//---------------------------- petsc_vector_assign_01.cc --------------------------- + + +// when calling PETScWrappers::Vector::operator() (), the return type is a +// reference object, not a reference to the actual element. this leads to the +// funny situation that an assignment like v2(i)=v1(i) isn't really what it +// looks like: it tries to copy the reference objects, not the values they +// point to, as one would expect +// +// this was fixed 2004-04-05, and this test checks that it works + +#include "../tests.h" +#include +#include +#include +#include + + +void test (PETScWrappers::Vector &v, + PETScWrappers::Vector &w) +{ + // set the first vector + for (unsigned int i=0; i +#include +#include +#include + + +void test (PETScWrappers::Vector &v, + PETScWrappers::Vector &w) +{ + // set the first vector + for (unsigned int i=0; i