From fdea8fd9091f4d09766eb8f43b50091f6879ead3 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Wed, 9 Dec 2015 19:21:55 -0600 Subject: [PATCH] Fix usage of int_to_string --- include/deal.II/lac/block_indices.h | 4 +-- include/deal.II/lac/sparse_matrix.templates.h | 2 +- source/base/index_set.cc | 4 +-- source/dofs/dof_renumbering.cc | 2 +- source/grid/grid_reordering.cc | 4 +-- tests/base/utilities_11.cc | 30 +++++++++---------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/deal.II/lac/block_indices.h b/include/deal.II/lac/block_indices.h index 539611ff6b..7f4f715604 100644 --- a/include/deal.II/lac/block_indices.h +++ b/include/deal.II/lac/block_indices.h @@ -359,9 +359,9 @@ BlockIndices::to_string () const { if (i>0) result += ','; - result += Utilities::int_to_string(block_size(i)); + result += Utilities::to_string(block_size(i)); } - result += "|" + Utilities::int_to_string(total_size()) + ']'; + result += "|" + Utilities::to_string(total_size()) + ']'; return result; } diff --git a/include/deal.II/lac/sparse_matrix.templates.h b/include/deal.II/lac/sparse_matrix.templates.h index 5a992bac27..4f145c555c 100644 --- a/include/deal.II/lac/sparse_matrix.templates.h +++ b/include/deal.II/lac/sparse_matrix.templates.h @@ -1341,7 +1341,7 @@ namespace ExcMessage("There is a zero on the diagonal of this matrix " "in row " + - Utilities::int_to_string(row) + Utilities::to_string(row) + ". The preconditioner you selected cannot work if that " "is the case because one of its steps requires " diff --git a/source/base/index_set.cc b/source/base/index_set.cc index bad685f156..3cc560614b 100644 --- a/source/base/index_set.cc +++ b/source/base/index_set.cc @@ -499,10 +499,10 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator, "contain all indices exactly once: the sum of " "the number of entries the various processors " "want to store locally is " - + Utilities::int_to_string (n_global_elements) + + + Utilities::to_string (n_global_elements) + " whereas the total size of the object to be " "allocated is " - + Utilities::int_to_string (size()) + + + Utilities::to_string (size()) + ". In other words, there are " "either indices that are not spoken for " "by any processor, or there are indices that are " diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index 8281d2e478..43e9804d74 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -434,7 +434,7 @@ namespace DoFRenumbering { Assert (locally_owned.is_element (starting_indices[i]), ExcMessage ("You specified global degree of freedom " - + Utilities::int_to_string(starting_indices[i]) + + + Utilities::to_string(starting_indices[i]) + " as a starting index, but this index is not among the " "locally owned ones on this processor.")); local_starting_indices[i] = locally_owned.index_within_set(starting_indices[i]); diff --git a/source/grid/grid_reordering.cc b/source/grid/grid_reordering.cc index fe4e1dcce2..37fd5f17c1 100644 --- a/source/grid/grid_reordering.cc +++ b/source/grid/grid_reordering.cc @@ -767,9 +767,9 @@ GridReordering<2>::invert_all_cells_of_negative_grid(const std::vector "negative volume. You need to check your mesh which " "cells these are and how they got there.\n" "As a hint, of the total ") - + Utilities::int_to_string (cells.size()) + + Utilities::to_string (cells.size()) + " cells in the mesh, " - + Utilities::int_to_string (n_negative_cells) + + Utilities::to_string (n_negative_cells) + " appear to have a negative volume.")); } diff --git a/tests/base/utilities_11.cc b/tests/base/utilities_11.cc index 47686ea42d..3c3fd942bd 100644 --- a/tests/base/utilities_11.cc +++ b/tests/base/utilities_11.cc @@ -28,35 +28,35 @@ void test () { unsigned long long int i = std::pow(2,33); - Assert(Utilities::to_string (i)=="8589934592", ExcInternalError()); - Assert(Utilities::to_string (i,11)=="08589934592", ExcInternalError()); + Assert(Utilities::to_string (i) == "8589934592", ExcInternalError()); + Assert(Utilities::to_string (i,11) == "08589934592", ExcInternalError()); unsigned long long j = std::pow(2,31); - Assert(Utilities::to_string(j)=="2147483648", ExcInternalError()); + Assert(Utilities::to_string(j) == "2147483648", ExcInternalError()); int k = - std::pow(2,30); - Assert(Utilities::to_string (k)=="-1073741824", ExcInternalError()); - Assert(Utilities::to_string (k,12)=="-01073741824", ExcInternalError()); + Assert(Utilities::to_string (k) == "-1073741824", ExcInternalError()); + Assert(Utilities::to_string (k,12) == "-01073741824", ExcInternalError()); long long int l = - std::pow(2,35); - Assert(Utilities::to_string (l)=="-34359738368", ExcInternalError()); - Assert(Utilities::to_string (l,13)=="-034359738368", ExcInternalError()); + Assert(Utilities::to_string (l) == "-34359738368", ExcInternalError()); + Assert(Utilities::to_string (l,13) == "-034359738368", ExcInternalError()); float f (-3.14159265358979323846264338327950288419716939937510); - Assert(Utilities::to_string (f)=="-3.14159274", ExcInternalError()); - Assert(Utilities::to_string (f,13)=="-003.14159274", ExcInternalError()); + Assert(Utilities::to_string (f) == "-3.14159274", ExcInternalError()); + Assert(Utilities::to_string (f,13) == "-003.14159274", ExcInternalError()); double d (-3.14159265358979323846264338327950288419716939937510); - Assert(Utilities::to_string (d)=="-3.1415926535897931", ExcInternalError()); - Assert(Utilities::to_string (d,20)=="-03.1415926535897931", ExcInternalError()); + Assert(Utilities::to_string (d) == "-3.1415926535897931", ExcInternalError()); + Assert(Utilities::to_string (d,20) == "-03.1415926535897931", ExcInternalError()); long double ld (-3.14159265358979323846264338327950288419716939937510L); - Assert(Utilities::to_string (ld)=="-3.14159265358979323851", ExcInternalError()); - Assert(Utilities::to_string (ld,24)=="-03.14159265358979323851", ExcInternalError()); + Assert(Utilities::to_string (ld) == "-3.14159265358979323851", ExcInternalError()); + Assert(Utilities::to_string (ld,24) == "-03.14159265358979323851", ExcInternalError()); double ed (-3.1415926535e-115); - Assert(Utilities::to_string (ed)=="-3.1415926534999999e-115", ExcInternalError()); - Assert(Utilities::to_string (ed,24)=="-3.1415926534999999e-115", ExcInternalError()); + Assert(Utilities::to_string (ed) == "-3.1415926534999999e-115", ExcInternalError()); + Assert(Utilities::to_string (ed,28) == "-00003.1415926534999999e-115", ExcInternalError()); deallog << "Ok." << std::endl; } -- 2.39.5