]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Some fixes with this-> and other assorted things to make icc7 (rightfully) happy.
authordeal <deal@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Jun 2004 14:13:24 +0000 (14:13 +0000)
committerdeal <deal@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Jun 2004 14:13:24 +0000 (14:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@9370 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_vector.templates.h
deal.II/lac/include/lac/petsc_block_vector.h

index f371605a29fc83cc6998bde0808a3cd3c68b2376..0f962dfd837a060f77e14648b1f655032111b066 100644 (file)
@@ -44,10 +44,10 @@ BlockVector<Number>::BlockVector (const BlockVector<Number>& 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; i<num_blocks; ++i)
-    components[i] = v.components[i];
+  for (unsigned int i=0; i<this->num_blocks; ++i)
+    this->components[i] = v.components[i];
 }
 
 
@@ -79,8 +79,8 @@ void BlockVector<Number>::reinit (const std::vector<unsigned int> &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; i<this->num_blocks; ++i)
     this->components[i].reinit(n[i], fast);
@@ -94,8 +94,8 @@ void BlockVector<Number>::reinit (const BlockVector<Number2>& 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;i<this->num_blocks;++i)
     this->block(i).reinit(v.block(i), fast);
@@ -111,12 +111,12 @@ BlockVector<Number>::~BlockVector ()
 template <typename Number>
 void BlockVector<Number>::swap (BlockVector<Number> &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; i<num_blocks; ++i)
-    ::swap (components[i], v.components[i]);
-  ::swap (block_indices, v.block_indices);
+  for (unsigned int i=0; i<this->num_blocks; ++i)
+    ::swap (this->components[i], v.components[i]);
+  ::swap (this->block_indices, v.block_indices);
 }
 
 
@@ -127,13 +127,13 @@ void BlockVector<Number>::print (std::ostream       &out,
                                 const bool          scientific,
                                 const bool          across) const
 {
-  for (unsigned int i=0;i<num_blocks;++i)
+  for (unsigned int i=0;i<this->num_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<Number>::print (std::ostream       &out,
 template <typename Number>
 void BlockVector<Number>::block_write (std::ostream &out) const
 {
-  for (unsigned int i=0;i<num_blocks;++i)
-    {
-      components[i].block_write(out);
-    }
+  for (unsigned int i=0;i<this->num_blocks;++i)
+    this->components[i].block_write(out);
 }
 
 
@@ -153,10 +151,8 @@ void BlockVector<Number>::block_write (std::ostream &out) const
 template <typename Number>
 void BlockVector<Number>::block_read (std::istream &in)
 {
-  for (unsigned int i=0;i<num_blocks;++i)
-    {
-      components[i].block_read(in);
-    }  
+  for (unsigned int i=0;i<this->num_blocks;++i)
+    this->components[i].block_read(in);
 }
 
 
@@ -164,10 +160,10 @@ template <typename Number>
 unsigned int
 BlockVector<Number>::memory_consumption () const
 {
-  unsigned int mem = sizeof(num_blocks);
-  for (unsigned int i=0; i<components.size(); ++i)
-    mem += MemoryConsumption::memory_consumption (components[i]);
-  mem += MemoryConsumption::memory_consumption (block_indices);
+  unsigned int mem = sizeof(this->num_blocks);
+  for (unsigned int i=0; i<this->components.size(); ++i)
+    mem += MemoryConsumption::memory_consumption (this->components[i]);
+  mem += MemoryConsumption::memory_consumption (this->block_indices);
   return mem;
 }
 
index 651a381206b78a56446820375d3a7a64ffaa2ed2..b1094f51c3bf4866b9c36bf73ac28abd124025b0 100644 (file)
@@ -359,9 +359,10 @@ namespace PETScWrappers
       {
         InputIterator end = start;
         std::advance (end, static_cast<signed int>(n[b]));
-        std::copy (start, end, this->block(b).begin());
-        start = end;
-      };
+
+       for (unsigned int i=0; i<n[b]; ++i, ++start)
+         this->block(b)(i) = *start;
+      }
     Assert (start == end, ExcIteratorRangeDoesNotMatchVectorSize());
   }
 

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.