CUSP
Loading...
Searching...
No Matches
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>
25
26namespace cusp
27{
28namespace relaxation
29{
30
94template <typename ValueType, typename MemorySpace>
95class jacobi : public cusp::linear_operator<ValueType, MemorySpace>
96{
97public:
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
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 Jacobi relaxation scheme.
Definition jacobi.h:96
jacobi(const jacobi< ValueType, MemorySpace2 > &A)
Definition jacobi.h:128
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x)
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x, const ValueType omega)
jacobi(const MatrixType &A, ValueType omega=1.0)
Abstract interface for iterative solvers.