CUSP
Loading...
Searching...
No Matches
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>
26
28
29namespace cusp
30{
31namespace relaxation
32{
33
97template <typename ValueType, typename MemorySpace>
98class sor : public cusp::linear_operator<ValueType, MemorySpace>
99{
100public:
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
1D array of elements that may reside in "host" or "device" memory space
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.
Represents a Successive Over-Relaxation relaxation scheme.
Definition sor.h:99
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x, const ValueType omega, sweep direction)
sor(const sor< ValueType, MemorySpace2 > &A)
Definition sor.h:134
sor(const MatrixType &A, const ValueType omega, sweep default_direction=SYMMETRIC)
Definition sor.h:124
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x)
Gauss-Seidel relaxation.
Abstract interface for iterative solvers.