23 #include <cusp/detail/config.h>
26 #include <cusp/detail/type_traits.h>
41 template <
typename DerivedPolicy,
43 int amax(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
79 template <
typename ArrayType>
80 int amax(
const ArrayType& x);
83 template <
typename DerivedPolicy,
85 typename cusp::norm_type<typename ArrayType::value_type>::type
86 asum(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
122 template <
typename ArrayType>
123 typename cusp::norm_type<typename ArrayType::value_type>::type
124 asum(
const ArrayType& x);
127 template <
typename DerivedPolicy,
131 void axpy(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
134 const ScalarType alpha);
175 template <
typename ArrayType1,
178 void axpy(
const ArrayType1& x,
180 const ScalarType alpha);
183 template <
typename DerivedPolicy,
187 typename ScalarType1,
188 typename ScalarType2>
189 void axpby(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
244 template <
typename ArrayType1,
247 typename ScalarType1,
248 typename ScalarType2>
249 void axpby(
const ArrayType1& x,
256 template <
typename DerivedPolicy,
261 typename ScalarType1,
262 typename ScalarType2,
263 typename ScalarType3>
264 void axpbypcz(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
330 template <
typename ArrayType1,
334 typename ScalarType1,
335 typename ScalarType2,
336 typename ScalarType3>
346 template <
typename DerivedPolicy,
350 void xmy(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
393 template <
typename ArrayType1,
396 void xmy(
const ArrayType1& x,
401 template <
typename DerivedPolicy,
404 void copy(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
441 template <
typename ArrayType1,
443 void copy(
const ArrayType1& x,
447 template <
typename DerivedPolicy,
450 typename ArrayType1::value_type
451 dot(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
453 const ArrayType2& y);
488 template <
typename ArrayType1,
490 typename ArrayType1::value_type
491 dot(
const ArrayType1& x,
492 const ArrayType2& y);
495 template <
typename DerivedPolicy,
498 typename ArrayType1::value_type
499 dotc(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
501 const ArrayType2& y);
536 template <
typename ArrayType1,
538 typename ArrayType1::value_type
539 dotc(
const ArrayType1& x,
540 const ArrayType2& y);
543 template <
typename DerivedPolicy,
546 void fill(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
548 const ScalarType alpha);
580 template <
typename ArrayType,
582 void fill(ArrayType& x,
583 const ScalarType alpha);
586 template <
typename DerivedPolicy,
588 typename cusp::norm_type<typename ArrayType::value_type>::type
589 nrm1(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
590 const ArrayType& array);
623 template <
typename ArrayType>
624 typename cusp::norm_type<typename ArrayType::value_type>::type
625 nrm1(
const ArrayType& x);
628 template <
typename DerivedPolicy,
630 typename cusp::norm_type<typename ArrayType::value_type>::type
631 nrm2(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
665 template <
typename ArrayType>
666 typename cusp::norm_type<typename ArrayType::value_type>::type
667 nrm2(
const ArrayType& x);
670 template <
typename DerivedPolicy,
672 typename cusp::norm_type<typename ArrayType::value_type>::type
673 nrmmax(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
707 template <
typename ArrayType>
708 typename cusp::norm_type<typename ArrayType::value_type>::type
709 nrmmax(
const ArrayType& x);
712 template <
typename DerivedPolicy,
715 void scal(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
717 const ScalarType alpha);
752 template <
typename ArrayType,
754 void scal(ArrayType& x,
755 const ScalarType alpha);
758 template <
typename DerivedPolicy,
762 void gemv(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
815 template<
typename Array2d1,
818 void gemv(
const Array2d1& A,
823 template <
typename DerivedPolicy,
827 void ger(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
877 template<
typename Array1d1,
880 void ger(
const Array1d1& x,
885 template <
typename DerivedPolicy,
889 void symv(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
942 template <
typename Array2d1,
945 void symv(
const Array2d1& A,
950 template <
typename DerivedPolicy,
953 void syr(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
997 template <
typename Array1d,
999 void syr(
const Array1d& x,
1003 template <
typename DerivedPolicy,
1006 void trmv(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1058 template<
typename Array2d,
1060 void trmv(
const Array2d& A,
1064 template <
typename DerivedPolicy,
1067 void trsv(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1114 template<
typename Array2d,
1116 void trsv(
const Array2d& A,
1120 template <
typename DerivedPolicy,
1124 void gemm(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1172 template<
typename Array2d1,
1175 void gemm(
const Array2d1& A,
1180 template <
typename DerivedPolicy,
1184 void symm(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1232 template<
typename Array2d1,
1235 void symm(
const Array2d1& A,
1240 template <
typename DerivedPolicy,
1243 void syrk(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1290 template<
typename Array2d1,
1292 void syrk(
const Array2d1& A,
1296 template <
typename DerivedPolicy,
1300 void syr2k(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1348 template<
typename Array2d1,
1351 void syr2k(
const Array2d1& A,
1356 template <
typename DerivedPolicy,
1359 void trmm(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1406 template<
typename Array2d1,
1408 void trmm(
const Array2d1& A,
1412 template <
typename DerivedPolicy,
1415 void trsm(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
1464 template<
typename Array2d1,
1466 void trsm(
const Array2d1& A,
1475 #include <cusp/blas/blas.inl>
void ger(const Array1d1 &x, const Array1d2 &y, Array2d1 &A)
Performs a rank-1 update of a general matrix.
void trmv(const Array2d &A, Array1d &x)
Computes a matrix-vector product using a triangular matrix.
void symv(const Array2d1 &A, const Array1d1 &x, Array1d2 &y)
Computes a matrix-vector product using a symmetric matrix.
void symm(const Array2d1 &A, const Array2d2 &B, Array2d3 &C)
Computes a matrix-matrix product where one input matrix is symmetric.
void syrk(const Array2d1 &A, Array2d2 &B)
Performs a symmetric rank-k update.
void gemm(const Array2d1 &A, const Array2d2 &B, Array2d3 &C)
Computes a matrix-matrix product with general matrices.
cusp::norm_type< typename ArrayType::value_type >::type asum(const ArrayType &x)
sum of absolute value of all entries in array
cusp::norm_type< typename ArrayType::value_type >::type nrm2(const ArrayType &x)
vector 2-norm (sqrt(sum x[i] * x[i] )
void scal(ArrayType &x, const ScalarType alpha)
scale vector (x[i] = alpha * x[i])
void axpbypcz(const ArrayType1 &x, const ArrayType2 &y, const ArrayType3 &z, ArrayType4 &w, ScalarType1 alpha, ScalarType2 beta, ScalarType3 gamma)
compute linear combination of three vectors (output = alpha * x + beta * y + gamma * z) ...
void syr(const Array1d &x, Array2d &A)
Performs a rank-1 update of a symmetric matrix.
ArrayType1::value_type dotc(const ArrayType1 &x, const ArrayType2 &y)
conjugate dot product (conjugate(x)^T * y)
cusp::norm_type< typename ArrayType::value_type >::type nrm1(const ArrayType &x)
vector 1-norm (sum abs(x[i]))
void trsv(const Array2d &A, Array1d &x)
Solve a triangular matrix equation.
ArrayType1::value_type dot(const ArrayType1 &x, const ArrayType2 &y)
dot product (x^T * y)
void axpby(const ArrayType1 &x, const ArrayType2 &y, ArrayType3 &z, ScalarType1 alpha, ScalarType2 beta)
compute linear combination of two vectors (z = alpha * x + beta * y)
void copy(const ArrayType1 &x, ArrayType2 &y)
vector copy (y = x)
void axpy(const ArrayType1 &x, ArrayType2 &y, const ScalarType alpha)
scaled vector addition (y = alpha * x + y)
void syr2k(const Array2d1 &A, const Array2d2 &B, Array2d3 &C)
Performs a symmetric rank-2k update.
int amax(const ArrayType &x)
index of the largest element in a array
cusp::norm_type< typename ArrayType::value_type >::type nrmmax(const ArrayType &x)
vector infinity norm
void gemv(const Array2d1 &A, const Array1d1 &x, Array1d2 &y)
Computes a matrix-vector product using a general matrix.
void fill(ArrayType &x, const ScalarType alpha)
vector fill (x[i] = alpha)
void trsm(const Array2d1 &A, Array2d2 &B)
Solve a triangular matrix equation.
void trmm(const Array2d1 &A, Array2d2 &B)
Computes a matrix-matrix product where one input matrix is triangular.
void xmy(const ArrayType1 &x, const ArrayType2 &y, ArrayType3 &z)
elementwise multiplication of two vectors (z[i] = x[i] * y[i])