From 7d7488bfa94dd82c693cfd817e7d7c3be9eecff5 Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 3 Jul 2001 12:35:51 +0000 Subject: [PATCH] Fix many missing std:: which Compaq's cxx wants to have, mostly for two reasons: 1. because it does not inject the math functions sqrt, sin, cos, fabs, ... into global namespace when we write include. 2. because cxx can't do Koenig lookup of functions. git-svn-id: https://svn.dealii.org/trunk@4808 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-1/step-1.cc | 4 ++-- deal.II/examples/step-2/step-2.cc | 4 ++-- deal.II/examples/step-4/step-4.cc | 2 +- deal.II/examples/step-7/step-7.cc | 8 ++++---- deal.II/examples/step-9/step-9.cc | 8 ++++---- deal.II/lac/include/lac/solver_bicgstab.h | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/deal.II/examples/step-1/step-1.cc b/deal.II/examples/step-1/step-1.cc index 01ebbf6981..9250c7de89 100644 --- a/deal.II/examples/step-1/step-1.cc +++ b/deal.II/examples/step-1/step-1.cc @@ -170,9 +170,9 @@ void second_grid () const Point<2> vector_to_center = (cell->vertex(vertex) - center); const double distance_from_center - = sqrt(vector_to_center.square()); + = std::sqrt(vector_to_center.square()); - if (fabs(distance_from_center - inner_radius) < 1e-10) + if (std::fabs(distance_from_center - inner_radius) < 1e-10) { // Ok, this is one of // the cells we were diff --git a/deal.II/examples/step-2/step-2.cc b/deal.II/examples/step-2/step-2.cc index 29fcc76fed..357553d9ea 100644 --- a/deal.II/examples/step-2/step-2.cc +++ b/deal.II/examples/step-2/step-2.cc @@ -106,9 +106,9 @@ void make_grid (Triangulation<2> &triangulation) const Point<2> vector_to_center = (cell->vertex(vertex) - center); const double distance_from_center - = sqrt(vector_to_center.square()); + = std::sqrt(vector_to_center.square()); - if (fabs(distance_from_center - inner_radius) < 1e-10) + if (std::fabs(distance_from_center - inner_radius) < 1e-10) { cell->set_refine_flag (); break; diff --git a/deal.II/examples/step-4/step-4.cc b/deal.II/examples/step-4/step-4.cc index 9066a1e4f9..893a55f477 100644 --- a/deal.II/examples/step-4/step-4.cc +++ b/deal.II/examples/step-4/step-4.cc @@ -173,7 +173,7 @@ double RightHandSide::value (const Point &p, { double return_value = 0; for (unsigned int i=0; i::value (const Point &p, // offers a member function // ``square'' that does what // it's name suggests. - return_value += exp(-shifted_point.square() / (width*width)); + return_value += std::exp(-shifted_point.square() / (width*width)); }; return return_value; @@ -264,7 +264,7 @@ Tensor<1,dim> Solution::gradient (const Point &p, // vector, where the factor is // given by the exponentials. return_value += (-2 / (width*width) * - exp(-shifted_point.square() / (width*width)) * + std::exp(-shifted_point.square() / (width*width)) * shifted_point); }; @@ -313,10 +313,10 @@ double RightHandSide::value (const Point &p, // the Laplacian: return_value += ((2*dim - 4*shifted_point.square()/(width*width)) / (width*width) * - exp(-shifted_point.square() / (width*width))); + std::exp(-shifted_point.square() / (width*width))); // And the second is the // solution itself: - return_value += exp(-shifted_point.square() / (width*width)); + return_value += std::exp(-shifted_point.square() / (width*width)); }; return return_value; diff --git a/deal.II/examples/step-9/step-9.cc b/deal.II/examples/step-9/step-9.cc index b3356eebd9..8b97ffed21 100644 --- a/deal.II/examples/step-9/step-9.cc +++ b/deal.II/examples/step-9/step-9.cc @@ -323,7 +323,7 @@ AdvectionField::value (const Point &p) const Point value; value[0] = 2; for (unsigned int i=1; i::value (const Point &p, Assert (component == 0, ExcIndexRange (component, 0, 1)); const double diameter = 0.1; return ( (p-center_point).square() < diameter*diameter ? - .1/pow(diameter,dim) : + .1/std::pow(diameter,dim) : 0); }; @@ -466,8 +466,8 @@ BoundaryValues::value (const Point &p, { Assert (component == 0, ExcIndexRange (component, 0, 1)); - const double sine_term = sin(16*M_PI*sqrt(p.square())); - const double weight = exp(-5*p.square()) / exp(-5.); + const double sine_term = std::sin(16*M_PI*std::sqrt(p.square())); + const double weight = std::exp(-5*p.square()) / std::exp(-5.); return sine_term * weight; }; diff --git a/deal.II/lac/include/lac/solver_bicgstab.h b/deal.II/lac/include/lac/solver_bicgstab.h index a64e5e4952..9bff8e3e00 100644 --- a/deal.II/lac/include/lac/solver_bicgstab.h +++ b/deal.II/lac/include/lac/solver_bicgstab.h @@ -311,7 +311,7 @@ SolverBicgstab::iterate(const MATRIX& A, //TODO:[?] Find better breakdown criterion - if (fabs(alpha) > 1.e10) + if (std::fabs(alpha) > 1.e10) return true; s.equ(1., r, -alpha, v); -- 2.39.5