itl_fwd.hpp 4.16 KB
Newer Older
1
// Software License for MTL
2
//
3
4
5
6
7
// 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
8
//
9
// This file is part of the Matrix Template Library
10
//
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// See also license.mtl.txt in the distribution.

#ifndef ITL_ITL_FWD_INCLUDE
#define ITL_ITL_FWD_INCLUDE

#include <boost/numeric/mtl/concept/collection.hpp>

namespace itl {

    template <class Real>                class basic_iteration;
    template <class Real, class OStream> class cyclic_iteration;
    template <class Real, class OStream> class noisy_iteration;

    template <typename Solver, typename VectorIn, bool trans> class solver_proxy;

    namespace pc {

	template <typename PC, typename Vector, bool> struct solver;
	template <typename Matrix, typename Value> class identity;
30
	// template <typename Matrix, typename Value, typename Vector> Vector solve(const identity<Matrix>&, const Vector& x);
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
	// template <typename Matrix, typename Vector> Vector adjoint_solve(const identity<Matrix>&, const Vector& x);

	template <typename Matrix, typename Value> class diagonal;
	// template <typename Matrix, typename Vector> Vector solve(const diagonal<Matrix>& P, const Vector& x);
	// template <typename Matrix, typename Vector> Vector adjoint_solve(const diagonal<Matrix>& P, const Vector& x);

	template <typename Matrix, typename Factorizer, typename Value> class ilu;
	template <typename Matrix, typename Value> class ilu_0; // Maybe we should declare the default here???
	template <typename Matrix, typename Value> class ilut; // Maybe we should declare the default here???
	// template <typename Matrix, typename Vector> Vector solve(const ilu_0<Matrix>& P, const Vector& x);
	// template <typename Matrix, typename Vector> Vector adjoint_solve(const ilu_0<Matrix>& P, const Vector& x);

	template <typename Matrix, typename Value> class ic_0; // Maybe we should declare the default here???
	// template <typename Matrix, typename Vector> Vector solve(const ic_0<Matrix>& P, const Vector& x);
	// template <typename Matrix, typename Value, typename Vector> Vector adjoint_solve(const ic_0<Matrix, Value>& P, const Vector& x);

    } //  namespace pc

49
    template < typename LinearOperator, typename HilbertSpaceX, typename HilbertSpaceB,
50
	       typename Preconditioner, typename Iteration >
51
    int cg(const LinearOperator& A, HilbertSpaceX& x, const HilbertSpaceB& b,
52
53
	   const Preconditioner& M, Iteration& iter);

54
    template < typename LinearOperator, typename Preconditioner= pc::identity<LinearOperator, double>,
55
56
57
58
	       typename RightPreconditioner= pc::identity<LinearOperator, double> >
    class cg_solver;


59
    template < typename LinearOperator, typename Vector,
60
61
62
63
	       typename Preconditioner, typename Iteration >
    int bicg(const LinearOperator &A, Vector &x, const Vector &b,
	     const Preconditioner &M, Iteration& iter);

64
    template < class LinearOperator, class HilbertSpaceX, class HilbertSpaceB,
65
	       class Preconditioner, class Iteration >
66
    int bicgstab(const LinearOperator& A, HilbertSpaceX& x, const HilbertSpaceB& b,
67
68
		 const Preconditioner& M, Iteration& iter);

69
    template < class LinearOperator, class HilbertSpaceX, class HilbertSpaceB,
70
	       class Preconditioner, class Iteration >
71
    int bicgstab_2(const LinearOperator& A, HilbertSpaceX& x, const HilbertSpaceB& b,
72
73
		   const Preconditioner& M, Iteration& iter);

74
75
    template < typename LinearOperator, typename Vector,
	       typename LeftPreconditioner, typename RightPreconditioner,
76
77
	       typename Iteration >
    int bicgstab_ell(const LinearOperator &A, Vector &x, const Vector &b,
78
		     const LeftPreconditioner &L, const RightPreconditioner &R,
79
80
		     Iteration& iter, size_t l);

81
    template < typename LinearOperator, typename Preconditioner= pc::identity<LinearOperator, double>,
82
83
84
85
86
87
88
89
90
	       typename RightPreconditioner= pc::identity<LinearOperator, double> >
    class bicgstab_ell_solver;

    template <typename Solver, unsigned N, bool Stored= false>
    class repeating_solver;

} // namespace itl

#endif // ITL_ITL_FWD_INCLUDE