From ddbe2006088a06cd515345ae0ca2732a422bebc5 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 25 May 2004 08:22:01 +0000 Subject: [PATCH] allow to set empty vectors to zero git-svn-id: https://svn.dealii.org/trunk@9310 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/vector.h | 12 ------------ deal.II/lac/include/lac/vector.templates.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/deal.II/lac/include/lac/vector.h b/deal.II/lac/include/lac/vector.h index 680127f737..63b2ba2b2f 100644 --- a/deal.II/lac/include/lac/vector.h +++ b/deal.II/lac/include/lac/vector.h @@ -279,7 +279,6 @@ class Vector * given in the discussion about making * the constructor explicit work. * - * * Since the semantics of assigning a * scalar to a vector are not * immediately clear, this operator @@ -919,17 +918,6 @@ Vector & Vector::operator /= (const Number factor) -template -inline -Vector & Vector::operator = (const Number s) -{ - Assert (dim!=0, ExcEmptyVector()); - std::fill (begin(), end(), s); - return *this; -} - - - template template inline diff --git a/deal.II/lac/include/lac/vector.templates.h b/deal.II/lac/include/lac/vector.templates.h index 07ea7fd246..737c7114e8 100644 --- a/deal.II/lac/include/lac/vector.templates.h +++ b/deal.II/lac/include/lac/vector.templates.h @@ -630,6 +630,18 @@ Vector::operator = (const Vector& v) +template +Vector & Vector::operator = (const Number s) +{ + if (s != 0.) + Assert (dim!=0, ExcEmptyVector()); + if (dim!=0) + std::fill (begin(), end(), s); + return *this; +} + + + #ifdef DEAL_II_USE_PETSC template -- 2.39.5