From: guido Date: Sat, 24 Nov 2001 14:30:30 +0000 (+0000) Subject: first equ template X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5f55cf28fceac7ad2ce781507cc611b77a53d91;p=dealii-svn.git first equ template git-svn-id: https://svn.dealii.org/trunk@5262 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/block_vector.h b/deal.II/lac/include/lac/block_vector.h index a9fd7c994c..54dfcc07d4 100644 --- a/deal.II/lac/include/lac/block_vector.h +++ b/deal.II/lac/include/lac/block_vector.h @@ -1029,9 +1029,10 @@ class BlockVector BlockVector & operator *= (const Number factor); /** - * U=a*V. Replacing. + * U=a*V. Assignment. */ - void equ (const Number a, const BlockVector& V); + template + void equ (const Number a, const BlockVector& V); /** * U=a*V+b*W. diff --git a/deal.II/lac/include/lac/block_vector.templates.h b/deal.II/lac/include/lac/block_vector.templates.h index 2b53f56671..7b0732e04c 100644 --- a/deal.II/lac/include/lac/block_vector.templates.h +++ b/deal.II/lac/include/lac/block_vector.templates.h @@ -452,8 +452,9 @@ void BlockVector::equ (const Number a, template +template void BlockVector::equ (const Number a, - const BlockVector& v) + const BlockVector& v) { Assert (num_blocks == v.num_blocks, ExcDimensionMismatch(num_blocks, v.num_blocks)); diff --git a/deal.II/lac/include/lac/vector.h b/deal.II/lac/include/lac/vector.h index 83e1363e1a..17c23268c2 100644 --- a/deal.II/lac/include/lac/vector.h +++ b/deal.II/lac/include/lac/vector.h @@ -417,9 +417,10 @@ class Vector void scale (const Vector &scaling_factors); /** - * U=a*V. Replacing. + * U=a*V. Assignment. */ - void equ (const Number a, const Vector& V); + template + void equ (const Number a, const Vector& V); /** * U=a*V+b*W. diff --git a/deal.II/lac/include/lac/vector.templates.h b/deal.II/lac/include/lac/vector.templates.h index a1850e4fd7..0fc76cfac2 100644 --- a/deal.II/lac/include/lac/vector.templates.h +++ b/deal.II/lac/include/lac/vector.templates.h @@ -454,13 +454,14 @@ void Vector::equ (const Number a, const Vector& u, template -void Vector::equ (const Number a, const Vector& u) +template +void Vector::equ (const Number a, const Vector& 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::const_iterator u_ptr = u.begin(); while (i_ptr!=i_end) *i_ptr++ = a * *u_ptr++; } diff --git a/deal.II/lac/source/block_vector.cc b/deal.II/lac/source/block_vector.cc index b4cf91a8e9..195ab611e2 100644 --- a/deal.II/lac/source/block_vector.cc +++ b/deal.II/lac/source/block_vector.cc @@ -19,12 +19,16 @@ template BlockVector& BlockVector::operator=( const BlockVector&); template void BlockVector::reinit(const BlockVector&, bool); template void BlockVector::reinit(const BlockVector&, bool); +template void BlockVector::equ(double, const BlockVector&); +template void BlockVector::equ(double, const BlockVector&); template class BlockVector; template BlockVector& BlockVector::operator=( const BlockVector&); template void BlockVector::reinit(const BlockVector&, bool); template void BlockVector::reinit(const BlockVector&, bool); +template void BlockVector::equ(float, const BlockVector&); +template void BlockVector::equ(float, const BlockVector&); namespace BlockVectorIterators { diff --git a/deal.II/lac/source/vector.cc b/deal.II/lac/source/vector.cc index 73a210a9be..7a960f80d9 100644 --- a/deal.II/lac/source/vector.cc +++ b/deal.II/lac/source/vector.cc @@ -21,6 +21,8 @@ template double Vector::operator*(const Vector&) const; template double Vector::operator*(const Vector&) const; template void Vector::reinit(const Vector&, bool); template void Vector::reinit(const Vector&, bool); +template void Vector::equ(double, const Vector&); +template void Vector::equ(double, const Vector&); template class Vector; template Vector& Vector::operator=(const Vector&); @@ -28,6 +30,8 @@ template float Vector::operator*(const Vector&) const; template float Vector::operator*(const Vector&) const; template void Vector::reinit(const Vector&, bool); template void Vector::reinit(const Vector&, bool); +template void Vector::equ(float, const Vector&); +template void Vector::equ(float, const Vector&); // see the .h file for why these functions are disabled. // template Vector::Vector (const Vector& v); diff --git a/deal.II/lac/source/vector.long_double.cc b/deal.II/lac/source/vector.long_double.cc index 55ba19b90c..8fd4269532 100644 --- a/deal.II/lac/source/vector.long_double.cc +++ b/deal.II/lac/source/vector.long_double.cc @@ -17,16 +17,28 @@ // explicit instantiations template class Vector; -template Vector& Vector::operator=(const Vector&); template Vector& Vector::operator=(const Vector&); +template Vector& Vector::operator=(const Vector&); +template long double Vector::operator * (const Vector &) const; +template long double Vector::operator * (const Vector &) const; +template long double Vector::operator * (const Vector &) const; +template void Vector::reinit(const Vector&, bool); +template void Vector::reinit(const Vector&, bool); +template void Vector::reinit(const Vector&, bool); +template void Vector::equ(long double, const Vector&); +template void Vector::equ(long double, const Vector&); +template void Vector::equ(long double, const Vector&); + template Vector& Vector::operator=(const Vector&); -template Vector& Vector::operator=(const Vector&); +template double Vector::operator * (const Vector &) const; +template void Vector::reinit(const Vector&, bool); +template void Vector::equ(double, const Vector&); +template Vector& Vector::operator=(const Vector&); template float Vector::operator * (const Vector &) const; -template double Vector::operator * (const Vector &) const; -template long double Vector::operator * (const Vector &) const; -template long double Vector::operator * (const Vector &) const; -template long double Vector::operator * (const Vector &) const; +template void Vector::reinit(const Vector&, bool); +template void Vector::equ(float, const Vector&); + // see the .h file for why these functions are disabled. // template Vector::Vector (const Vector& v); // template Vector::Vector (const Vector& v);