]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Directly create an ArrayView from a table.
authorDavid Wells <wellsd2@rpi.edu>
Fri, 11 Aug 2017 04:49:22 +0000 (00:49 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Mon, 11 Sep 2017 18:17:09 +0000 (14:17 -0400)
source/grid/manifold.cc

index 1968c74bbcc6a9de83bb6d2fb55ba599eebda8f3..c455a8a75992b60181a14b6cf74d482c9d567c8b 100644 (file)
@@ -122,18 +122,12 @@ add_new_points (const ArrayView<const Point<spacedim>> &surrounding_points,
 {
   AssertDimension(surrounding_points.size(), weights.size(1));
 
-  const std::size_t n_points = surrounding_points.size();
-  // TODO find a better dimension-dependent estimate for the size of this
-  // vector
-  boost::container::small_vector<double, 20> local_weights(n_points);
   for (unsigned int row=0; row<weights.size(0); ++row)
     {
-      for (unsigned int i=0; i<n_points; ++i)
-        local_weights[i] = weights(row,i);
       new_points[row] = get_new_point(make_array_view(surrounding_points.begin(),
                                                       surrounding_points.end()),
-                                      make_array_view(local_weights.begin(),
-                                                      local_weights.end()));
+                                      make_array_view(weights,
+                                                      row));
     }
 }
 

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.