Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
block_polynomial.h
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 /*
11  * Copyright 2008-2009 NVIDIA Corporation
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License");
14  * you may not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS,
21  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  */
25 
30 #pragma once
31 
32 #include <cusp/detail/config.h>
33 
34 #include <cusp/linear_operator.h>
35 
36 namespace cusp
37 {
38 namespace precond
39 {
40 namespace aggregation
41 {
42 // forward definitions
43 template<typename MatrixType> struct sa_level;
44 } // end namespace aggregation
45 } // end namespace precond
46 
47 namespace relaxation
48 {
49 
50 template <typename ValueType, typename MemorySpace, typename Orientation>
51 class block_polynomial : public cusp::linear_operator<ValueType, MemorySpace>
52 {
53 public:
54 
55  typedef Orientation orientation;
56 
57  // note: default_coefficients lives on the host
58  cusp::array1d<ValueType, cusp::host_memory> default_coefficients;
59  cusp::array2d<ValueType, MemorySpace, Orientation> residual;
60  cusp::array2d<ValueType, MemorySpace, Orientation> h;
61  cusp::array2d<ValueType, MemorySpace, Orientation> y;
62 
64 
65  template <typename MatrixType, typename VectorType>
66  block_polynomial(const MatrixType& A, const VectorType& coefficients);
67 
68  template <typename MemorySpace2>
70 
71  template <typename MatrixType>
73 
74  // ignores initial x
75  template<typename MatrixType, typename VectorType1, typename VectorType2>
76  void presmooth(const MatrixType& A, const VectorType1& b, VectorType2& x);
77 
78  // smooths initial x
79  template<typename MatrixType, typename VectorType1, typename VectorType2>
80  void postsmooth(const MatrixType& A, const VectorType1& b, VectorType2& x);
81 
82  template <typename MatrixType, typename VectorType1, typename VectorType2>
83  void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x) const;
84 
85  template <typename MatrixType, typename VectorType1, typename VectorType2, typename VectorType3>
86  void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x, VectorType3& coeffients);
87 };
88 
89 } // end namespace relaxation
90 } // end namespace cusp
91 
92 #include <cusp/relaxation/block_polynomial.inl>
void presmooth(const MatrixType &A, const VectorType1 &b, VectorType2 &x)
cusp::array2d< ValueType, MemorySpace, Orientation > h
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x) const
cusp::array1d< ValueType, cusp::host_memory > default_coefficients
cusp::array2d< ValueType, MemorySpace, Orientation > residual
void postsmooth(const MatrixType &A, const VectorType1 &b, VectorType2 &x)
cusp::array2d< ValueType, MemorySpace, Orientation > y