Fork me on GitHub
 All Classes Files Functions Variables Groups Pages
polynomial.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 
25 #include <cusp/linear_operator.h>
26 
27 namespace cusp
28 {
29 namespace relaxation
30 {
31 
100 template <typename ValueType, typename MemorySpace>
101 class polynomial : public cusp::linear_operator<ValueType, MemorySpace>
102 {
103 public:
104 
105  /* \cond */
106  // note: default_coefficients lives on the host
107  cusp::array1d<ValueType, cusp::host_memory> default_coefficients;
111  /* \endcond */
112 
115  polynomial(void){}
116 
125  template <typename MatrixType>
126  polynomial(const MatrixType& A);
127 
137  template <typename MatrixType, typename VectorType>
138  polynomial(const MatrixType& A, const VectorType& coefficients);
139 
146  template<typename MemorySpace2>
148  : default_coefficients(A.default_coefficients),
149  residual(A.residual), h(A.h), y(A.y) {}
150 
162  template <typename MatrixType, typename VectorType1, typename VectorType2>
163  void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x);
164 
177  template <typename MatrixType, typename VectorType1, typename VectorType2, typename VectorType3>
178  void operator()(const MatrixType& A, const VectorType1& b, VectorType2& x, const VectorType3& coefficients);
179 };
183 } // end namespace relaxation
184 } // end namespace cusp
185 
186 #include <cusp/relaxation/detail/polynomial.inl>
187 
The array1d class is a 1D vector container that may contain elements stored in "host" or "device" mem...
Definition: array1d.h:98
polynomial(const polynomial< ValueType, MemorySpace2 > &A)
Definition: polynomial.h:147
void operator()(const MatrixType &A, const VectorType1 &b, VectorType2 &x)
Abstract representation of a linear operator.
Abstract interface for iterative solvers.
Represents a Polynomial relaxation scheme.
Definition: polynomial.h:101