]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around a bug in gcc-4.7 wrt initalizer lists in function arguments. 847/head
authorMatthias Maier <matthias.maier@iwr.uni-heidelberg.de>
Mon, 20 Apr 2015 13:00:03 +0000 (15:00 +0200)
committerMatthias Maier <matthias.maier@iwr.uni-heidelberg.de>
Mon, 20 Apr 2015 13:00:03 +0000 (15:00 +0200)
tests/lac/linear_operator_05.cc
tests/lac/linear_operator_07.cc

index 958df9fcf1a6dec9153bbc0ce56642ff951d6c53..d0bb18ffd3f57fe3bcbec3964e8977f14b846d9d 100644 (file)
@@ -105,8 +105,9 @@ int main()
   auto op_b10 = linear_operator(a.block(1, 0));
   auto op_b11 = linear_operator(a.block(1, 1));
 
-  auto op_b =
-      block_operator<2, 2, BlockVector<double>>({op_b00, op_b01, op_b10, op_b11});
+  std::array<std::array<decltype(op_b00), 2>, 2> temp{op_b00, op_b01, op_b10,
+                                                      op_b11};
+  auto op_b = block_operator<2, 2, BlockVector<double>>(temp);
 
   // vmult:
 
@@ -173,8 +174,9 @@ int main()
 
   // And finally complicated block structures:
 
-  auto op_upp_x_upu = block_operator<3, 3, BlockVector<double>>(
-      {op_b00, op_b01, op_b00, op_b10, op_b11, op_b10, op_b10, op_b11, op_b10});
+  std::array<std::array<decltype(op_b00), 3>, 3> temp2{
+      op_b00, op_b01, op_b00, op_b10, op_b11, op_b10, op_b10, op_b11, op_b10};
+  auto op_upp_x_upu = block_operator<3, 3, BlockVector<double>>(temp2);
 
   op_upp_x_upu.reinit_domain_vector(u, false);
   for (unsigned int i = 0; i < u.size(); ++i) {
@@ -190,11 +192,11 @@ int main()
   op_upp_x_upu.vmult_add(v, u);
   PRINTME("v", v);
 
-  auto op_upp_x_p =
-      block_operator<3, 1, BlockVector<double>>({op_b01, op_b11, op_b11});
+  std::array<std::array<decltype(op_b01), 1>, 3> temp3{op_b01, op_b11, op_b11};
+  auto op_upp_x_p = block_operator<3, 1, BlockVector<double>>(temp3);
 
-  auto op_u_x_upu =
-      block_operator<1, 3, BlockVector<double>>({op_b00, op_b01, op_b00});
+  std::array<std::array<decltype(op_b01), 3>, 1> temp4{op_b00, op_b01, op_b00};
+  auto op_u_x_upu = block_operator<1, 3, BlockVector<double>>(temp4);
 
   auto op_long = op_u_x_upu * transpose_operator(op_upp_x_upu) * op_upp_x_p;
 
index 53711def2dbb38a074df817e5cda5adf77a9712c..4f630bbfbeb196b17179c27ab5454361f990a203 100644 (file)
@@ -84,8 +84,9 @@ int main()
   auto op_b1 = linear_operator(a.block(1, 1));
   auto op_b2 = linear_operator(a.block(2, 2));
 
-  auto op_b =
-      block_diagonal_operator<3, BlockVector<double>>({op_b0, op_b1, op_b2});
+
+  std::array<decltype(op_b0), 3> temp{op_b0, op_b1, op_b2};
+  auto op_b = block_diagonal_operator<3, BlockVector<double>>(temp);
 
   // vmult:
 
@@ -152,7 +153,8 @@ int main()
 
   // And finally the other block_diagonal_operator variant:
 
-  auto op_c = block_diagonal_operator<5, BlockVector<double>>({op_b0, op_b0, op_b0, op_b0, op_b0});
+  std::array<decltype(op_b0), 5> temp2{op_b0, op_b0, op_b0, op_b0, op_b0};
+  auto op_c = block_diagonal_operator<5, BlockVector<double>>(temp2);
 
   auto op_d = block_diagonal_operator<5, BlockVector<double>>(op_b0);
 

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.