Fork me on GitHub
 All Classes Files Functions Variables Groups Pages
jacobi.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 #include <cusp/linear_operator.h>
25 
26 namespace cusp
27 {
28 namespace relaxation
29 {
30 
94 template <typename ValueType, typename MemorySpace>
95 class jacobi : public cusp::linear_operator<ValueType, MemorySpace>
96 {
97 public:
98 
99  /* \cond */
100  ValueType default_omega;
103  /* \endcond */
104 
107  jacobi(void) : default_omega(0.0) {}
108 
118  template <typename MatrixType>
119  jacobi(const MatrixType& A, ValueType omega=1.0);
120 
127  template<typename MemorySpace2>
129  : default_omega(A.default_omega), diagonal(A.diagonal), temp(A.temp){}
130 
142  template <typename MatrixType, typename VectorType1, typename VectorType2>
143  void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x);
144 
156  template <typename MatrixType, typename VectorType1, typename VectorType2>
157  void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x, const ValueType omega);
158 };
162 } // end namespace relaxation
163 } // end namespace cusp
164 
165 #include <cusp/relaxation/detail/jacobi.inl>
166 
jacobi(const jacobi< ValueType, MemorySpace2 > &A)
Definition: jacobi.h:128
Represents a Jacobi relaxation scheme.
Definition: jacobi.h:95
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x)
Abstract representation of a linear operator.
Abstract interface for iterative solvers.