24 #include <cusp/detail/config.h>
25 #include <cusp/detail/multilevel.h>
29 #include <cusp/precond/aggregation/detail/sa_view_traits.h>
31 #include <thrust/execution_policy.h>
32 #include <thrust/detail/use_default.h>
44 template<
typename MatrixType>
49 typedef typename MatrixType::index_type IndexType;
50 typedef typename MatrixType::value_type ValueType;
51 typedef typename MatrixType::memory_space MemorySpace;
52 typedef typename cusp::norm_type<ValueType>::type NormType;
62 sa_level(
void) : num_iters(1), rho_DinvA(0) {}
64 template<
typename SALevelType>
65 sa_level(
const SALevelType& L)
67 aggregates(L.aggregates),
69 num_iters(L.num_iters),
70 rho_DinvA(L.rho_DinvA)
154 template <
typename IndexType,
156 typename MemorySpace,
157 typename SmootherType = thrust::use_default,
158 typename SolverType = thrust::use_default,
159 typename Format = thrust::use_default>
161 public cusp::multilevel<IndexType,ValueType,MemorySpace,Format,SmootherType,SolverType>::container
165 typedef typename detail::select_sa_matrix_type<IndexType,ValueType,MemorySpace>::type SetupMatrixType;
166 typedef typename cusp::multilevel<IndexType,ValueType,MemorySpace,Format,SmootherType,SolverType>::container ML;
171 std::vector< sa_level<SetupMatrixType> > sa_levels;
183 template <
typename MatrixType>
192 template <
typename MatrixType,
typename ArrayType>
194 typename thrust::detail::enable_if_convertible<typename ArrayType::format,cusp::array1d_format>::type* = 0);
201 template <
typename MemorySpace2,
typename SmootherType2,
typename SolverType2,
typename Format2>
210 template <
typename MatrixType>
221 template <
typename MatrixType,
typename ArrayType>
222 void initialize(
const MatrixType& A,
const ArrayType& B,
223 typename thrust::detail::enable_if_convertible<typename MatrixType::format,cusp::known_format>::type* = 0);
226 template <
typename DerivedPolicy,
typename MatrixType>
227 void initialize(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
228 const MatrixType& A);
230 template <
typename DerivedPolicy,
typename MatrixType,
typename ArrayType>
231 void initialize(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
232 const MatrixType& A,
const ArrayType& B);
238 template <
typename DerivedPolicy,
typename MatrixType>
239 void extend_hierarchy(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
240 const MatrixType& A);
250 #include <cusp/precond/aggregation/detail/smoothed_aggregation.inl>
The array1d class is a 1D vector container that may contain elements stored in "host" or "device" mem...
Algebraic multigrid preconditoner based on smoothed aggregation.
smoothed_aggregation(void)
void initialize(const MatrixType &A)
1D array of elements that may reside in "host" or "device" memory space