CUSP
Loading...
Searching...
No Matches
gauss_seidel.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>
25
26namespace cusp
27{
28namespace relaxation
29{
30
38/* \cond */
39typedef enum
40{
41 FORWARD,
42 BACKWARD,
43 SYMMETRIC
44} sweep;
45/* \endcond */
46
103template <typename ValueType, typename MemorySpace>
104class gauss_seidel : public cusp::linear_operator<ValueType, MemorySpace>
105{
106public:
107
108 /* \cond */
112 sweep default_direction;
113 /* \endcond */
114
117 gauss_seidel(void) : default_direction(SYMMETRIC) {}
118
129 template <typename MatrixType>
130 gauss_seidel(const MatrixType& A, sweep default_direction=SYMMETRIC,
131 thrust::detail::enable_if_convertible_t<typename MatrixType::format,cusp::csr_format>* = 0);
132
139 template<typename MemorySpace2>
141 : ordering(A.ordering), color_offsets(A.color_offsets), default_direction(A.default_direction) {}
142
154 template <typename MatrixType, typename VectorType1, typename VectorType2>
155 void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x);
156
169 template <typename MatrixType, typename VectorType1, typename VectorType2>
170 void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x, sweep direction);
171};
175} // end namespace relaxation
176} // end namespace cusp
177
178#include <cusp/relaxation/detail/gauss_seidel.inl>
179
The array1d class is a 1D vector container that may contain elements stored in "host" or "device" mem...
Definition array1d.h:99
Abstract representation of a linear operator.
Represents a Gauss-Seidel relaxation scheme.
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x)
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x, sweep direction)
gauss_seidel(const gauss_seidel< ValueType, MemorySpace2 > &A)
gauss_seidel(const MatrixType &A, sweep default_direction=SYMMETRIC, thrust::detail::enable_if_convertible_t< typename MatrixType::format, cusp::csr_format > *=0)
Abstract interface for iterative solvers.