void test ()
{
- ofstream logfile("block_matrices.output");
- logfile.setf(ios::fixed);
+ std::ofstream logfile("block_matrices.output");
+ logfile.setf(std::ios::fixed);
logfile.precision(2);
deallog.attach(logfile);
deallog.depth_console(0);
{
// first count the number of
// elements in each row
- vector<bool> t(29, false);
+ std::vector<bool> t(29, false);
for (unsigned int i=0; i<10; ++i)
t[(row*5+i*9)%29] = true;
// if we are in the third block
// and see what we can get after
// vmults:
BlockVector<double> src;
- vector<unsigned int> src_sizes (2);
+ std::vector<unsigned int> src_sizes (2);
src_sizes[0] = 10;
src_sizes[1] = 19;
src.reinit (src_sizes);
BlockVector<double> dst;
- vector<unsigned int> dst_sizes (3);
+ std::vector<unsigned int> dst_sizes (3);
dst_sizes[0] = 2;
dst_sizes[1] = 7;
dst_sizes[2] = 10;
// now check what came out
for (unsigned int row=0; row<19; ++row)
{
- 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)
{
test ();
}
- catch (exception &e)
+ catch (std::exception &e)
{
- cerr << std::endl << std::endl
+ std::cerr << std::endl << std::endl
<< "----------------------------------------------------"
<< std::endl;
- cerr << "Exception on processing: " << e.what() << std::endl
+ std::cerr << "Exception on processing: " << e.what() << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
}
catch (...)
{
- cerr << std::endl << std::endl
+ std::cerr << std::endl << std::endl
<< "----------------------------------------------------"
<< std::endl;
- cerr << "Unknown exception!" << std::endl
+ std::cerr << "Unknown exception!" << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000 by the deal.II authors
+// Copyright (C) 2000, 2001 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
{
deallog.push("BlockIndices");
- vector<unsigned int> ivector(4);
+ std::vector<unsigned int> ivector(4);
ivector[0] = 3;
ivector[1] = 0;
ivector[2] = 1;
int main ()
{
- ofstream logfile("block_vector.output");
- logfile.setf(ios::fixed);
+ std::ofstream logfile("block_vector.output");
+ logfile.setf(std::ios::fixed);
logfile.precision(3);
deallog.attach(logfile);
deallog.depth_console(0);
- cerr = logfile;
+ std::cerr = logfile;
try
{
test ();
}
- catch (exception &e)
+ catch (std::exception &e)
{
- cerr << std::endl << std::endl
+ std::cerr << std::endl << std::endl
<< "----------------------------------------------------"
<< std::endl;
- cerr << "Exception on processing: " << e.what() << std::endl
+ std::cerr << "Exception on processing: " << e.what() << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
}
catch (...)
{
- cerr << std::endl << std::endl
+ std::cerr << std::endl << std::endl
<< "----------------------------------------------------"
<< std::endl;
- cerr << "Unknown exception!" << std::endl
+ std::cerr << "Unknown exception!" << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
int
main ()
{
- ofstream logfile("full_matrix.output");
- logfile.setf(ios::fixed);
+ std::ofstream logfile("full_matrix.output");
+ logfile.setf(std::ios::fixed);
logfile.precision(3);
deallog.attach(logfile);
deallog.depth_console(0);
#define ACCURACY 1.e-5
// template<class VECTOR>
-// void print_vector(ostream& s, const VECTOR& v)
+// void print_vector(std::ostream& s, const VECTOR& v)
// {
// const unsigned int n = (unsigned int)(sqrt(v.size())+.3);
// unsigned int k=0;
int main()
{
- ofstream logfile("mg.output");
+ std::ofstream logfile("mg.output");
deallog.attach(logfile);
deallog.depth_console(0);
deallog << "Level " << level << " size " << size << std::endl;
// Make matrix
- vector<SparsityPattern> structure(maxlevel+1);
+ std::vector<SparsityPattern> structure(maxlevel+1);
MGLevelObject<SparseMatrix<double> > A(minlevel,maxlevel);
FDMatrix testproblem(size, size);
f = 1.;//(size*size);
solver.solve(A[level], u, f, precondition);
- ofstream out("T");
+ std::ofstream out("T");
testproblem.gnuplot_print(out,u);
}
}
int main()
{
- ofstream logfile("mgbase.output");
+ std::ofstream logfile("mgbase.output");
deallog.attach(logfile);
deallog.depth_console(0);
int main()
{
- ofstream logfile("solver.output");
- logfile.setf(ios::fixed);
+ std::ofstream logfile("solver.output");
+ logfile.setf(std::ios::fixed);
logfile.precision(2);
deallog.attach(logfile);
deallog.depth_console(0);
{
check_method(cg,A,u,f,prec_sor);
}
- catch (exception& e)
+ catch (std::exception& e)
{
- deallog << e.what() << endl;
+ deallog << e.what() << std::endl;
}
check_method(bicgstab,A,u,f,prec_sor);
deallog.pop();
}
- catch (exception& e)
+ catch (std::exception& e)
{
- cerr << e.what() << endl;
+ std::cerr << e.what() << std::endl;
}
};
};
int main()
{
- ofstream logfile("sparse_ilu.output");
- logfile.setf(ios::fixed);
+ std::ofstream logfile("sparse_ilu.output");
+ logfile.setf(std::ios::fixed);
logfile.precision(3);
deallog.attach(logfile);
deallog.depth_console(0);
int
main ()
{
- ofstream logfile("sparsity_pattern.output");
- logfile.setf(ios::fixed);
+ std::ofstream logfile("sparsity_pattern.output");
+ logfile.setf(std::ios::fixed);
logfile.precision(3);
deallog.attach(logfile);
deallog.depth_console(0);
template<typename number>
void
-FDMatrix::gnuplot_print(ostream& s, const Vector<number>& V) const
+FDMatrix::gnuplot_print(std::ostream& s, const Vector<number>& V) const
{
for(unsigned int i=0;i<=ny-2;i++)
{
template void FDMatrix::laplacian(SparseMatrix<long double>&) const;
template void FDMatrix::laplacian(SparseMatrix<double>&) const;
template void FDMatrix::laplacian(SparseMatrix<float>&) const;
-template void FDMatrix::gnuplot_print(ostream& s, const Vector<long double>& V) const;
-template void FDMatrix::gnuplot_print(ostream& s, const Vector<double>& V) const;
-template void FDMatrix::gnuplot_print(ostream& s, const Vector<float>& V) const;
+template void FDMatrix::gnuplot_print(std::ostream& s, const Vector<long double>& V) const;
+template void FDMatrix::gnuplot_print(std::ostream& s, const Vector<double>& V) const;
+template void FDMatrix::gnuplot_print(std::ostream& s, const Vector<float>& V) const;
void laplacian(SparseMatrix<number>&) const;
template <typename number>
- void gnuplot_print(ostream&, const Vector<number>&) const;
+ void gnuplot_print(std::ostream&, const Vector<number>&) const;
private:
/**
sum = 0.;
for (unsigned int i=0;i<N;++i)
- sum += fabs(2.-.5*i);
+ sum += std::fabs(2.-.5*i);
deallog << d3.l1_norm() << '\t' << sum << std::endl;
sum = 0.;
for (unsigned int i=0;i<N;++i)
{
- double t = fabs(2.-.5*i);
+ double t = std::fabs(2.-.5*i);
if (t>sum) sum = t;
}
deallog << d3.linfty_norm() << '\t' << sum << std::endl;
int main()
{
- ofstream logfile("vector-vector.output");
- logfile.setf(ios::fixed);
+ std::ofstream logfile("vector-vector.output");
+ logfile.setf(std::ios::fixed);
logfile.precision(2);
deallog.attach(logfile);
deallog.depth_console(0);