Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
block_jacobi.h
Go to the documentation of this file.
1/*
2 * Copyright 2008-2009 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
26namespace cusp
27{
28namespace precond
29{
30namespace aggregation
31{
32// forward definitions
33template<typename MatrixType> struct sa_level;
34} // end namespace aggregation
35} // end namespace precond
36
37namespace relaxation
38{
39
40template <typename ValueType, typename MemorySpace>
41class block_jacobi : public cusp::linear_operator<ValueType, MemorySpace>
42{
43public:
44 ValueType default_omega;
45 cusp::array1d<ValueType,MemorySpace> diagonal;
46 cusp::array2d<ValueType,MemorySpace> temp;
47
49
50 template <typename MatrixType>
51 block_jacobi(const MatrixType& A, ValueType omega=1.0);
52
53 template <typename MemorySpace2>
54 block_jacobi(const block_jacobi<ValueType,MemorySpace2>& A);
55
56 template <typename MatrixType>
57 block_jacobi(const cusp::precond::aggregation::sa_level<MatrixType>& sa_level, ValueType weight=4.0/3.0);
58
59 // ignores initial x
60 template<typename MatrixType, typename VectorType1, typename VectorType2>
61 void presmooth(const MatrixType& A, const VectorType1& b, VectorType2& x);
62
63 // smooths initial x
64 template<typename MatrixType, typename VectorType1, typename VectorType2>
65 void postsmooth(const MatrixType& A, const VectorType1& b, VectorType2& x);
66
67 template <typename MatrixType, typename VectorType1, typename VectorType2>
68 void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x);
69
70 template <typename MatrixType, typename VectorType1, typename VectorType2>
71 void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x, ValueType omega);
72};
73
74} // end namespace relaxation
75} // end namespace cusp
76
77#include <cusp/relaxation/block_jacobi.inl>
78
cusp::array2d< ValueType, MemorySpace > temp
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x, ValueType omega)
cusp::array1d< ValueType, MemorySpace > diagonal
void presmooth(const MatrixType &A, const VectorType1 &b, VectorType2 &x)
void postsmooth(const MatrixType &A, const VectorType1 &b, VectorType2 &x)
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x)
block_jacobi(const cusp::precond::aggregation::sa_level< MatrixType > &sa_level, ValueType weight=4.0/3.0)
block_jacobi(const block_jacobi< ValueType, MemorySpace2 > &A)
block_jacobi(const MatrixType &A, ValueType omega=1.0)