]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use different names for function arguments. 3473/head
authorDavid Wells <wellsd2@rpi.edu>
Sat, 5 Nov 2016 14:16:45 +0000 (10:16 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 5 Nov 2016 17:49:13 +0000 (13:49 -0400)
PreconditionBlock already has two members named 'permutation' and
'inverse_permutation' so this makes things a bit clearer.

I applied the same naming scheme to a separate function where previously
the variables were called 'p' and 'i'.

include/deal.II/lac/precondition_block.templates.h

index a8db1a5c9cf2fdb14f00caf2b9a9501a4796d6b8..1ca117434fb4f1e735bafbdf490a159302e4fb12 100644 (file)
@@ -104,11 +104,11 @@ void PreconditionBlock<MatrixType,inverse_type>::initialize
 template <typename MatrixType, typename inverse_type>
 void PreconditionBlock<MatrixType,inverse_type>::initialize
 (const MatrixType             &M,
- const std::vector<size_type> &permutation,
- const std::vector<size_type> &inverse_permutation,
+ const std::vector<size_type> &new_permutation,
+ const std::vector<size_type> &new_inverse_permutation,
  const AdditionalData          parameters)
 {
-  set_permutation(permutation, inverse_permutation);
+  set_permutation(new_permutation, new_inverse_permutation);
   initialize(M, parameters);
 }
 
@@ -515,23 +515,19 @@ void PreconditionBlock<MatrixType,inverse_type>::invert_diagblocks()
 
 template <typename MatrixType, typename inverse_type>
 void PreconditionBlock<MatrixType,inverse_type>::set_permutation
-(const std::vector<size_type> &p,
- const std::vector<size_type> &i)
+(const std::vector<size_type> &new_permutation,
+ const std::vector<size_type> &new_inverse_permutation)
 {
-  Assert (p.size() == i.size(), ExcDimensionMismatch(p.size(), i.size()));
+  AssertDimension (new_permutation.size(),
+                   new_inverse_permutation.size());
 
   if (this->inverses_ready())
     {
-      AssertDimension(p.size(), this->size());
+      AssertDimension(new_permutation.size(), this->size());
     }
 
-  permutation.resize(p.size());
-  inverse_permutation.resize(p.size());
-  for (unsigned int k=0; k<p.size(); ++k)
-    {
-      permutation[k] = p[k];
-      inverse_permutation[k] = i[k];
-    }
+  permutation = new_permutation;
+  inverse_permutation = new_inverse_permutation;
 }
 
 

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.