From: deal Date: Thu, 3 Jun 2004 14:13:24 +0000 (+0000) Subject: Some fixes with this-> and other assorted things to make icc7 (rightfully) happy. X-Git-Tag: v8.0.0~15089 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82684d8af0adf36cce2c6895638d9792f7745a14;p=dealii.git Some fixes with this-> and other assorted things to make icc7 (rightfully) happy. git-svn-id: https://svn.dealii.org/trunk@9370 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/block_vector.templates.h b/deal.II/lac/include/lac/block_vector.templates.h index f371605a29..0f962dfd83 100644 --- a/deal.II/lac/include/lac/block_vector.templates.h +++ b/deal.II/lac/include/lac/block_vector.templates.h @@ -44,10 +44,10 @@ BlockVector::BlockVector (const BlockVector& v) { this->components.resize (v.num_blocks); this->block_indices = v.block_indices; - num_blocks = v.num_blocks; + this->num_blocks = v.num_blocks; - for (unsigned int i=0; inum_blocks; ++i) + this->components[i] = v.components[i]; } @@ -79,8 +79,8 @@ void BlockVector::reinit (const std::vector &n, { this->block_indices.reinit (n); this->num_blocks = n.size(); - if (this->components.size() != num_blocks) - this->components.resize(num_blocks); + if (this->components.size() != this->num_blocks) + this->components.resize(this->num_blocks); for (unsigned int i=0; inum_blocks; ++i) this->components[i].reinit(n[i], fast); @@ -94,8 +94,8 @@ void BlockVector::reinit (const BlockVector& v, { this->block_indices = v.get_block_indices(); this->num_blocks = v.n_blocks(); - if (this->components.size() != num_blocks) - this->components.resize(num_blocks); + if (this->components.size() != this->num_blocks) + this->components.resize(this->num_blocks); for (unsigned int i=0;inum_blocks;++i) this->block(i).reinit(v.block(i), fast); @@ -111,12 +111,12 @@ BlockVector::~BlockVector () template void BlockVector::swap (BlockVector &v) { - Assert (num_blocks == v.num_blocks, - ExcDimensionMismatch(num_blocks, v.num_blocks)); + Assert (this->num_blocks == v.num_blocks, + ExcDimensionMismatch(this->num_blocks, v.num_blocks)); - for (unsigned int i=0; inum_blocks; ++i) + ::swap (this->components[i], v.components[i]); + ::swap (this->block_indices, v.block_indices); } @@ -127,13 +127,13 @@ void BlockVector::print (std::ostream &out, const bool scientific, const bool across) const { - for (unsigned int i=0;inum_blocks;++i) { if (across) out << 'C' << i << ':'; else out << "Component " << i << std::endl; - components[i].print(out, precision, scientific, across); + this->components[i].print(out, precision, scientific, across); } } @@ -142,10 +142,8 @@ void BlockVector::print (std::ostream &out, template void BlockVector::block_write (std::ostream &out) const { - for (unsigned int i=0;inum_blocks;++i) + this->components[i].block_write(out); } @@ -153,10 +151,8 @@ void BlockVector::block_write (std::ostream &out) const template void BlockVector::block_read (std::istream &in) { - for (unsigned int i=0;inum_blocks;++i) + this->components[i].block_read(in); } @@ -164,10 +160,10 @@ template unsigned int BlockVector::memory_consumption () const { - unsigned int mem = sizeof(num_blocks); - for (unsigned int i=0; inum_blocks); + for (unsigned int i=0; icomponents.size(); ++i) + mem += MemoryConsumption::memory_consumption (this->components[i]); + mem += MemoryConsumption::memory_consumption (this->block_indices); return mem; } diff --git a/deal.II/lac/include/lac/petsc_block_vector.h b/deal.II/lac/include/lac/petsc_block_vector.h index 651a381206..b1094f51c3 100644 --- a/deal.II/lac/include/lac/petsc_block_vector.h +++ b/deal.II/lac/include/lac/petsc_block_vector.h @@ -359,9 +359,10 @@ namespace PETScWrappers { InputIterator end = start; std::advance (end, static_cast(n[b])); - std::copy (start, end, this->block(b).begin()); - start = end; - }; + + for (unsigned int i=0; iblock(b)(i) = *start; + } Assert (start == end, ExcIteratorRangeDoesNotMatchVectorSize()); }