/[escript]/trunk/cusplibrary/cusp/relaxation/polynomial.h
ViewVC logotype

Contents of /trunk/cusplibrary/cusp/relaxation/polynomial.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5148 - (show annotations)
Mon Sep 15 01:25:23 2014 UTC (5 years, 9 months ago) by caltinay
File MIME type: text/plain
File size: 2589 byte(s)
Merging ripley diagonal storage + CUDA support into trunk.
Options file version has been incremented due to new options
'cuda' and 'nvccflags'.

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
17 /*! \file polynomial.h
18 * \brief polynomial relaxation.
19 */
20
21 #pragma once
22
23 #include <cusp/detail/config.h>
24
25 #include <cusp/linear_operator.h>
26
27 namespace cusp
28 {
29 namespace precond
30 {
31 namespace aggregation
32 {
33 // forward definitions
34 template<typename MatrixType> struct sa_level;
35 } // end namespace aggregation
36 } // end namespace precond
37
38 namespace relaxation
39 {
40
41 template <typename ValueType, typename MemorySpace>
42 class polynomial : public cusp::linear_operator<ValueType, MemorySpace>
43 {
44 public:
45
46 // note: default_coefficients lives on the host
47 cusp::array1d<ValueType, cusp::host_memory> default_coefficients;
48 cusp::array1d<ValueType, MemorySpace> residual;
49 cusp::array1d<ValueType, MemorySpace> h;
50 cusp::array1d<ValueType, MemorySpace> y;
51
52 polynomial();
53
54 template <typename MatrixType, typename VectorType>
55 polynomial(const MatrixType& A, const VectorType& coefficients);
56
57 template <typename MemorySpace2>
58 polynomial(const polynomial<ValueType,MemorySpace2>& A);
59
60 template <typename MatrixType>
61 polynomial(const cusp::precond::aggregation::sa_level<MatrixType>& sa_level);
62
63 // ignores initial x
64 template<typename MatrixType, typename VectorType1, typename VectorType2>
65 void presmooth(const MatrixType& A, const VectorType1& b, VectorType2& x);
66
67 // smooths initial x
68 template<typename MatrixType, typename VectorType1, typename VectorType2>
69 void postsmooth(const MatrixType& A, const VectorType1& b, VectorType2& x);
70
71 template <typename MatrixType, typename VectorType1, typename VectorType2>
72 void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x) const;
73
74 template <typename MatrixType, typename VectorType1, typename VectorType2, typename VectorType3>
75 void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x, VectorType3& coeffients);
76 };
77
78 } // end namespace relaxation
79 } // end namespace cusp
80
81 #include <cusp/relaxation/detail/polynomial.inl>
82

  ViewVC Help
Powered by ViewVC 1.1.26