/[escript]/branches/diaplayground/cusplibrary/cusp/krylov/bicgstab_m.h
ViewVC logotype

Contents of /branches/diaplayground/cusplibrary/cusp/krylov/bicgstab_m.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4955 - (show annotations)
Tue May 20 04:33:15 2014 UTC (6 years, 1 month ago) by caltinay
File MIME type: text/plain
File size: 6648 byte(s)
added pristine copy of cusplibrary (apache license) to be used by ripley.

1 /*
2 * Copyright 2008-2009 NVIDIA Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 /*! \file bicgstab_m.h
18 * \brief Multi-mass Biconjugate Gradient stabilized (BiCGstab-M) method
19 */
20
21 #pragma once
22
23 #include <cusp/detail/config.h>
24
25 namespace cusp
26 {
27 namespace krylov
28 {
29
30 // TODO move to bicgstab_m.inl
31 namespace trans_m
32 {
33 template <typename InputIterator1, typename InputIterator2,
34 typename InputIterator3,
35 typename OutputIterator1,
36 typename ScalarType>
37 void compute_z_m(InputIterator1 z_0_s_b, InputIterator1 z_0_s_e,
38 InputIterator2 z_m1_s_b, InputIterator3 sig_b,
39 OutputIterator1 z_1_s_b,
40 ScalarType beta_m1, ScalarType beta_0, ScalarType alpha_0);
41
42 template <typename InputIterator1, typename InputIterator2,
43 typename OutputIterator1,
44 typename ScalarType>
45 void compute_b_m(InputIterator1 z_1_s_b, InputIterator1 z_1_s_e,
46 InputIterator2 z_0_s_b, OutputIterator1 beta_0_s_b,
47 ScalarType beta_0);
48
49 template <typename Array1, typename Array2, typename Array3,
50 typename Array4, typename ScalarType>
51 void compute_z_m(const Array1& z_0_s, const Array2& z_m1_s,
52 const Array3& sig, Array4& z_1_s,
53 ScalarType beta_m1, ScalarType beta_0, ScalarType alpha_0);
54
55 template <typename Array1, typename Array2, typename Array3,
56 typename ScalarType>
57 void compute_b_m(const Array1& z_1_s, const Array2& z_0_s,
58 Array3& beta_0_s, ScalarType beta_0);
59
60 template <typename InputIterator1, typename InputIterator2,
61 typename InputIterator3, typename OutputIterator,
62 typename ScalarType>
63 void compute_a_m(InputIterator1 z_0_s_b, InputIterator1 z_0_s_e,
64 InputIterator2 z_1_s_b, InputIterator3 beta_0_s_b,
65 OutputIterator alpha_0_s_b,
66 ScalarType beta_0, ScalarType alpha_0);
67
68 template <typename Array1, typename Array2, typename Array3,
69 typename Array4, typename ScalarType>
70 void compute_a_m(const Array1& z_0_s, const Array2& z_1_s,
71 const Array3& beta_0_s, Array4& alpha_0_s,
72 ScalarType beta_0, ScalarType alpha_0);
73
74 template <typename Array1, typename Array2, typename Array3,
75 typename Array4, typename Array5, typename Array6, typename Array7>
76 void compute_x_m(const Array1& beta_0_s, const Array2& chi_0_s,
77 const Array3& rho_0_s, const Array4& zeta_1_s,
78 const Array5& w_1, const Array6& s_0_s, Array7& x_0_s);
79
80 template <typename Array1, typename Array2, typename Array3, typename Array4,
81 typename Array5, typename Array6, typename Array7, typename Array8,
82 typename Array9, typename Array10, typename Array11>
83 void compute_s_m(const Array1& beta_0_s, const Array2& chi_0_s,
84 const Array3& rho_0_s, const Array4& zeta_0_s,
85 const Array5& alpha_1_s, const Array6& rho_1_s,
86 const Array7& zeta_1_s,
87 const Array8& r_0, Array9& r_1,
88 const Array10& w_1, Array11& s_0_s);
89
90 template <typename InputIterator1, typename InputIterator2,
91 typename OutputIterator, typename ScalarType>
92 void compute_w_1_m(InputIterator1 r_0_b, InputIterator1 r_0_e,
93 InputIterator2 As_b, OutputIterator w_1_b,
94 const ScalarType beta_0);
95
96 template <typename Array1, typename Array2, typename Array3,
97 typename ScalarType>
98 void compute_w_1_m(const Array1& r_0, const Array2& As, Array3& w_1,
99 const ScalarType beta_0);
100
101 template <typename InputIterator1, typename InputIterator2,
102 typename OutputIterator, typename ScalarType>
103 void compute_r_1_m(InputIterator1 w_1_b, InputIterator1 w_1_e,
104 InputIterator2 Aw_b, OutputIterator r_1_b,
105 ScalarType chi_0);
106
107 template <typename Array1, typename Array2, typename Array3,
108 typename ScalarType>
109 void compute_r_1_m(const Array1& w_1, const Array2& Aw, Array3& r_1,
110 ScalarType chi_0);
111
112 template <typename InputIterator1, typename InputIterator2,
113 typename OutputIterator, typename ScalarType>
114 void compute_s_0_m(InputIterator1 r_1_b, InputIterator1 r_1_e,
115 InputIterator2 As_b, OutputIterator s_0_b,
116 ScalarType alpha_1, ScalarType chi_0);
117
118 template <typename Array1, typename Array2, typename Array3,
119 typename ScalarType>
120 void compute_s_0_m(const Array1& r_1, const Array2& As, Array3& s_0,
121 ScalarType alpha_1, ScalarType chi_0);
122
123 template <typename InputIterator, typename OutputIterator,
124 typename ScalarType>
125 void compute_chi_m(InputIterator sigma_b, InputIterator sigma_e,
126 OutputIterator chi_0_s_b, ScalarType chi_0);
127
128 template <typename Array1, typename Array2, typename ScalarType>
129 void compute_chi_m(const Array1& sigma, Array2& chi_0_s, ScalarType chi_0);
130
131 template <typename InputIterator1, typename InputIterator2,
132 typename OutputIterator, typename ScalarType>
133 void compute_rho_m(InputIterator1 rho_0_s_b, InputIterator1 rho_0_s_e,
134 InputIterator2 sigma_b, OutputIterator rho_1_s_b,
135 ScalarType chi_0);
136
137 template <typename Array1, typename Array2, typename Array3,
138 typename ScalarType>
139 void compute_rho_m(const Array1& rho_0_s, const Array2& sigma,
140 Array3& rho_1_s, ScalarType chi_0);
141
142 template <typename Array1, typename Array2>
143 void vectorize_copy(const Array1& source, Array2& dest);
144
145 } // end namespace trans_m
146
147 /*! \addtogroup iterative_solvers Iterative Solvers
148 * \addtogroup krylov_methods Krylov Methods
149 * \ingroup iterative_solvers
150 * \{
151 */
152
153 /*! \p bicgstab_m : Multi-mass Biconjugate Gradient stabilized method
154 */
155 template <class LinearOperator,
156 class VectorType1, class VectorType2, class VectorType3>
157 void bicgstab_m(LinearOperator& A,
158 VectorType1& x, VectorType2& b, VectorType3& sigma);
159
160 /*! \p bicgstab_m : Multi-mass Biconjugate Gradient stabilized method
161 */
162 template <class LinearOperator,
163 class VectorType1, class VectorType2, class VectorType3,
164 class Monitor>
165 void bicgstab_m(LinearOperator& A,
166 VectorType1& x, VectorType2& b, VectorType3& sigma,
167 Monitor& monitor);
168 /*! \}
169 */
170
171 } // end namespace krylov
172 } // end namespace cusp
173
174 #include<cusp/krylov/detail/bicgstab_m.inl>
175

  ViewVC Help
Powered by ViewVC 1.1.26