From c6523b07cddd153295429a7eb2637ceb313d88b7 Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 16 Jan 2002 08:54:16 +0000 Subject: [PATCH] Move operator=(number), i.e. scalar fill, as inline function into the header file. Reasons: 1/ can be optimized out by the compiler if fill value == 0 (memset) 2/ works around a recent linker error in the base tests git-svn-id: https://svn.dealii.org/trunk@5381 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/vector.h | 12 ++++++++++++ deal.II/lac/include/lac/vector.templates.h | 10 ---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/deal.II/lac/include/lac/vector.h b/deal.II/lac/include/lac/vector.h index eb04c34166..5fd37c96f6 100644 --- a/deal.II/lac/include/lac/vector.h +++ b/deal.II/lac/include/lac/vector.h @@ -717,6 +717,18 @@ 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; +} + + + /** * Global function @p{swap} which overloads the default implementation * of the C++ standard library which uses a temporary object. The diff --git a/deal.II/lac/include/lac/vector.templates.h b/deal.II/lac/include/lac/vector.templates.h index 7598ac7f6e..e72a71677d 100644 --- a/deal.II/lac/include/lac/vector.templates.h +++ b/deal.II/lac/include/lac/vector.templates.h @@ -487,16 +487,6 @@ void Vector::ratio (const Vector &a, const Vector &b) -template -Vector& Vector::operator = (const Number s) -{ - Assert (dim!=0, ExcEmptyVector()); - std::fill (begin(), end(), s); - return *this; -} - - - template Vector& Vector::operator = (const Vector& v) -- 2.39.5