ViennaCL - The Vienna Computing Library  1.7.0
Free open-source GPU-accelerated linear algebra and solver library.
vector_operations.hpp File Reference

Implementations of vector operations. More...

Go to the source code of this file.

Namespaces

 viennacl
 Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
 
 viennacl::linalg
 Provides all linear algebra operations which are not covered by operator overloads.
 

Functions

template<typename DestNumericT , typename SrcNumericT >
void viennacl::linalg::convert (vector_base< DestNumericT > &dest, vector_base< SrcNumericT > const &src)
 
template<typename T , typename ScalarType1 >
void viennacl::linalg::av (vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha)
 
template<typename T , typename ScalarType1 , typename ScalarType2 >
void viennacl::linalg::avbv (vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, vector_base< T > const &vec3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
 
template<typename T , typename ScalarType1 , typename ScalarType2 >
void viennacl::linalg::avbv_v (vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, vector_base< T > const &vec3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
 
template<typename T >
void viennacl::linalg::vector_assign (vector_base< T > &vec1, const T &alpha, bool up_to_internal_size=false)
 Assign a constant value to a vector (-range/-slice) More...
 
template<typename T >
void viennacl::linalg::vector_swap (vector_base< T > &vec1, vector_base< T > &vec2)
 Swaps the contents of two vectors, data is copied. More...
 
template<typename T , typename OP >
void viennacl::linalg::element_op (vector_base< T > &vec1, vector_expression< const vector_base< T >, const vector_base< T >, OP > const &proxy)
 Implementation of the element-wise operation v1 = v2 .* v3 and v1 = v2 ./ v3 (using MATLAB syntax) More...
 
template<typename T >
void viennacl::linalg::inner_prod_impl (vector_base< T > const &vec1, vector_base< T > const &vec2, scalar< T > &result)
 Computes the inner product of two vectors - dispatcher interface. More...
 
template<typename LHS , typename RHS , typename OP , typename T >
void viennacl::linalg::inner_prod_impl (viennacl::vector_expression< LHS, RHS, OP > const &vec1, vector_base< T > const &vec2, scalar< T > &result)
 
template<typename T , typename LHS , typename RHS , typename OP >
void viennacl::linalg::inner_prod_impl (vector_base< T > const &vec1, viennacl::vector_expression< LHS, RHS, OP > const &vec2, scalar< T > &result)
 
template<typename LHS1 , typename RHS1 , typename OP1 , typename LHS2 , typename RHS2 , typename OP2 , typename T >
void viennacl::linalg::inner_prod_impl (viennacl::vector_expression< LHS1, RHS1, OP1 > const &vec1, viennacl::vector_expression< LHS2, RHS2, OP2 > const &vec2, scalar< T > &result)
 
template<typename T >
void viennacl::linalg::inner_prod_cpu (vector_base< T > const &vec1, vector_base< T > const &vec2, T &result)
 Computes the inner product of two vectors with the final reduction step on the CPU - dispatcher interface. More...
 
template<typename LHS , typename RHS , typename OP , typename T >
void viennacl::linalg::inner_prod_cpu (viennacl::vector_expression< LHS, RHS, OP > const &vec1, vector_base< T > const &vec2, T &result)
 
template<typename T , typename LHS , typename RHS , typename OP >
void viennacl::linalg::inner_prod_cpu (vector_base< T > const &vec1, viennacl::vector_expression< LHS, RHS, OP > const &vec2, T &result)
 
template<typename LHS1 , typename RHS1 , typename OP1 , typename LHS2 , typename RHS2 , typename OP2 , typename S3 >
void viennacl::linalg::inner_prod_cpu (viennacl::vector_expression< LHS1, RHS1, OP1 > const &vec1, viennacl::vector_expression< LHS2, RHS2, OP2 > const &vec2, S3 &result)
 
template<typename T >
void viennacl::linalg::inner_prod_impl (vector_base< T > const &x, vector_tuple< T > const &y_tuple, vector_base< T > &result)
 Computes the inner products <x, y1>, <x, y2>, ..., <x, y_N> and writes the result to a (sub-)vector. More...
 
template<typename T >
void viennacl::linalg::norm_1_impl (vector_base< T > const &vec, scalar< T > &result)
 Computes the l^1-norm of a vector - dispatcher interface. More...
 
template<typename LHS , typename RHS , typename OP , typename S2 >
void viennacl::linalg::norm_1_impl (viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
 Computes the l^1-norm of a vector - interface for a vector expression. Creates a temporary. More...
 
template<typename T >
void viennacl::linalg::norm_1_cpu (vector_base< T > const &vec, T &result)
 Computes the l^1-norm of a vector with final reduction on the CPU. More...
 
template<typename LHS , typename RHS , typename OP , typename S2 >
void viennacl::linalg::norm_1_cpu (viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
 Computes the l^1-norm of a vector with final reduction on the CPU - interface for a vector expression. Creates a temporary. More...
 
template<typename T >
void viennacl::linalg::norm_2_impl (vector_base< T > const &vec, scalar< T > &result)
 Computes the l^2-norm of a vector - dispatcher interface. More...
 
template<typename LHS , typename RHS , typename OP , typename T >
void viennacl::linalg::norm_2_impl (viennacl::vector_expression< LHS, RHS, OP > const &vec, scalar< T > &result)
 Computes the l^2-norm of a vector - interface for a vector expression. Creates a temporary. More...
 
template<typename T >
void viennacl::linalg::norm_2_cpu (vector_base< T > const &vec, T &result)
 Computes the l^2-norm of a vector with final reduction on the CPU - dispatcher interface. More...
 
template<typename LHS , typename RHS , typename OP , typename S2 >
void viennacl::linalg::norm_2_cpu (viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
 Computes the l^2-norm of a vector with final reduction on the CPU - interface for a vector expression. Creates a temporary. More...
 
template<typename T >
void viennacl::linalg::norm_inf_impl (vector_base< T > const &vec, scalar< T > &result)
 Computes the supremum-norm of a vector. More...
 
template<typename LHS , typename RHS , typename OP , typename T >
void viennacl::linalg::norm_inf_impl (viennacl::vector_expression< LHS, RHS, OP > const &vec, scalar< T > &result)
 Computes the supremum norm of a vector - interface for a vector expression. Creates a temporary. More...
 
template<typename T >
void viennacl::linalg::norm_inf_cpu (vector_base< T > const &vec, T &result)
 Computes the supremum-norm of a vector with final reduction on the CPU. More...
 
template<typename LHS , typename RHS , typename OP , typename S2 >
void viennacl::linalg::norm_inf_cpu (viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
 Computes the supremum norm of a vector with final reduction on the CPU - interface for a vector expression. Creates a temporary. More...
 
template<typename T >
vcl_size_t viennacl::linalg::index_norm_inf (vector_base< T > const &vec)
 Computes the index of the first entry that is equal to the supremum-norm in modulus. More...
 
template<typename LHS , typename RHS , typename OP >
vcl_size_t viennacl::linalg::index_norm_inf (viennacl::vector_expression< LHS, RHS, OP > const &vec)
 Computes the supremum norm of a vector with final reduction on the CPU - interface for a vector expression. Creates a temporary. More...
 
template<typename NumericT >
void viennacl::linalg::max_impl (vector_base< NumericT > const &vec, viennacl::scalar< NumericT > &result)
 Computes the maximum of a vector with final reduction on the CPU. More...
 
template<typename LHS , typename RHS , typename OP , typename NumericT >
void viennacl::linalg::max_impl (viennacl::vector_expression< LHS, RHS, OP > const &vec, viennacl::scalar< NumericT > &result)
 Computes the supremum norm of a vector with final reduction on the CPU - interface for a vector expression. Creates a temporary. More...
 
template<typename T >
void viennacl::linalg::max_cpu (vector_base< T > const &vec, T &result)
 Computes the maximum of a vector with final reduction on the CPU. More...
 
template<typename LHS , typename RHS , typename OP , typename S2 >
void viennacl::linalg::max_cpu (viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
 Computes the supremum norm of a vector with final reduction on the CPU - interface for a vector expression. Creates a temporary. More...
 
template<typename NumericT >
void viennacl::linalg::min_impl (vector_base< NumericT > const &vec, viennacl::scalar< NumericT > &result)
 Computes the minimum of a vector with final reduction on the CPU. More...
 
template<typename LHS , typename RHS , typename OP , typename NumericT >
void viennacl::linalg::min_impl (viennacl::vector_expression< LHS, RHS, OP > const &vec, viennacl::scalar< NumericT > &result)
 Computes the supremum norm of a vector with final reduction on the CPU - interface for a vector expression. Creates a temporary. More...
 
template<typename T >
void viennacl::linalg::min_cpu (vector_base< T > const &vec, T &result)
 Computes the minimum of a vector with final reduction on the CPU. More...
 
template<typename LHS , typename RHS , typename OP , typename S2 >
void viennacl::linalg::min_cpu (viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
 Computes the supremum norm of a vector with final reduction on the CPU - interface for a vector expression. Creates a temporary. More...
 
template<typename NumericT >
void viennacl::linalg::sum_impl (vector_base< NumericT > const &vec, viennacl::scalar< NumericT > &result)
 Computes the sum of a vector with final reduction on the device (GPU, etc.) More...
 
template<typename LHS , typename RHS , typename OP , typename NumericT >
void viennacl::linalg::sum_impl (viennacl::vector_expression< LHS, RHS, OP > const &vec, viennacl::scalar< NumericT > &result)
 Computes the sum of a vector with final reduction on the CPU - interface for a vector expression. Creates a temporary. More...
 
template<typename T >
void viennacl::linalg::sum_cpu (vector_base< T > const &vec, T &result)
 Computes the sum of a vector with final reduction on the CPU. More...
 
template<typename LHS , typename RHS , typename OP , typename S2 >
void viennacl::linalg::sum_cpu (viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
 Computes the sum of a vector with final reduction on the CPU - interface for a vector expression. Creates a temporary. More...
 
template<typename T >
void viennacl::linalg::plane_rotation (vector_base< T > &vec1, vector_base< T > &vec2, T alpha, T beta)
 Computes a plane rotation of two vectors. More...
 
template<typename NumericT >
void viennacl::linalg::inclusive_scan (vector_base< NumericT > &vec1, vector_base< NumericT > &vec2)
 This function implements an inclusive scan. More...
 
template<typename NumericT >
void viennacl::linalg::inclusive_scan (vector_base< NumericT > &vec)
 Implements an in-place inclusive scan of a vector. More...
 
template<typename NumericT >
void viennacl::linalg::exclusive_scan (vector_base< NumericT > &vec1, vector_base< NumericT > &vec2)
 This function implements an exclusive scan. More...
 
template<typename NumericT >
void viennacl::linalg::exclusive_scan (vector_base< NumericT > &vec)
 Inplace exclusive scan of a vector. More...
 
template<typename T , typename LHS , typename RHS , typename OP >
vector_base< T > & viennacl::operator+= (vector_base< T > &v1, const vector_expression< const LHS, const RHS, OP > &proxy)
 
template<typename T , typename LHS , typename RHS , typename OP >
vector_base< T > & viennacl::operator-= (vector_base< T > &v1, const vector_expression< const LHS, const RHS, OP > &proxy)
 

Detailed Description

Implementations of vector operations.

Definition in file vector_operations.hpp.