]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
More fixes for cxx.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 Apr 2003 23:08:40 +0000 (23:08 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 Apr 2003 23:08:40 +0000 (23:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@7525 0785d39b-7218-0410-832d-ea1e28bc413d

tests/lac/benchmark.cc
tests/lac/block_matrices.cc
tests/lac/eigen.cc
tests/lac/full_matrix.cc
tests/lac/sparse_ilu.cc
tests/lac/sparse_matrices.cc
tests/lac/sparsity_pattern.cc
tests/lac/vector-vector.cc

index 91d0aed70e667ec6c20dae30edd1fdedb8d3747e..23f1d15e4fab2045a79b6a8ec74df3d02c868993 100644 (file)
@@ -18,7 +18,9 @@
 #include <time.h>
 
 #define ITER 100
-main()
+
+
+int main()
 {
   Vector<double> u;
   Vector<double> v;
index 5864e08388ea3646f438c0d9dc3404eab9d3b038..9a93a3ae2e770e879c5cbcf3934a93e2e79b6a9b 100644 (file)
@@ -175,7 +175,7 @@ void test ()
                                   // now check what came out
   for (unsigned int row=0; row<19; ++row)
     {
-      std::vector<double> t(29, 0);
+      std::vector<double> t(29, 0.);
                                       // first check which elements
                                       // in this row exist
       for (unsigned int i=0; i<10; ++i)
index fdbd04b0010a071becce1e598ce4595d40b676d2..0a976920f590ee7da33ee8d38a023dd4c02c38a0 100644 (file)
@@ -47,8 +47,8 @@ int main()
                                    * Satz 4.1.1)
                                    */
   const double h = 1./size;
-  const double s = std::sin(M_PI*h/2.);
-  const double c = std::cos(M_PI*h/2.);
+  const double s = std::sin(deal_II_numbers::PI*h/2.);
+  const double c = std::cos(deal_II_numbers::PI*h/2.);
   const double lambda_max = 8.*c*c;
   const double lambda_min = 8.*s*s;
   
index 71ebb588b124c3d138b861bfc62246173db05cd5..d206038dda067b2faf6a9612c019604941177d31 100644 (file)
@@ -32,7 +32,7 @@ void random_matrix(FullMatrix<double>& A)
   for (unsigned int i=0; i<A.m();++i)
     for (unsigned int j=0; j<A.n();++j)
       {
-       double rnd = rand();
+       double rnd = std::rand();
        rnd /= RAND_MAX;
        A(i,j) = (i==j) ? A.m()+rnd : rnd;
       }
@@ -46,7 +46,7 @@ main ()
   logfile.precision(3);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  srand(3391466);
+  std::srand(3391466);
 
   FullMatrix<double> T(3,3,entries);
   T.print_formatted(logfile, 0, false);
@@ -92,9 +92,9 @@ main ()
                                           // Setup rotation matrix
          C.clear();
          C.diagadd(1.);
-         C(i,i) = C(i+1,i+1) = cos(i+1);
-         C(i+1,i) = sin(i+1);
-         C(i,i+1) = -sin(i+1);
+         C(i,i) = C(i+1,i+1) = std::cos(i+1.);
+         C(i+1,i) = std::sin(i+1.);
+         C(i,i+1) = -std::sin(i+1.);
          
          C.print_formatted (logfile,3,false);
          deallog << "l1-norm: " << C.l1_norm() << std::endl;
index c73fd28820bcd379f80662da4418f45796f07b02..f4a84ca2405a12dac0521a5f8c5212b16401b01c 100644 (file)
@@ -97,7 +97,7 @@ int main()
          for (unsigned int i=0; i<3; ++i)
            {
              for (unsigned int j=0; j<dim; ++j)
-               v(j) = 1. * rand()/RAND_MAX;
+               v(j) = 1. * std::rand()/RAND_MAX;
              
              A.vmult (tmp1, v);
              ilu.vmult (tmp2, tmp1);
index 1bd34622ead290225d14d443a928dac80e31bbc1..aefc04ec3156878da9bfb6bcdd739547608ae089 100644 (file)
@@ -218,7 +218,7 @@ int main()
   A_tmp.block_read (tmp_read);
   tmp_read.close ();
 
-  remove ("sparse_matrices.tmp");
+  std::remove ("sparse_matrices.tmp");
 
   for (unsigned int i=0; i<A.n_nonzero_elements(); ++i)
     if (std::fabs(A.global_entry(i) - A_tmp.global_entry(i)) <=
index 85ae8e89d364010aec03bc2add675765763f2c70..b3588aecbd4cf7973a45f71a41dbd0a7b5f61f73 100644 (file)
@@ -141,7 +141,7 @@ main ()
   tmp_read.close ();
 
                                    // delete temporary file
-  remove ("sparsity_pattern.tmp");
+  std::remove ("sparsity_pattern.tmp");
   
                                   // now check for equivalence of sp3 and sp4
   for (unsigned int row=0; row<sp3.n_rows(); ++row)
index 448d2b2b5f345121a24cf9b3e10aa8be750b6f50..2a4c25ce8581ff30ef5a62f5fba347f2de2e238d 100644 (file)
@@ -84,7 +84,7 @@ void check_vectors (Vector<number1> &d1, Vector<number2> &d2)
     sum += 4.*i*i;
   deallog << d2.norm_sqr() << '\t' << sum << std::endl;
 
-  sum = sqrt(sum);
+  sum = std::sqrt(sum);
   deallog << d2.l2_norm() << '\t' << sum << std::endl;
 
   sum = 0.;

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.