52 detail::use_builtin_matrix_ops<Matrix>::value &&
53 math::static_rows<typename value_type<Matrix>::type>::value == math::static_rows<typename value_type<Vector1>::type>::value &&
54 math::static_rows<typename value_type<Matrix>::type>::value == math::static_rows<typename value_type<Vector2>::type>::value>>
56 static void apply(Alpha alpha,
const Matrix& A,
const Vector1& x, Beta beta,
Vector2& y)
58 typedef typename value_type<Vector2>::type V;
60 const ptrdiff_t n =
static_cast<ptrdiff_t
>(nbRow(A));
63 if (!math::is_zero(beta)) {
64 for (ptrdiff_t i = begin; i < (begin + size); ++i) {
65 V sum = math::zero<V>();
66 for (
typename row_iterator<Matrix>::type a = row_begin(A, i); a; ++a)
67 sum += a.value() * x[a.col()];
68 y[i] = alpha * sum + beta * y[i];
72 for (ptrdiff_t i = begin; i < (begin + size); ++i) {
73 V sum = math::zero<V>();
74 for (
typename row_iterator<Matrix>::type a = row_begin(A, i); a; ++a)
75 sum += a.value() * x[a.col()];
88 std::enable_if_t<detail::use_builtin_matrix_ops<Matrix>::value &&
89 math::static_rows<typename value_type<Matrix>::type>::value == math::static_rows<typename value_type<Vector1>::type>::value &&
90 math::static_rows<typename value_type<Matrix>::type>::value == math::static_rows<typename value_type<Vector2>::type>::value &&
91 math::static_rows<typename value_type<Matrix>::type>::value == math::static_rows<typename value_type<Vector3>::type>::value>>
93 static void apply(Vector1
const& rhs,
98 typedef typename value_type<Vector3>::type V;
99 const ptrdiff_t n =
static_cast<ptrdiff_t
>(nbRow(A));
102 for (ptrdiff_t i = begin; i < (begin+size); ++i) {
103 V sum = math::zero<V>();
104 for (
typename row_iterator<Matrix>::type a = row_begin(A, i); a; ++a)
105 sum += a.value() * x[a.col()];
106 res[i] = rhs[i] - sum;
121 std::enable_if_t<detail::use_builtin_matrix_ops<Matrix>::value &&
122 (math::static_rows<typename value_type<Matrix>::type>::value != math::static_rows<typename value_type<Vector1>::type>::value ||
123 math::static_rows<typename value_type<Matrix>::type>::value != math::static_rows<typename value_type<Vector2>::type>::value)>>
125 static void apply(Alpha alpha,
const Matrix& A,
const Vector1& x, Beta beta,
Vector2& y)
127 typedef typename value_type<Matrix>::type V;
129 auto X = backend::reinterpret_as_rhs<V>(x);
130 auto Y = backend::reinterpret_as_rhs<V>(y);
132 spmv(alpha, A, X, beta, Y);
141 std::enable_if_t<detail::use_builtin_matrix_ops<Matrix>::value &&
142 (math::static_rows<typename value_type<Matrix>::type>::value != math::static_rows<typename value_type<Vector1>::type>::value ||
143 math::static_rows<typename value_type<Matrix>::type>::value != math::static_rows<typename value_type<Vector2>::type>::value ||
144 math::static_rows<typename value_type<Matrix>::type>::value != math::static_rows<typename value_type<Vector3>::type>::value)>>
146 static void apply(Vector1
const& f,
151 typedef typename value_type<Matrix>::type V;
153 auto X = backend::reinterpret_as_rhs<V>(x);
154 auto F = backend::reinterpret_as_rhs<V>(f);
155 auto R = backend::reinterpret_as_rhs<V>(r);
157 residual(F, A, X, R);
void arccoreParallelFor(const ComplexForLoopRanges< RankValue > &loop_ranges, const ForLoopRunInfo &run_info, const LambdaType &lambda_function, const ReducerArgs &... reducer_args)
Applies the lambda function lambda_function concurrently over the iteration interval given by loop_ra...