#include <time.h>
#define ITER 100
-main()
+
+
+int main()
{
Vector<double> u;
Vector<double> v;
// 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)
* 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;
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;
}
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);
// 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;
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);
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)) <=
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)
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.;