From: Ralf Hartmann Date: Tue, 15 May 2001 16:07:08 +0000 (+0000) Subject: Make several functions inline, to avoid base depending on lac. X-Git-Tag: v8.0.0~19182 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7eec28d700502caa0253b821da27eddc85d8e54;p=dealii.git Make several functions inline, to avoid base depending on lac. git-svn-id: https://svn.dealii.org/trunk@4609 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/vector.h b/deal.II/lac/include/lac/vector.h index 424702455b..a852fff4e3 100644 --- a/deal.II/lac/include/lac/vector.h +++ b/deal.II/lac/include/lac/vector.h @@ -516,6 +516,72 @@ class Vector /*----------------------- Inline functions ----------------------------------*/ + +template +inline +Vector::Vector () : + dim(0), + maxdim(0), + val(0) +{} + + +template +inline +Vector::Vector (const unsigned int n) : + dim(0), + maxdim(0), + val(0) +{ + reinit (n, false); +} + + +template +inline +Vector::~Vector () +{ + if (val) + { + delete[] val; + val=0; + } +} + + +template +inline +void Vector::reinit (const unsigned int n, const bool fast) { + if (n==0) + { + if (val) delete[] val; + val = 0; + maxdim = dim = 0; + return; + }; + + if (n>maxdim) + { + if (val) delete[] val; + val = new Number[n]; + Assert (val != 0, ExcOutOfMemory()); + maxdim = n; + }; + dim = n; + if (fast == false) + clear (); +} + + +template +inline +void Vector::clear () +{ + if (dim>0) + std::fill (begin(), end(), 0.); +} + + template inline unsigned int Vector::size () const diff --git a/deal.II/lac/include/lac/vector.templates.h b/deal.II/lac/include/lac/vector.templates.h index d6442e10ae..a592039928 100644 --- a/deal.II/lac/include/lac/vector.templates.h +++ b/deal.II/lac/include/lac/vector.templates.h @@ -27,23 +27,6 @@ static inline Number sqr (const Number x) }; -template -Vector::Vector () : - dim(0), - maxdim(0), - val(0) -{} - - -template -Vector::Vector (const unsigned int n) : - dim(0), - maxdim(0), - val(0) -{ - reinit (n, false); -} - template Vector::Vector (const Vector& v) : @@ -78,37 +61,6 @@ Vector::Vector (const Vector& v) : // } -template -Vector::~Vector () -{ - if (val) delete[] val; -} - - - -template -void Vector::reinit (const unsigned int n, const bool fast) { - if (n==0) - { - if (val) delete[] val; - val = 0; - maxdim = dim = 0; - return; - }; - - if (n>maxdim) - { - if (val) delete[] val; - val = new Number[n]; - Assert (val != 0, ExcOutOfMemory()); - maxdim = n; - }; - dim = n; - if (fast == false) - clear (); -} - - template void Vector::reinit (const Vector& v, const bool fast) { @@ -116,14 +68,6 @@ void Vector::reinit (const Vector& v, const bool fast) }; -template -void Vector::clear () -{ - if (dim>0) - std::fill (begin(), end(), 0.); -} - - template void