From: wolf Date: Tue, 20 Jul 1999 13:46:37 +0000 (+0000) Subject: Remove the old iVector class and all traces of it in the other classes. The functions... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86728b13b9ceb77c1529ba257d7f5919965ee403;p=dealii-svn.git Remove the old iVector class and all traces of it in the other classes. The functions using it as arguments are simply removed, while in one case iVector was replaced by vector. git-svn-id: https://svn.dealii.org/trunk@1607 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index 01158519d0..82d8a125b3 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -18,8 +18,6 @@ template class Vector; -class iVector; - /** @@ -518,15 +516,6 @@ class FullMatrix : public Subscriptor */ void diagadd (const number s); - /** - * w+=part(A)*v. Conditional partial - * Matrix-vector-multiplication

- * (used elements of v determined by x) - */ - template - void gsmult (Vector& w, const Vector& v, const iVector& x) const; - - /** * Output of the matrix in user-defined format. */ diff --git a/deal.II/lac/include/lac/full_matrix.templates.h b/deal.II/lac/include/lac/full_matrix.templates.h index 998cf0ad77..0be861f1fb 100644 --- a/deal.II/lac/include/lac/full_matrix.templates.h +++ b/deal.II/lac/include/lac/full_matrix.templates.h @@ -1,9 +1,9 @@ // $Id$ #include -#include #include +#include #include #include #include @@ -238,144 +238,9 @@ FullMatrix::vmult (Vector& dst, template template -void FullMatrix::gsmult (Vector& dst, const Vector& src, const iVector& gl) const -{ - Assert(n() == m(), ExcNotQuadratic()); - Assert(dst.size() == n(), ExcDimensionMismatch(dst.size(), n())); - Assert(src.size() == n(), ExcDimensionMismatch(src.size(), n())); - Assert(gl.n() == n(), ExcDimensionMismatch(gl.n(), n())); - - number2 s; - if ((n()==3) && (m()==3)) - { - number2 s0=0.,s1=0.,s2=0.; - s = src(0); - if(gl(1) -template -void FullMatrix::Tvmult (Vector& dst, - const Vector& src, - const bool adding) const +void FullMatrix::Tvmult (Vector &dst, + const Vector &src, + const bool adding) const { Assert(dst.size() == n(), ExcDimensionMismatch(dst.size(), n())); Assert(src.size() == m(), ExcDimensionMismatch(src.size(), m())); @@ -1393,12 +1258,13 @@ void FullMatrix::gauss_jordan() { Assert (dim_range == dim_image, ExcNotQuadratic()); - iVector p(n()); + vector p(n()); unsigned int i,j,k,r; number max, hr; - for (i=0; i::gauss_jordan() { hr = el(j,k) ; el(j,k) = el(r,k) ; el(r,k) = hr; } - i = p(j) ; p(j) = p(r) ; p(r) = i; + i = p[j]; + p[j] = p[r]; + p[r] = i; } // transformation @@ -1447,7 +1315,7 @@ FullMatrix::gauss_jordan() Vector hv(n()); for (i=0; i - - -/** - * Integer Vector. - * Memory for Components is supplied explicitly

- * ( ! Amount of memory needs not to comply with actual dimension due to reinitializations ! )

- * - all defined methods for iVectors are supplied

- * - operators available are `=` and `( )`

- * CONVENTIONS for used `equations` :

- * - THIS vector is always named `U`

