Fork me on GitHub
 All Classes Files Functions Variables Groups Pages
ainv.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2010 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 #include <cusp/hyb_matrix.h>
27 
28 namespace cusp
29 {
30 namespace precond
31 {
32 
33 
51 template <typename ValueType, typename MemorySpace>
52 class scaled_bridson_ainv : public linear_operator<ValueType, MemorySpace>
53 {
54 private:
56 
57 public:
60 
70  template<typename MatrixTypeA>
71  scaled_bridson_ainv(const MatrixTypeA & A, ValueType drop_tolerance=0.1, int nonzero_per_row=-1, bool lin_dropping=false, int lin_param=1);
72 
80  template <typename VectorType1, typename VectorType2>
81  void operator()(const VectorType1& x, VectorType2& y);
82 
83 protected:
84 
86 };
87 
98 template <typename ValueType, typename MemorySpace>
99 class bridson_ainv : public linear_operator<ValueType, MemorySpace>
100 {
101 private:
103 
104 public:
108 
118  template<typename MatrixTypeA>
119  bridson_ainv(const MatrixTypeA & A, ValueType drop_tolerance=0.1, int nonzero_per_row =-1, bool lin_dropping=false, int lin_param=1);
120 
128  template <typename VectorType1, typename VectorType2>
129  void operator()(const VectorType1& x, VectorType2& y);
130 
131 protected:
134 };
135 
142 template <typename ValueType, typename MemorySpace>
143 class nonsym_bridson_ainv : public linear_operator<ValueType, MemorySpace>
144 {
145 private:
147 
148 public:
152 
162  template<typename MatrixTypeA>
163  nonsym_bridson_ainv(const MatrixTypeA & A, ValueType drop_tolerance=0.1, int nonzero_per_row=-1, bool lin_dropping=false, int lin_param=1);
164 
172  template <typename VectorType1, typename VectorType2>
173  void operator()(const VectorType1& x, VectorType2& y);
174 
175 protected:
178 };
182 } // end namespace precond
183 } // end namespace cusp
184 
185 #include <cusp/precond/detail/ainv.inl>
186 
187 
nonsym_bridson_ainv(const MatrixTypeA &A, ValueType drop_tolerance=0.1, int nonzero_per_row=-1, bool lin_dropping=false, int lin_param=1)
bridson_ainv(const MatrixTypeA &A, ValueType drop_tolerance=0.1, int nonzero_per_row=-1, bool lin_dropping=false, int lin_param=1)
void operator()(const VectorType1 &x, VectorType2 &y)
Hybrid ELL/COO matrix format.
scaled_bridson_ainv(const MatrixTypeA &A, ValueType drop_tolerance=0.1, int nonzero_per_row=-1, bool lin_dropping=false, int lin_param=1)
Abstract representation of a linear operator.
Abstract interface for iterative solvers.
void operator()(const VectorType1 &x, VectorType2 &y)
void operator()(const VectorType1 &x, VectorType2 &y)