]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use the appropriate type to state a constant. 6531/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 8 May 2018 08:34:55 +0000 (16:34 +0800)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 8 May 2018 10:44:03 +0000 (18:44 +0800)
Specifically, make sure that a statement also compiles if we are working with
complex-valued data.

include/deal.II/matrix_free/operators.h

index efd01dac8541b70ddb2d946eec56a164344e6c04..d5aabda170926858fac607245fc1422322bc9878 100644 (file)
@@ -1590,7 +1590,7 @@ namespace MatrixFreeOperators
     const unsigned int local_size = inverse_diagonal_vector.local_size();
     for (unsigned int i=0; i<local_size; ++i)
       inverse_diagonal_vector.local_element(i)
-        =1./inverse_diagonal_vector.local_element(i);
+        = Number(1.)/inverse_diagonal_vector.local_element(i);
 
     inverse_diagonal_vector.update_ghost_values();
     diagonal_vector.update_ghost_values();

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.