]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix uninitialized members in SparseMatrixEZ 1999/head
authorTimo Heister <timo.heister@gmail.com>
Mon, 21 Dec 2015 05:42:56 +0000 (00:42 -0500)
committerTimo Heister <timo.heister@gmail.com>
Mon, 21 Dec 2015 05:43:10 +0000 (00:43 -0500)
An uninitialized member would cause random crashes in
tests/lac/sparse_matrices_ez as documented by valgrind:

==31301== Conditional jump or move depends on uninitialised value(s)
==31301==    at 0xB0C4614:
dealii::SparseMatrixEZ<float>::reinit(unsigned int, unsigned int,
unsigned int, unsigned int, unsigned int) (stl_vector.h:666)
==31301==    by 0x40F45C: main (sparse_matrix_ez.h:1400)

include/deal.II/lac/sparse_matrix_ez.h
include/deal.II/lac/sparse_matrix_ez.templates.h

index 153b5a8ede8815719578e4164d8c5d31108071a5..131fd5b453fc6ecdd511122db615f2104329f02d 100644 (file)
@@ -86,7 +86,7 @@ template<typename number> class FullMatrix;
  * If the rows are expected to be filled more or less from first to last,
  * using a @p default_row_length of zero may not be such a bad idea.
  *
- * The name of this matrix is in reverence to a publication of the Internal
+ * The name of this matrix is in reference to a publication of the Internal
  * Revenue Service of the United States of America. I hope some other aliens
  * will appreciate it. By the way, the suffix makes sense by pronouncing it
  * the American way.
index bacd822d5ce147e733d777a9a5e92b3b762b3cdb..db928932d305e44404ff37521f10244373ca126f 100644 (file)
@@ -31,9 +31,10 @@ DEAL_II_NAMESPACE_OPEN
 
 template <typename number>
 SparseMatrixEZ<number>::SparseMatrixEZ()
-{
-  n_columns = 0;
-}
+  : n_columns (0),
+    increment (1),
+    saved_default_row_length (0)
+{}
 
 
 template <typename number>

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.