]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Entirely avoid memory allocation in two places. 5198/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 5 Oct 2017 19:17:11 +0000 (13:17 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 5 Oct 2017 19:17:11 +0000 (13:17 -0600)
include/deal.II/numerics/vector_tools.templates.h

index a4bf302661e12f3348f7092fd39d9cd984c2e9e1..ada229938abcb0e096863d1165da87a4dd56c337 100644 (file)
@@ -136,7 +136,7 @@ namespace VectorTools
               auto shifted_view = boost::make_iterator_range(
                                     std::begin(function_values[i]) + offset,
                                     std::begin(function_values[i]) + offset + dim);
-              std::vector<number> old_value(dim);
+              std::array<number,dim> old_value;
               std::copy(std::begin(shifted_view),
                         std::end(shifted_view),
                         std::begin(old_value));
@@ -164,7 +164,7 @@ namespace VectorTools
               auto shifted_view = boost::make_iterator_range(
                                     std::begin(function_values[i]) + offset,
                                     std::begin(function_values[i]) + offset + dim);
-              std::vector<number> old_value(dim);
+              std::array<number,dim> old_value;
               std::copy(std::begin(shifted_view),
                         std::end(shifted_view),
                         std::begin(old_value));

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.