]> https://gitweb.dealii.org/ - dealii.git/commitdiff
first equ template
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Sat, 24 Nov 2001 14:30:30 +0000 (14:30 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Sat, 24 Nov 2001 14:30:30 +0000 (14:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@5262 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_vector.h
deal.II/lac/include/lac/block_vector.templates.h
deal.II/lac/include/lac/vector.h
deal.II/lac/include/lac/vector.templates.h
deal.II/lac/source/block_vector.cc
deal.II/lac/source/vector.cc
deal.II/lac/source/vector.long_double.cc

index a9fd7c994c5d36723106d4db7c9c215f64f3bace..54dfcc07d4100032029d7d6933ab77aa237fb056 100644 (file)
@@ -1029,9 +1029,10 @@ class BlockVector
     BlockVector<Number> & operator *= (const Number factor);
 
                                     /**
-                                     *  U=a*V. Replacing.
+                                     *  U=a*V. Assignment.
                                      */
-    void equ (const Number a, const BlockVector<Number>& V);
+    template <typename Number2>
+    void equ (const Number a, const BlockVector<Number2>& V);
     
                                     /**
                                      * U=a*V+b*W.
index 2b53f56671751ea8a86208ceeced82b321633651..7b0732e04c411127fe999a079b264b385612069b 100644 (file)
@@ -452,8 +452,9 @@ void BlockVector<Number>::equ (const Number a,
 
 
 template <typename Number>
+template <typename Number2>
 void BlockVector<Number>::equ (const Number a,
-                              const BlockVector<Number>& v)
+                              const BlockVector<Number2>& v)
 {
   Assert (num_blocks == v.num_blocks,
          ExcDimensionMismatch(num_blocks, v.num_blocks));
index 83e1363e1a10ba48d91d34efa34dc29ebb2215fa..17c23268c229ef2c6fecfa93e8c4fc652df81bf9 100644 (file)
@@ -417,9 +417,10 @@ class Vector
     void scale (const Vector<Number> &scaling_factors);
     
                                     /**
-                                     *  U=a*V. Replacing.
+                                     *  U=a*V. Assignment.
                                      */
-    void equ (const Number a, const Vector<Number>& V);
+    template <typename Number2>
+    void equ (const Number a, const Vector<Number2>& V);
     
                                     /**
                                      * U=a*V+b*W.
index a1850e4fd7c9f716d795ca0bc1b07ff28c673bbd..0fc76cfac28f69d0282dcea7a4f3c90c01f3b6dc 100644 (file)
@@ -454,13 +454,14 @@ void Vector<Number>::equ (const Number a, const Vector<Number>& u,
 
 
 template <typename Number>
-void Vector<Number>::equ (const Number a, const Vector<Number>& u)
+template <typename Number2>
+void Vector<Number>::equ (const Number a, const Vector<Number2>& u)
 {
   Assert (dim!=0, ExcEmptyVector());
   Assert (dim == u.dim, ExcDimensionMismatch(dim, u.dim));
   iterator i_ptr = begin(),
           i_end = end();
-  const_iterator u_ptr = u.begin();
+  typename Vector<Number2>::const_iterator u_ptr = u.begin();
   while (i_ptr!=i_end)
     *i_ptr++ = a * *u_ptr++;
 }
index b4cf91a8e9a4b7e49a33af7be20f2786ce0d33d1..195ab611e2baad3ab223d608108ed6c4706c692c 100644 (file)
@@ -19,12 +19,16 @@ template BlockVector<double>& BlockVector<double>::operator=(
   const BlockVector<float>&);
 template void BlockVector<double>::reinit(const BlockVector<double>&, bool);
 template void BlockVector<double>::reinit(const BlockVector<float>&, bool);
+template void BlockVector<double>::equ(double, const BlockVector<double>&);
+template void BlockVector<double>::equ(double, const BlockVector<float>&);
 
 template class BlockVector<float>;
 template BlockVector<float>& BlockVector<float>::operator=(
   const BlockVector<double>&);
 template void BlockVector<float>::reinit(const BlockVector<double>&, bool);
 template void BlockVector<float>::reinit(const BlockVector<float>&, bool);
+template void BlockVector<float>::equ(float, const BlockVector<double>&);
+template void BlockVector<float>::equ(float, const BlockVector<float>&);
 
 namespace BlockVectorIterators
 {
index 73a210a9be24d298f7843aa498d3b509dd655fce..7a960f80d9f779fd72b39f7879293a8941d43626 100644 (file)
@@ -21,6 +21,8 @@ template double Vector<double>::operator*(const Vector<float>&) const;
 template double Vector<double>::operator*(const Vector<double>&) const;
 template void Vector<double>::reinit(const Vector<double>&, bool);
 template void Vector<double>::reinit(const Vector<float>&, bool);
+template void Vector<double>::equ(double, const Vector<double>&);
+template void Vector<double>::equ(double, const Vector<float>&);
 
 template class Vector<float>;
 template Vector<float>& Vector<float>::operator=(const Vector<double>&);
@@ -28,6 +30,8 @@ template float Vector<float>::operator*(const Vector<float>&) const;
 template float Vector<float>::operator*(const Vector<double>&) const;
 template void Vector<float>::reinit(const Vector<double>&, bool);
 template void Vector<float>::reinit(const Vector<float>&, bool);
+template void Vector<float>::equ(float, const Vector<double>&);
+template void Vector<float>::equ(float, const Vector<float>&);
 
 // see the .h file for why these functions are disabled.
 // template Vector<float>::Vector (const Vector<double>& v);
index 55ba19b90ce97da2dd0b0ff8a85c8a19b57d92a8..8fd4269532093a7b913df403bfaa28e395f71ae4 100644 (file)
 // explicit instantiations
 template class Vector<long double>;
 
-template Vector<long double>& Vector<long double>::operator=(const Vector<float>&);
 template Vector<long double>& Vector<long double>::operator=(const Vector<double>&);
+template Vector<long double>& Vector<long double>::operator=(const Vector<float>&);
+template long double Vector<long double>::operator * (const Vector<long double> &) const;
+template long double Vector<long double>::operator * (const Vector<double> &) const;
+template long double Vector<long double>::operator * (const Vector<float> &) const;
+template void Vector<long double>::reinit(const Vector<long double>&, bool);
+template void Vector<long double>::reinit(const Vector<double>&, bool);
+template void Vector<long double>::reinit(const Vector<float>&, bool);
+template void Vector<long double>::equ(long double, const Vector<long double>&);
+template void Vector<long double>::equ(long double, const Vector<double>&);
+template void Vector<long double>::equ(long double, const Vector<float>&);
+
 template Vector<double>& Vector<double>::operator=(const Vector<long double>&);
-template Vector<float>& Vector<float>::operator=(const Vector<long double>&);
+template double Vector<double>::operator * (const Vector<long double> &) const;
+template void Vector<double>::reinit(const Vector<long double>&, bool);
+template void Vector<double>::equ(double, const Vector<long double>&);
 
+template Vector<float>& Vector<float>::operator=(const Vector<long double>&);
 template float Vector<float>::operator * (const Vector<long double> &) const;
-template double Vector<double>::operator * (const Vector<long double> &) const;
-template long double Vector<long double>::operator * (const Vector<float> &) const;
-template long double Vector<long double>::operator * (const Vector<double> &) const;
-template long double Vector<long double>::operator * (const Vector<long double> &) const;
+template void Vector<float>::reinit(const Vector<long double>&, bool);
+template void Vector<float>::equ(float, const Vector<long double>&);
+
 // see the .h file for why these functions are disabled.
 // template Vector<float>::Vector (const Vector<double>& v);
 // template Vector<double>::Vector (const Vector<float>& 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.