Fork me on GitHub
 All Classes Files Functions Variables Groups Pages
sor.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/array1d.h>
25 #include <cusp/linear_operator.h>
26 
28 
29 namespace cusp
30 {
31 namespace relaxation
32 {
33 
97 template <typename ValueType, typename MemorySpace>
98 class sor : public cusp::linear_operator<ValueType, MemorySpace>
99 {
100 public:
101 
102  /* \cond */
103  ValueType default_omega;
106  /* \endcond */
107 
110  sor(void) {}
111 
123  template <typename MatrixType>
124  sor(const MatrixType& A, const ValueType omega, sweep default_direction=SYMMETRIC)
125  : default_omega(omega), temp(A.num_cols), gs(A, default_direction) {}
126 
133  template<typename MemorySpace2>
135  : default_omega(A.default_omega), temp(A.temp), gs(A.gs) {}
136 
148  template <typename MatrixType, typename VectorType1, typename VectorType2>
149  void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x);
150 
164  template <typename MatrixType, typename VectorType1, typename VectorType2>
165  void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x, const ValueType omega, sweep direction);
166 };
170 } // end namespace relaxation
171 } // end namespace cusp
172 
173 #include <cusp/relaxation/detail/sor.inl>
174 
sor(const MatrixType &A, const ValueType omega, sweep default_direction=SYMMETRIC)
Definition: sor.h:124
sor(const sor< ValueType, MemorySpace2 > &A)
Definition: sor.h:134
Represents a Successive Over-Relaxation relaxation scheme.
Definition: sor.h:98
Represents a Gauss-Seidel relaxation scheme.
Definition: gauss_seidel.h:104
Abstract representation of a linear operator.
Abstract interface for iterative solvers.
Gauss-Seidel relaxation.
1D array of elements that may reside in "host" or "device" memory space
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x)