]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename parallel::Vector::val to parallel::Vector::values.
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 20 Oct 2017 16:08:06 +0000 (10:08 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 20 Oct 2017 16:14:48 +0000 (10:14 -0600)
include/deal.II/lac/la_parallel_vector.h
include/deal.II/lac/la_parallel_vector.templates.h

index 6777f8d8c6e7cc70bb25377375304795b805bbab..798820126177a82be1d5b8c66d112822c47bd30f 100644 (file)
@@ -1083,7 +1083,7 @@ namespace LinearAlgebra
       /**
        * Pointer to the array of local elements of this vector.
        */
-      std::unique_ptr<Number[]> val;
+      std::unique_ptr<Number[]> values;
 
       /**
        * For parallel loops with TBB, this member variable stores the affinity
@@ -1263,7 +1263,7 @@ namespace LinearAlgebra
     typename Vector<Number>::iterator
     Vector<Number>::begin ()
     {
-      return val.get();
+      return values.get();
     }
 
 
@@ -1273,7 +1273,7 @@ namespace LinearAlgebra
     typename Vector<Number>::const_iterator
     Vector<Number>::begin () const
     {
-      return val.get();
+      return values.get();
     }
 
 
@@ -1283,7 +1283,7 @@ namespace LinearAlgebra
     typename Vector<Number>::iterator
     Vector<Number>::end ()
     {
-      return val.get()+partitioner->local_size();
+      return values.get()+partitioner->local_size();
     }
 
 
@@ -1293,7 +1293,7 @@ namespace LinearAlgebra
     typename Vector<Number>::const_iterator
     Vector<Number>::end () const
     {
-      return val.get()+partitioner->local_size();
+      return values.get()+partitioner->local_size();
     }
 
 
@@ -1312,7 +1312,7 @@ namespace LinearAlgebra
       Assert (partitioner->in_local_range (global_index) || vector_is_ghosted == true,
               ExcMessage("You tried to read a ghost element of this vector, "
                          "but it has not imported its ghost values."));
-      return val[partitioner->global_to_local(global_index)];
+      return values[partitioner->global_to_local(global_index)];
     }
 
 
@@ -1333,7 +1333,7 @@ namespace LinearAlgebra
       // (then, the compiler picks this method according to the C++ rule book
       // even if a human would pick the const method when this subsequent use
       // is just a read)
-      return val[partitioner->global_to_local (global_index)];
+      return values[partitioner->global_to_local (global_index)];
     }
 
 
@@ -1370,7 +1370,7 @@ namespace LinearAlgebra
       Assert (local_index < local_size() || vector_is_ghosted == true,
               ExcMessage("You tried to read a ghost element of this vector, "
                          "but it has not imported its ghost values."));
-      return val[local_index];
+      return values[local_index];
     }
 
 
@@ -1383,7 +1383,7 @@ namespace LinearAlgebra
       AssertIndexRange (local_index,
                         partitioner->local_size()+
                         partitioner->n_ghost_indices());
-      return val[local_index];
+      return values[local_index];
     }
 
 
index cbc8a6c145c254a5052700207751f486d2a085bf..80149e94548f0e65f9fcce5ba7c8e0a2faa33cef 100644 (file)
@@ -62,18 +62,18 @@ namespace LinearAlgebra
     {
       if (new_alloc_size > allocated_size)
         {
-          Assert (((allocated_size > 0 && val != nullptr) ||
-                   val == nullptr), ExcInternalError());
+          Assert (((allocated_size > 0 && values != nullptr) ||
+                   values == nullptr), ExcInternalError());
 
           Number *new_val;
           Utilities::System::posix_memalign ((void **)&new_val, 64, sizeof(Number)*new_alloc_size);
-          val.reset (new_val);
+          values.reset (new_val);
 
           allocated_size = new_alloc_size;
         }
       else if (new_alloc_size == 0)
         {
-          val.reset();
+          values.reset();
           allocated_size = 0;
         }
       thread_loop_partitioner.reset(new ::dealii::parallel::internal::TBBPartitioner());
@@ -204,7 +204,7 @@ namespace LinearAlgebra
       :
       partitioner (new Utilities::MPI::Partitioner()),
       allocated_size (0),
-      val (nullptr)
+      values (nullptr)
     {
       reinit(0);
     }
@@ -216,7 +216,7 @@ namespace LinearAlgebra
       :
       Subscriptor(),
       allocated_size (0),
-      val (nullptr),
+      values (nullptr),
       vector_is_ghosted (false)
     {
       reinit (v, true);
@@ -226,7 +226,7 @@ namespace LinearAlgebra
       const size_type this_size = local_size();
       if (this_size>0)
         {
-          dealii::internal::VectorOperations::Vector_copy<Number,Number> copier(v.val.get(), val.get());
+          dealii::internal::VectorOperations::Vector_copy<Number,Number> copier(v.values.get(), values.get());
           internal::VectorOperations::parallel_for(copier, 0, partitioner->local_size(),
                                                    thread_loop_partitioner);
         }
@@ -240,7 +240,7 @@ namespace LinearAlgebra
                             const MPI_Comm  communicator)
       :
       allocated_size (0),
-      val (nullptr),
+      values (nullptr),
       vector_is_ghosted (false)
     {
       reinit (local_range, ghost_indices, communicator);
@@ -253,7 +253,7 @@ namespace LinearAlgebra
                             const MPI_Comm  communicator)
       :
       allocated_size (0),
-      val (nullptr),
+      values (nullptr),
       vector_is_ghosted (false)
     {
       reinit (local_range, communicator);
@@ -265,7 +265,7 @@ namespace LinearAlgebra
     Vector<Number>::Vector (const size_type size)
       :
       allocated_size (0),
-      val (nullptr),
+      values (nullptr),
       vector_is_ghosted (false)
     {
       reinit (size, false);
@@ -278,7 +278,7 @@ namespace LinearAlgebra
     Vector (const std::shared_ptr<const Utilities::MPI::Partitioner> &partitioner)
       :
       allocated_size (0),
-      val (nullptr),
+      values (nullptr),
       vector_is_ghosted (false)
     {
       reinit (partitioner);
@@ -363,7 +363,7 @@ namespace LinearAlgebra
       const size_type this_size = local_size();
       if (this_size>0)
         {
-          dealii::internal::VectorOperations::Vector_copy<Number,Number2> copier(c.val.get(), val.get());
+          dealii::internal::VectorOperations::Vector_copy<Number,Number2> copier(c.values.get(), values.get());
           internal::VectorOperations::parallel_for(copier, 0, this_size,
                                                    thread_loop_partitioner);
         }
@@ -494,7 +494,7 @@ namespace LinearAlgebra
     void
     Vector<Number>::zero_out_ghosts ()
     {
-      std::fill_n (&val[partitioner->local_size()],
+      std::fill_n (&values[partitioner->local_size()],
                    partitioner->n_ghost_indices(),
                    Number());
       vector_is_ghosted = false;
@@ -522,7 +522,7 @@ namespace LinearAlgebra
 
       partitioner->import_from_ghosted_array_start
       (operation, counter,
-       ArrayView<Number>(val.get() + partitioner->local_size(),partitioner->n_ghost_indices()),
+       ArrayView<Number>(values.get() + partitioner->local_size(),partitioner->n_ghost_indices()),
        ArrayView<Number>(import_data.get(), partitioner->n_import_indices()),
        compress_requests);
 #endif
@@ -547,8 +547,8 @@ namespace LinearAlgebra
       partitioner->import_from_ghosted_array_finish
       (operation,
        ArrayView<const Number>(import_data.get(), partitioner->n_import_indices()),
-       ArrayView<Number>(val.get(), partitioner->local_size()),
-       ArrayView<Number>(val.get() + partitioner->local_size(),partitioner->n_ghost_indices()),
+       ArrayView<Number>(values.get(), partitioner->local_size()),
+       ArrayView<Number>(values.get() + partitioner->local_size(),partitioner->n_ghost_indices()),
        compress_requests);
 
       vector_is_ghosted = false;
@@ -577,9 +577,9 @@ namespace LinearAlgebra
 
       partitioner->export_to_ghosted_array_start
       (counter,
-       ArrayView<const Number>(val.get(), partitioner->local_size()),
+       ArrayView<const Number>(values.get(), partitioner->local_size()),
        ArrayView<Number>(import_data.get(), partitioner->n_import_indices()),
-       ArrayView<Number>(val.get() + partitioner->local_size(),partitioner->n_ghost_indices()),
+       ArrayView<Number>(values.get() + partitioner->local_size(),partitioner->n_ghost_indices()),
        update_ghost_values_requests);
 
 #else
@@ -605,7 +605,7 @@ namespace LinearAlgebra
           Threads::Mutex::ScopedLock lock (mutex);
 
           partitioner->export_to_ghosted_array_finish
-          (ArrayView<Number>(val.get() + partitioner->local_size(),partitioner->n_ghost_indices()),
+          (ArrayView<Number>(values.get() + partitioner->local_size(),partitioner->n_ghost_indices()),
            update_ghost_values_requests);
         }
 #endif
@@ -660,7 +660,7 @@ namespace LinearAlgebra
       IndexSet tmp_index_set = tmp_vector.locally_owned_elements();
       for (size_type i=0; i<tmp_index_set.n_elements(); ++i)
         {
-          val[locally_owned_elem.index_within_set(tmp_index_set.nth_index_in_set(i))] =
+          values[locally_owned_elem.index_within_set(tmp_index_set.nth_index_in_set(i))] =
             tmp_vector.local_element(i);
         }
     }
@@ -708,7 +708,7 @@ namespace LinearAlgebra
       std::swap (partitioner,       v.partitioner);
       std::swap (thread_loop_partitioner, v.thread_loop_partitioner);
       std::swap (allocated_size,    v.allocated_size);
-      std::swap (val,               v.val);
+      std::swap (values,               v.values);
       std::swap (import_data,       v.import_data);
       std::swap (vector_is_ghosted, v.vector_is_ghosted);
     }
@@ -722,7 +722,7 @@ namespace LinearAlgebra
       const size_type this_size = local_size();
       if (this_size>0)
         {
-          internal::VectorOperations::Vector_set<Number> setter(s, val.get());
+          internal::VectorOperations::Vector_set<Number> setter(s, values.get());
 
           internal::VectorOperations::parallel_for(setter, 0, this_size,
                                                    thread_loop_partitioner);
@@ -763,7 +763,7 @@ namespace LinearAlgebra
 
       AssertDimension (local_size(), v.local_size());
 
-      internal::VectorOperations::Vectorization_add_v<Number> vector_add(val.get(), v.val.get());
+      internal::VectorOperations::Vectorization_add_v<Number> vector_add(values.get(), v.values.get());
       internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
 
@@ -786,7 +786,7 @@ namespace LinearAlgebra
 
       AssertDimension (local_size(), v.local_size());
 
-      internal::VectorOperations::Vectorization_subtract_v<Number> vector_subtract(val.get(), v.val.get());
+      internal::VectorOperations::Vectorization_subtract_v<Number> vector_subtract(values.get(), v.values.get());
       internal::VectorOperations::parallel_for(vector_subtract, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
 
@@ -804,7 +804,7 @@ namespace LinearAlgebra
     {
       AssertIsFinite(a);
 
-      internal::VectorOperations::Vectorization_add_factor<Number> vector_add(val.get(), a);
+      internal::VectorOperations::Vectorization_add_factor<Number> vector_add(values.get(), a);
       internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
 
@@ -827,7 +827,7 @@ namespace LinearAlgebra
       AssertIsFinite(a);
       AssertDimension (local_size(), v.local_size());
 
-      internal::VectorOperations::Vectorization_add_av<Number> vector_add(val.get(), v.val.get(), a);
+      internal::VectorOperations::Vectorization_add_av<Number> vector_add(values.get(), v.values.get(), a);
       internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
 
@@ -858,8 +858,8 @@ namespace LinearAlgebra
       AssertDimension (local_size(), v.local_size());
       AssertDimension (local_size(), w.local_size());
 
-      internal::VectorOperations::Vectorization_add_avpbw<Number> vector_add(val.get(), v.val.get(),
-          w.val.get(), a, b);
+      internal::VectorOperations::Vectorization_add_avpbw<Number> vector_add(values.get(), v.values.get(),
+          w.values.get(), a, b);
       internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
 
@@ -891,7 +891,7 @@ namespace LinearAlgebra
       AssertIsFinite(x);
       AssertDimension (local_size(), v.local_size());
 
-      internal::VectorOperations::Vectorization_sadd_xv<Number> vector_sadd(val.get(), v.val.get(), x);
+      internal::VectorOperations::Vectorization_sadd_xv<Number> vector_sadd(values.get(), v.values.get(), x);
       internal::VectorOperations::parallel_for(vector_sadd, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
 
@@ -916,7 +916,7 @@ namespace LinearAlgebra
       AssertIsFinite(a);
       AssertDimension (local_size(), v.local_size());
 
-      internal::VectorOperations::Vectorization_sadd_xav<Number> vector_sadd(val.get(), v.val.get(), a, x);
+      internal::VectorOperations::Vectorization_sadd_xav<Number> vector_sadd(values.get(), v.values.get(), a, x);
       internal::VectorOperations::parallel_for(vector_sadd, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
 
@@ -941,7 +941,7 @@ namespace LinearAlgebra
       AssertDimension (local_size(), v.local_size());
       AssertDimension (local_size(), w.local_size());
 
-      internal::VectorOperations::Vectorization_sadd_xavbw<Number> vector_sadd(val.get(), v.val.get(), w.val.get(),
+      internal::VectorOperations::Vectorization_sadd_xavbw<Number> vector_sadd(values.get(), v.values.get(), w.values.get(),
           x, a, b);
       internal::VectorOperations::parallel_for(vector_sadd, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
@@ -957,7 +957,7 @@ namespace LinearAlgebra
     Vector<Number>::operator *= (const Number factor)
     {
       AssertIsFinite(factor);
-      internal::VectorOperations::Vectorization_multiply_factor<Number> vector_multiply(val.get(),
+      internal::VectorOperations::Vectorization_multiply_factor<Number> vector_multiply(values.get(),
           factor);
 
       internal::VectorOperations::parallel_for(vector_multiply, 0, partitioner->local_size(),
@@ -992,7 +992,7 @@ namespace LinearAlgebra
 
       AssertDimension (local_size(), v.local_size());
 
-      internal::VectorOperations::Vectorization_scale<Number> vector_scale(val.get(), v.val.get());
+      internal::VectorOperations::Vectorization_scale<Number> vector_scale(values.get(), v.values.get());
       internal::VectorOperations::parallel_for(vector_scale, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
 
@@ -1015,7 +1015,7 @@ namespace LinearAlgebra
       AssertIsFinite(a);
       AssertDimension (local_size(), v.local_size());
 
-      internal::VectorOperations::Vectorization_equ_au<Number> vector_equ(val.get(), v.val.get(), a);
+      internal::VectorOperations::Vectorization_equ_au<Number> vector_equ(values.get(), v.values.get(), a);
       internal::VectorOperations::parallel_for(vector_equ, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
 
@@ -1038,8 +1038,8 @@ namespace LinearAlgebra
       AssertDimension (local_size(), v.local_size());
       AssertDimension (local_size(), w.local_size());
 
-      internal::VectorOperations::Vectorization_equ_aubv<Number> vector_equ(val.get(), v.val.get(),
-          w.val.get(), a, b);
+      internal::VectorOperations::Vectorization_equ_aubv<Number> vector_equ(values.get(), v.values.get(),
+          w.values.get(), a, b);
       internal::VectorOperations::parallel_for(vector_equ, 0, partitioner->local_size(),
                                                thread_loop_partitioner);
 
@@ -1055,7 +1055,7 @@ namespace LinearAlgebra
     {
       const size_type local_size = partitioner->local_size();
       for (size_type i=0; i<local_size; ++i)
-        if (val[i] != Number(0))
+        if (values[i] != Number(0))
           return false;
       return true;
     }
@@ -1092,7 +1092,7 @@ namespace LinearAlgebra
       AssertDimension (partitioner->local_size(), v.partitioner->local_size());
 
       Number sum;
-      internal::VectorOperations::Dot<Number,Number2> dot(val.get(), v.val.get());
+      internal::VectorOperations::Dot<Number,Number2> dot(values.get(), v.values.get());
       internal::VectorOperations::parallel_reduce (dot, 0, partitioner->local_size(), sum,
                                                    thread_loop_partitioner);
       AssertIsFinite(sum);
@@ -1126,7 +1126,7 @@ namespace LinearAlgebra
     Vector<Number>::norm_sqr_local () const
     {
       real_type sum;
-      internal::VectorOperations::Norm2<Number,real_type> norm2(val.get());
+      internal::VectorOperations::Norm2<Number,real_type> norm2(values.get());
       internal::VectorOperations::parallel_reduce (norm2, 0, partitioner->local_size(), sum,
                                                    thread_loop_partitioner);
       AssertIsFinite(sum);
@@ -1146,7 +1146,7 @@ namespace LinearAlgebra
         return Number();
 
       Number sum;
-      internal::VectorOperations::MeanValue<Number> mean(val.get());
+      internal::VectorOperations::MeanValue<Number> mean(values.get());
       internal::VectorOperations::parallel_reduce (mean, 0, partitioner->local_size(), sum,
                                                    thread_loop_partitioner);
 
@@ -1176,7 +1176,7 @@ namespace LinearAlgebra
     Vector<Number>::l1_norm_local () const
     {
       real_type sum;
-      internal::VectorOperations::Norm1<Number, real_type> norm1(val.get());
+      internal::VectorOperations::Norm1<Number, real_type> norm1(values.get());
       internal::VectorOperations::parallel_reduce (norm1, 0, partitioner->local_size(), sum,
                                                    thread_loop_partitioner);
 
@@ -1218,7 +1218,7 @@ namespace LinearAlgebra
     Vector<Number>::lp_norm_local (const real_type p) const
     {
       real_type sum;
-      internal::VectorOperations::NormP<Number, real_type> normp(val.get(), p);
+      internal::VectorOperations::NormP<Number, real_type> normp(values.get(), p);
       internal::VectorOperations::parallel_reduce (normp, 0, partitioner->local_size(), sum,
                                                    thread_loop_partitioner);
       return std::pow(sum, 1./p);
@@ -1249,7 +1249,7 @@ namespace LinearAlgebra
 
       const size_type local_size = partitioner->local_size();
       for (size_type i=0; i<local_size; ++i)
-        max = std::max (numbers::NumberTraits<Number>::abs(val[i]), max);
+        max = std::max (numbers::NumberTraits<Number>::abs(values[i]), max);
 
       return max;
     }
@@ -1282,7 +1282,7 @@ namespace LinearAlgebra
       AssertDimension (vec_size, w.local_size());
 
       Number sum;
-      internal::VectorOperations::AddAndDot<Number> adder(this->val.get(), v.val.get(), w.val.get(), a);
+      internal::VectorOperations::AddAndDot<Number> adder(this->values.get(), v.values.get(), w.values.get(), a);
       internal::VectorOperations::parallel_reduce (adder, 0, vec_size, sum, thread_loop_partitioner);
       AssertIsFinite(sum);
       return sum;

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.