]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Move operator=(number), i.e. scalar fill, as inline function into the
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 16 Jan 2002 08:54:16 +0000 (08:54 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 16 Jan 2002 08:54:16 +0000 (08:54 +0000)
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
deal.II/lac/include/lac/vector.templates.h

index eb04c341666f6b60bbcd118938dc0f1334ef2a03..5fd37c96f6fc9c2d7624581c21d9748e04536ed9 100644 (file)
@@ -717,6 +717,18 @@ Vector<Number> & Vector<Number>::operator *= (const Number factor)
 
 
 
+
+template <typename Number>
+inline
+Vector<Number> & Vector<Number>::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
index 7598ac7f6ec2e29c18eb5c89c1e51f204cc0b087..e72a71677d35af721f56eb815cf3e510084ba48d 100644 (file)
@@ -487,16 +487,6 @@ void Vector<Number>::ratio (const Vector<Number> &a, const Vector<Number> &b)
 
 
 
-template <typename Number>
-Vector<Number>& Vector<Number>::operator = (const Number s)
-{
-  Assert (dim!=0, ExcEmptyVector());
-  std::fill (begin(), end(), s);
-  return *this;
-}
-
-
-
 template <typename Number>
 Vector<Number>&
 Vector<Number>::operator = (const Vector<Number>& v)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.