Fork me on GitHub
 All Classes Files Functions Variables Groups Pages
cg.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2014 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 
21 #pragma once
22 
23 #include <cusp/detail/config.h>
24 
25 #include <thrust/execution_policy.h>
26 
27 namespace cusp
28 {
29 namespace krylov
30 {
31 
40 /* \cond */
41 template <typename DerivedPolicy,
42  class LinearOperator,
43  class Vector>
44 void cg(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
45  LinearOperator& A,
46  Vector& x,
47  Vector& b);
48 
54 template <class LinearOperator,
55  class Vector>
56 void cg(LinearOperator& A,
57  Vector& x,
58  Vector& b);
59 
60 template <typename DerivedPolicy,
61  class LinearOperator,
62  class Vector,
63  class Monitor>
64 void cg(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
65  LinearOperator& A,
66  Vector& x,
67  Vector& b,
68  Monitor& monitor);
69 
74 template <class LinearOperator,
75  class Vector,
76  class Monitor>
77 void cg(LinearOperator& A,
78  Vector& x,
79  Vector& b,
80  Monitor& monitor);
81 
82 template <typename DerivedPolicy,
83  class LinearOperator,
84  class Vector,
85  class Monitor,
86  class Preconditioner>
87 void cg(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
88  LinearOperator& A,
89  Vector& x,
90  Vector& b,
91  Monitor& monitor,
92  Preconditioner& M);
93 /* \endcond */
94 
157 template <class LinearOperator,
158  class Vector,
159  class Monitor,
160  class Preconditioner>
161 void cg(LinearOperator& A,
162  Vector& x,
163  Vector& b,
164  Monitor& monitor,
165  Preconditioner& M);
169 } // end namespace krylov
170 } // end namespace cusp
171 
172 #include <cusp/krylov/detail/cg.inl>
void cg(LinearOperator &A, Vector &x, Vector &b, Monitor &monitor, Preconditioner &M)
Conjugate Gradient method.