Commit 836978e9 by Praetorius, Simon

### removed all trailing whitespaces in all git files

parent 5f0ca3b5
 // Software License for MTL // // // Copyright (c) 2007 The Trustees of Indiana University. // 2008 Dresden University of Technology and the Trustees of Indiana University. // 2010 SimuNova UG (haftungsbeschränkt), www.simunova.com. // All rights reserved. // Authors: Peter Gottschling and Andrew Lumsdaine // // // This file is part of the Matrix Template Library // // // See also license.mtl.txt in the distribution. // Written by Jan Bos ... ... @@ -31,12 +31,12 @@ namespace itl { /// Bi-Conjugate Gradient Stabilized(ell) template < typename LinearOperator, typename Vector, typename LeftPreconditioner, typename RightPreconditioner, /// Bi-Conjugate Gradient Stabilized(ell) template < typename LinearOperator, typename Vector, typename LeftPreconditioner, typename RightPreconditioner, typename Iteration > int bicgstab_ell(const LinearOperator &A, Vector &x, const Vector &b, const LeftPreconditioner &L, const RightPreconditioner &R, const LeftPreconditioner &L, const RightPreconditioner &R, Iteration& iter, size_t l) { mtl::vampir_trace<7006> tracer; ... ... @@ -50,7 +50,7 @@ int bicgstab_ell(const LinearOperator &A, Vector &x, const Vector &b, Vector x0(resource(x)), y(resource(x)); mtl::vector::dense_vector r_hat(l+1,Vector(resource(x))), u_hat(l+1,Vector(resource(x))); // shift problem // shift problem x0= zero; r_hat[0]= b; if (two_norm(x) != zero) { ... ... @@ -64,7 +64,7 @@ int bicgstab_ell(const LinearOperator &A, Vector &x, const Vector &b, r_hat[0]= y; u_hat[0]= zero; Scalar rho_0(one), rho_1(zero), alpha(zero), Gamma(zero), beta(zero), omega(one); Scalar rho_0(one), rho_1(zero), alpha(zero), Gamma(zero), beta(zero), omega(one); mtl::matrix::dense2D tau(l+1, l+1); mtl::vector::dense_vector sigma(l+1), gamma(l+1), gamma_a(l+1), gamma_aa(l+1); ... ... @@ -73,20 +73,20 @@ int bicgstab_ell(const LinearOperator &A, Vector &x, const Vector &b, rho_0= -omega * rho_0; for (Size j= 0; j < l; ++j) { rho_1= dot(r0_tilde, r_hat[j]); rho_1= dot(r0_tilde, r_hat[j]); beta= alpha * rho_1/rho_0; rho_0= rho_1; for (Size i= 0; i <= j; ++i) u_hat[i]= r_hat[i] - beta * u_hat[i]; y= A * Vector(solve(R, u_hat[j])); u_hat[j+1]= solve(L, y); Gamma= dot(r0_tilde, u_hat[j+1]); Gamma= dot(r0_tilde, u_hat[j+1]); alpha= rho_0 / Gamma; for (Size i= 0; i <= j; ++i) r_hat[i]-= alpha * u_hat[i+1]; if (iter.finished(r_hat[j])) { x= solve(R, x); x+= x0; ... ... @@ -94,7 +94,7 @@ int bicgstab_ell(const LinearOperator &A, Vector &x, const Vector &b, } r_hat[j+1]= solve(R, r_hat[j]); y= A * r_hat[j+1]; y= A * r_hat[j+1]; r_hat[j+1]= solve(L, y); x+= alpha * u_hat[0]; } ... ... @@ -103,13 +103,13 @@ int bicgstab_ell(const LinearOperator &A, Vector &x, const Vector &b, irange i1m(1, imax); mtl::vector::dense_vector r_hat_tail(r_hat[i1m]); tau[i1m][i1m]= orthogonalize_factors(r_hat_tail); for (Size j= 1; j <= l; ++j) for (Size j= 1; j <= l; ++j) gamma_a[j]= dot(r_hat[j], r_hat[0]) / tau[j][j]; gamma[l]= gamma_a[l]; omega= gamma[l]; if (omega == zero) return iter.fail(3, "bicg breakdown #2"); // is this something like a tri-solve? // is this something like a tri-solve? for (Size j= l-1; j > 0; --j) { Scalar sum= zero; for (Size i=j+1;i<=l;++i) ... ... @@ -134,7 +134,7 @@ int bicgstab_ell(const LinearOperator &A, Vector &x, const Vector &b, /// Solver class for BiCGStab(ell) method; right preconditioner ignored (prints warning if not identity) template < typename LinearOperator, typename Preconditioner, template < typename LinearOperator, typename Preconditioner, typename RightPreconditioner> class bicgstab_ell_solver { ... ... @@ -146,7 +146,7 @@ class bicgstab_ell_solver bicgstab_ell_solver(const LinearOperator& A, size_t l, const Preconditioner& L) : A(A), l(l), L(L), R(A) {} /// Construct solver from a linear operator and left preconditioner bicgstab_ell_solver(const LinearOperator& A, size_t l, const Preconditioner& L, const RightPreconditioner& R) bicgstab_ell_solver(const LinearOperator& A, size_t l, const Preconditioner& L, const RightPreconditioner& R) : A(A), l(l), L(L), R(R) {} /// Solve linear system approximately as specified by \p iter ... ... @@ -163,7 +163,7 @@ class bicgstab_ell_solver itl::basic_iteration iter(x, 1, 0, 0); return solve(b, x, iter); } private: const LinearOperator& A; size_t l; ... ...