- * - vectors are always uppercase , scalars are lowercase - */ -class iVector -{ - friend class dFMatrix; - - protected: - - /// Dimension. Actual number of components - unsigned int dim; - - /// Dimension. Determines amount of reserved memory , evtl. >DIM ! - unsigned int maxdim; - - /// Component-array. - int *val; - - public: - - /**@name 1: Basic Object-handling */ - //@{ - /** - * Dummy-Constructor. Dimension=1 - */ - iVector (); - - /** - * Copy-Constructor. Dimension set to that of V ,

- * all components are copied from V - */ - iVector (const iVector& V); - - /** - * Constructor. Dimension = N (>0) - */ - iVector (const unsigned int N); - - /** - * Destructor. Clears memory - */ - ~iVector (); - - /** - * U(0-N) = s . Fill all components - */ - iVector& operator = (const int s); - - /** - * U = V . Copy all components - */ - iVector& operator = (const iVector& V); - - /** - * Change Dimension.

- * Set dimension to N

- * ! reserved memory for This remains unchanged !

- * on fast==false vector is filled by 0. - */ - void reinit (const unsigned int N, const bool fast=false); - - /** - * Adjust Dimension.

- * Set dimension to n(V)

- * ! reserved memory for This remains unchanged !

- * ! components of V are not copied in any case !

- * on fast==false vector is filled by 0. - */ - void reinit (const iVector& V, const bool fast=false); - - /** - * Set all elements to zero. - */ - void clear (); - - /** - * Inquire Dimension. returns Dimension , - * INLINE - */ - unsigned int n () const; - //@} - - - /**@name 2: Data-Access - */ - //@{ - /** - * Access Components. returns U(i) , - * INLINE - */ - int operator() (const unsigned int i) const; - - /** - * Access Components. returns U(i) , - * INLINE - */ - int& operator() (const unsigned int i); - //@} - - - /**@name 3: Modification of vectors - */ - //@{ - /** - * U+=V . Simple addition - */ - void add (const iVector& V); - - /** - * U+=a*V . Simple addition - */ - void add (const unsigned int a, const iVector& V); - - /** - * U=a*V . Replacing - */ - void equ (const unsigned int a, const iVector& V); - //@} - - /** - * Exception - */ - DeclException2 (ExcInvalidIndex, - int, int, - << "The given index " << arg1 - << " should be less than " << arg2 << "."); - /** - * Exception - */ - DeclException1 (ExcInvalidNumber, - int, - << "The provided number is invalid here: " << arg1); - /** - * Exception - */ - DeclException0 (ExcOutOfMemory); -}; - - -/*-------------------------Inline functions -------------------------------*/ - - -inline unsigned int iVector::n() const -{ - return dim; -} - - - -inline int iVector::operator() (unsigned int i) const -{ - Assert (i class Vector; template class SparseMatrix; - -class iVector; class ostream; @@ -242,10 +240,6 @@ class SparseMatrixStruct : public Subscriptor ////////// void add_matrix (const unsigned int m, const unsigned int n, const int* rows, const int* cols); - ////////// - void add_matrix (const iVector& rowcols); - ////////// - void add_matrix (const iVector& rows, const iVector& cols); /** * Print the sparsity of the matrix diff --git a/deal.II/lac/source/full_matrix.double.cc b/deal.II/lac/source/full_matrix.double.cc index b88bd8fe80..5a7f56265d 100644 --- a/deal.II/lac/source/full_matrix.double.cc +++ b/deal.II/lac/source/full_matrix.double.cc @@ -40,7 +40,6 @@ template void FullMatrix::forward(Vector&, const Vector::backward(Vector&, const Vector&) const; template void FullMatrix::householder(Vector&); template double FullMatrix::least_squares(Vector&, Vector&); -template void FullMatrix::gsmult(Vector&, const Vector&, const iVector&) const; #undef TYPEVEC #define TYPEVEC float @@ -54,7 +53,6 @@ template void FullMatrix::forward(Vector&, const Vector::backward(Vector&, const Vector&) const; template void FullMatrix::householder(Vector&); template double FullMatrix::least_squares(Vector&, Vector&); -template void FullMatrix::gsmult(Vector&, const Vector&, const iVector&) const; #undef TYPERES #define TYPERES float diff --git a/deal.II/lac/source/full_matrix.float.cc b/deal.II/lac/source/full_matrix.float.cc index 13df552e31..e662511cc5 100644 --- a/deal.II/lac/source/full_matrix.float.cc +++ b/deal.II/lac/source/full_matrix.float.cc @@ -40,7 +40,6 @@ template void FullMatrix::forward(Vector&, const Vector::backward(Vector&, const Vector&) const; template void FullMatrix::householder(Vector&); template double FullMatrix::least_squares(Vector&, Vector&); -template void FullMatrix::gsmult(Vector&, const Vector&, const iVector&) const; #undef TYPEVEC #define TYPEVEC float @@ -54,7 +53,6 @@ template void FullMatrix::forward(Vector&, const Vector::backward(Vector&, const Vector&) const; template void FullMatrix::householder(Vector&); template double FullMatrix::least_squares(Vector&, Vector&); -template void FullMatrix::gsmult(Vector&, const Vector&, const iVector&) const; #undef TYPERES diff --git a/deal.II/lac/source/ivector.cc b/deal.II/lac/source/ivector.cc deleted file mode 100644 index ec95a5203c..0000000000 --- a/deal.II/lac/source/ivector.cc +++ /dev/null @@ -1,128 +0,0 @@ -// $Id$ - -// This file is part of the DEAL Library -// DEAL is Copyright(1995) by -// Roland Becker, Guido Kanschat, Franz-Theo Suttmeier - -#include - - - -iVector::iVector () : - dim(1), - maxdim(1), - val(new int[1]) -{ - Assert (val != 0, ExcOutOfMemory()); - clear (); -} - - -iVector::iVector (const unsigned int n) : - dim(n), - maxdim(n), - val(new int[n]) -{ - Assert (n>0, ExcInvalidNumber(n)); - - Assert (val != 0, ExcOutOfMemory()); - clear (); -} - - -iVector::iVector (const iVector& v) : - dim(v.dim), - maxdim(v.maxdim), - val(0) -{ - reinit(v.dim,1); - for (unsigned int i=0; i0, ExcInvalidNumber(n)); - if (n>maxdim) - { - if (val != 0) delete[] val; - val = new int[n]; - Assert (val != 0, ExcOutOfMemory()); - maxdim = n; - } - dim = n; - if (!fast) - clear (); -} - - - -void iVector::reinit (const iVector& v, const bool fast) -{ - const unsigned int n = v.n(); - if (n>maxdim) - { - delete[] val; - val = new int[n]; - Assert (val != 0, ExcOutOfMemory()); - maxdim = n; - } - dim = n; - if (!fast) - clear (); -} - - - -iVector::~iVector () -{ - if (val) - delete[] val; -} - - - -void iVector::clear () { - for (unsigned int i=0; i -#include #include #include @@ -455,30 +454,6 @@ SparseMatrixStruct::add_matrix (const unsigned int m, const unsigned int n, -void -SparseMatrixStruct::add_matrix (const iVector& rowcols) -{ - Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject()); - unsigned int i,j; - for (i=0;i