From: wolf Date: Wed, 16 Jan 2002 08:54:16 +0000 (+0000) Subject: Move operator=(number), i.e. scalar fill, as inline function into the X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6523b07cddd153295429a7eb2637ceb313d88b7;p=dealii-svn.git 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 --- 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)