|
ViennaCL - The Vienna Computing Library
1.4.2
|
A vector class representing a linear memory sequence on the GPU. Inspired by boost::numeric::ublas::vector. More...
#include <vector.hpp>
Public Types | |
| typedef base_type::size_type | size_type |
Public Member Functions | |
| vector () | |
| Default constructor in order to be compatible with various containers. | |
| vector (size_type vec_size) | |
| An explicit constructor for the vector, allocating the given amount of memory (plus a padding specified by 'ALIGNMENT') | |
| template<typename LHS , typename RHS , typename OP > | |
| vector (vector_expression< const LHS, const RHS, OP > const &proxy) | |
| vector (const base_type &v) | |
| vector (const self_type &v) | |
| vector (unit_vector< SCALARTYPE > const &v) | |
| Creates the vector from the supplied unit vector. | |
| vector (zero_vector< SCALARTYPE > const &v) | |
| Creates the vector from the supplied zero vector. | |
| vector (scalar_vector< SCALARTYPE > const &v) | |
| Creates the vector from the supplied scalar vector. | |
| template<typename SparseMatrixType > | |
| viennacl::enable_if < viennacl::is_any_sparse_matrix < SparseMatrixType >::value, self_type & >::type | operator= (const viennacl::vector_expression< const SparseMatrixType, const base_type, viennacl::op_prod > &proxy) |
| Implementation of the operation v1 = A * v2, where A is a sparse matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator= (const vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 = A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator+= (const vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 += A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator-= (const vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 -= A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type | operator+ (const vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 + A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type | operator- (const vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 - A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator= (const vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 = A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator+= (const vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 += A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator-= (const vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 -= A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type | operator+ (const vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 + A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type | operator- (const vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 - A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator= (const vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 = A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator+= (const vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 += A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator-= (const vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 -= A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type | operator+ (const vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 + A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type | operator- (const vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 - A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator= (const vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 = A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator+= (const vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 += A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type & | operator-= (const vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 -= A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type | operator+ (const vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 + A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| self_type | operator- (const vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > &proxy) |
| Operator overload for v1 - A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix. | |
| vector_expression< const vector_base< SCALARTYPE > , const SCALARTYPE, op_prod > | operator- () const |
| Sign flip for the vector. Emulated to be equivalent to -1.0 * vector. | |
| void | resize (size_type new_size, bool preserve=true) |
| Resizes the allocated memory for the vector. Pads the memory to be a multiple of 'ALIGNMENT'. | |
| self_type & | fast_swap (self_type &other) |
| Swaps the handles of two vectors by swapping the OpenCL handles only, no data copy. | |
| void | switch_memory_domain (viennacl::memory_types new_domain) |
| template<unsigned int MAT_ALIGNMENT> | |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & | operator= (const viennacl::vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const viennacl::vector_base< SCALARTYPE >, viennacl::op_prod > &proxy) |
| Implementation of the operation v1 = A * v2, where A is a matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & | operator= (const viennacl::vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const viennacl::vector_base< SCALARTYPE >, viennacl::op_prod > &proxy) |
| Implementation of the operation v1 = A * v2, where A is a matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & | operator= (const viennacl::vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const viennacl::vector_base< SCALARTYPE >, viennacl::op_prod > &proxy) |
| Implementation of the operation v1 = A * v2, where A is a matrix. | |
| template<unsigned int MAT_ALIGNMENT> | |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & | operator= (const viennacl::vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const viennacl::vector_base< SCALARTYPE >, viennacl::op_prod > &proxy) |
| Implementation of the operation v1 = A * v2, where A is a matrix. | |
A vector class representing a linear memory sequence on the GPU. Inspired by boost::numeric::ublas::vector.
This is the basic vector type of ViennaCL. It is similar to std::vector and boost::numeric::ublas::vector and supports various linear algebra operations. By default, the internal length of the vector is padded to a multiple of 'ALIGNMENT' in order to speed up several GPU viennacl::ocl::kernels.
| SCALARTYPE | The floating point type, either 'float' or 'double' |
| ALIGNMENT | The internal memory size is given by (size()/ALIGNMENT + 1) * ALIGNMENT. ALIGNMENT must be a power of two. Best values or usually 4, 8 or 16, higher values are usually a waste of memory. |
| typedef base_type::size_type size_type |
Reimplemented from vector_base< SCALARTYPE >.
| vector | ( | ) | [inline, explicit] |
Default constructor in order to be compatible with various containers.
An explicit constructor for the vector, allocating the given amount of memory (plus a padding specified by 'ALIGNMENT')
| vec_size | The length (i.e. size) of the vector. |
| vector | ( | vector_expression< const LHS, const RHS, OP > const & | proxy | ) | [inline] |
| vector | ( | unit_vector< SCALARTYPE > const & | v | ) | [inline] |
Creates the vector from the supplied unit vector.
| vector | ( | zero_vector< SCALARTYPE > const & | v | ) | [inline] |
Creates the vector from the supplied zero vector.
| vector | ( | scalar_vector< SCALARTYPE > const & | v | ) | [inline] |
Creates the vector from the supplied scalar vector.
Swaps the handles of two vectors by swapping the OpenCL handles only, no data copy.
| viennacl::vector< SCALARTYPE, ALIGNMENT > operator+ | ( | const vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 + A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation 'result = v1 + A * v2', where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > operator+ | ( | const vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 + A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation 'result = v1 + A * v2', where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > operator+ | ( | const vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 + A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation 'result = v1 + A * v2', where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > operator+ | ( | const vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 + A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation 'result = v1 + A * v2', where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & operator+= | ( | const vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 += A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation v1 += A * v2, where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & operator+= | ( | const vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 += A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation v1 += A * v2, where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & operator+= | ( | const vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 += A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation v1 += A * v2, where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & operator+= | ( | const vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 += A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation v1 += A * v2, where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > operator- | ( | const vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 - A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation 'result = v1 - A * v2', where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > operator- | ( | const vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 - A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation 'result = v1 - A * v2', where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > operator- | ( | const vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 - A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation 'result = v1 - A * v2', where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > operator- | ( | const vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 - A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation 'result = v1 - A * v2', where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| vector_expression<const vector_base<SCALARTYPE>, const SCALARTYPE, op_prod> operator- | ( | ) | const [inline] |
Sign flip for the vector. Emulated to be equivalent to -1.0 * vector.
Reimplemented from vector_base< SCALARTYPE >.
| viennacl::vector< SCALARTYPE, ALIGNMENT > & operator-= | ( | const vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 -= A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation v1 -= A * v2, where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & operator-= | ( | const vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 -= A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation v1 -= A * v2, where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & operator-= | ( | const vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 -= A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation v1 -= A * v2, where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector< SCALARTYPE, ALIGNMENT > & operator-= | ( | const vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 -= A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
Implementation of the operation v1 -= A * v2, where A is a matrix.
| proxy | An expression template proxy class |
| proxy | An expression template proxy class. |
| viennacl::vector<SCALARTYPE, ALIGNMENT>& operator= | ( | const viennacl::vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const viennacl::vector_base< SCALARTYPE >, viennacl::op_prod > & | proxy | ) |
Implementation of the operation v1 = A * v2, where A is a matrix.
| proxy | An expression template proxy class. |
| viennacl::vector<SCALARTYPE, ALIGNMENT>& operator= | ( | const viennacl::vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const viennacl::vector_base< SCALARTYPE >, viennacl::op_prod > & | proxy | ) |
Implementation of the operation v1 = A * v2, where A is a matrix.
| proxy | An expression template proxy class. |
| viennacl::vector<SCALARTYPE, ALIGNMENT>& operator= | ( | const viennacl::vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const viennacl::vector_base< SCALARTYPE >, viennacl::op_prod > & | proxy | ) |
Implementation of the operation v1 = A * v2, where A is a matrix.
| proxy | An expression template proxy class. |
| viennacl::vector<SCALARTYPE, ALIGNMENT>& operator= | ( | const viennacl::vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const viennacl::vector_base< SCALARTYPE >, viennacl::op_prod > & | proxy | ) |
Implementation of the operation v1 = A * v2, where A is a matrix.
| proxy | An expression template proxy class. |
| viennacl::enable_if< viennacl::is_any_sparse_matrix< SparseMatrixType >::value, viennacl::vector< SCALARTYPE, ALIGNMENT > & >::type operator= | ( | const viennacl::vector_expression< const SparseMatrixType, const base_type, viennacl::op_prod > & | proxy | ) |
Implementation of the operation v1 = A * v2, where A is a sparse matrix.
| proxy | An expression template proxy class. |
| self_type& operator= | ( | const vector_expression< const circulant_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 = A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
| proxy | An expression template proxy class |
| self_type& operator= | ( | const vector_expression< const hankel_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 = A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
| proxy | An expression template proxy class |
| self_type& operator= | ( | const vector_expression< const toeplitz_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 = A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
| proxy | An expression template proxy class |
| self_type& operator= | ( | const vector_expression< const vandermonde_matrix< SCALARTYPE, MAT_ALIGNMENT >, const base_type, op_prod > & | proxy | ) |
Operator overload for v1 = A * v2, where v1, v2 are vectors and A is a sparse matrix of type circulant_matrix.
| proxy | An expression template proxy class |
Resizes the allocated memory for the vector. Pads the memory to be a multiple of 'ALIGNMENT'.
| new_size | The new size of the vector |
| preserve | If true, old entries of the vector are preserved, otherwise eventually discarded. |
Reimplemented from vector_base< SCALARTYPE >.
| void switch_memory_domain | ( | viennacl::memory_types | new_domain | ) | [inline] |
Reimplemented from vector_base< SCALARTYPE >.
1.7.6.1