Namespaces | Data Structures | Typedefs | Functions

viennacl Namespace Reference

Namespaces

namespace  detail
namespace  io
namespace  linalg
namespace  ocl
namespace  result_of
namespace  tools
namespace  traits

Data Structures

class  circulant_matrix
 A Circulant matrix class. More...
class  compressed_matrix
 A sparse square matrix in compressed sparse rows format. More...
class  coordinate_matrix
 A sparse square matrix, where entries are stored as triplets (i,j, val), where i and j are the row and column indices and val denotes the entry. More...
class  hankel_matrix
 A Hankel matrix class. More...
struct  row_major
 A tag for row-major storage of a dense matrix. More...
struct  column_major
class  matrix_expression
struct  row_iteration
 A tag indicating iteration along increasing row index of a matrix. More...
struct  col_iteration
 A tag indicating iteration along increasing columns index of a matrix. More...
class  matrix_iterator
class  matrix
 A dense matrix class. More...
class  matrix_range
struct  enable_if
 Simple enable-if variant that uses the SFINAE pattern. More...
struct  enable_if< false, T >
struct  is_cpu_scalar
struct  is_cpu_scalar< float >
struct  is_cpu_scalar< double >
struct  is_scalar
struct  is_scalar< viennacl::scalar< T > >
struct  is_vector
struct  is_vector< viennacl::vector< ScalarType, ALIGNMENT > >
struct  is_vector< viennacl::vector_range< T > >
struct  is_matrix
struct  is_matrix< viennacl::matrix< ScalarType, F, ALIGNMENT > >
struct  is_matrix< viennacl::matrix_range< T > >
struct  tag_none
struct  tag_mtl4
struct  tag_eigen
struct  tag_ublas
struct  tag_stl
struct  tag_viennacl
struct  is_mtl4
 Meta function which checks whether a tag is tag_mtl4. More...
struct  is_mtl4< viennacl::tag_mtl4 >
struct  is_eigen
 Meta function which checks whether a tag is tag_eigen. More...
struct  is_eigen< viennacl::tag_eigen >
struct  is_ublas
 Meta function which checks whether a tag is tag_ublas. More...
struct  is_ublas< viennacl::tag_ublas >
struct  is_stl
 Meta function which checks whether a tag is tag_ublas. More...
struct  is_stl< viennacl::tag_stl >
struct  is_viennacl
 Meta function which checks whether a tag is tag_viennacl. More...
struct  is_viennacl< viennacl::tag_viennacl >
struct  cuthill_mckee_tag
class  advanced_cuthill_mckee_tag
 Tag for the advanced Cuthill-McKee algorithm. More...
struct  gibbs_poole_stockmeyer_tag
class  basic_range
 A range class that refers to an interval [start, stop), where 'start' is included, and 'stop' is excluded. More...
class  scalar_expression
 A proxy for scalar expressions (e.g. from inner vector products). More...
class  scalar
 This class represents a single scalar value on the GPU and behaves mostly like a built-in scalar type like float or double. More...
class  toeplitz_matrix
 A Toeplitz matrix class. More...
class  entry_proxy
 A proxy class for a single element of a vector or matrix. This proxy should not be noticed by end-users of the library. More...
class  vandermonde_matrix
 A Vandermonde matrix class. More...
class  vector_expression
 An expression template class that represents a binary operation that yields a vector. More...
class  const_vector_iterator
 A STL-type const-iterator for vector elements. Elements can be accessed, but cannot be manipulated. VERY SLOW!! More...
class  vector_iterator
 A STL-type iterator for vector elements. Elements can be accessed and manipulated. VERY SLOW!! More...
class  vector
 A vector class representing a linear memory sequence on the GPU. Inspired by boost::numeric::ublas::vector. More...
class  vector_range

Typedefs

typedef std::size_t vcl_size_t
typedef std::ptrdiff_t vcl_ptrdiff_t
typedef basic_range range

Functions

template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (std::vector< SCALARTYPE > &cpu_vec, circulant_matrix< SCALARTYPE, ALIGNMENT > &gpu_mat)
 Copies a circulant matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU).
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (circulant_matrix< SCALARTYPE, ALIGNMENT > &gpu_mat, std::vector< SCALARTYPE > &cpu_vec)
 Copies a circulant matrix from the OpenCL device (either GPU or multi-core CPU) to the std::vector.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename MATRIXTYPE >
void copy (circulant_matrix< SCALARTYPE, ALIGNMENT > &circ_src, MATRIXTYPE &com_dst)
 Copies a circulant matrix from the OpenCL device (either GPU or multi-core CPU) to the matrix-like object.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename MATRIXTYPE >
void copy (MATRIXTYPE &com_src, circulant_matrix< SCALARTYPE, ALIGNMENT > &circ_dst)
 Copies a the matrix-like object to the circulant matrix from the OpenCL device (either GPU or multi-core CPU).
template<class SCALARTYPE , unsigned int ALIGNMENT>
std::ostream & operator<< (std::ostream &s, circulant_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix)
 Prints the matrix. Output is compatible to boost::numeric::ublas.
template<typename CPU_MATRIX , typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (const CPU_MATRIX &cpu_matrix, compressed_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix)
 Copies a sparse matrix from the host to the OpenCL device (either GPU or multi-core CPU).
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (const std::vector< std::map< unsigned int, SCALARTYPE > > &cpu_matrix, compressed_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix)
 Copies a sparse matrix in the std::vector< std::map < > > format to an OpenCL device.
template<typename CPU_MATRIX , typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (const compressed_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix, CPU_MATRIX &cpu_matrix)
 Copies a sparse matrix from the OpenCL device (either GPU or multi-core CPU) to the host.
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (const compressed_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix, std::vector< std::map< unsigned int, SCALARTYPE > > &cpu_matrix)
 Copies a sparse matrix from an OpenCL device to the host. The host type is the std::vector< std::map < > > format .
template<typename CPU_MATRIX , typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (const CPU_MATRIX &cpu_matrix, coordinate_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix)
 Copies a sparse matrix from the host to the OpenCL device (either GPU or multi-core CPU).
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (const std::vector< std::map< unsigned int, SCALARTYPE > > &cpu_matrix, coordinate_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix)
 Copies a sparse matrix in the std::vector< std::map < > > format to an OpenCL device.
template<typename CPU_MATRIX , typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (const coordinate_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix, CPU_MATRIX &cpu_matrix)
 Copies a sparse matrix from the OpenCL device (either GPU or multi-core CPU) to the host.
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (const coordinate_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix, std::vector< std::map< unsigned int, SCALARTYPE > > &cpu_matrix)
 Copies a sparse matrix from an OpenCL device to the host. The host type is the std::vector< std::map < > > format .
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename CPU_ITERATOR >
void copy (CPU_ITERATOR const &cpu_begin, CPU_ITERATOR const &cpu_end, vector_iterator< SCALARTYPE, ALIGNMENT > gpu_begin)
 STL-like transfer for the entries of a GPU vector to the CPU. The cpu type does not need to lie in a linear piece of memory.
template<typename SCALARTYPE , unsigned int ALIGNMENT_SRC, unsigned int ALIGNMENT_DEST>
void copy (const_vector_iterator< SCALARTYPE, ALIGNMENT_SRC > const &gpu_src_begin, const_vector_iterator< SCALARTYPE, ALIGNMENT_SRC > const &gpu_src_end, vector_iterator< SCALARTYPE, ALIGNMENT_DEST > gpu_dest_begin)
 Copy (parts of a) GPU vector to another GPU vector.
template<typename SCALARTYPE , unsigned int ALIGNMENT_SRC, unsigned int ALIGNMENT_DEST>
void copy (const_vector_iterator< SCALARTYPE, ALIGNMENT_SRC > const &gpu_src_begin, const_vector_iterator< SCALARTYPE, ALIGNMENT_SRC > const &gpu_src_end, const_vector_iterator< SCALARTYPE, ALIGNMENT_DEST > gpu_dest_begin)
 Copy (parts of a) GPU vector to another GPU vector.
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (std::vector< SCALARTYPE > const &cpu_vec, hankel_matrix< SCALARTYPE, ALIGNMENT > &gpu_mat)
 Copies a Hankel matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU).
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (hankel_matrix< SCALARTYPE, ALIGNMENT > const &gpu_mat, std::vector< SCALARTYPE > &cpu_vec)
 Copies a Hankel matrix from the OpenCL device (either GPU or multi-core CPU) to the std::vector.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename MATRIXTYPE >
void copy (hankel_matrix< SCALARTYPE, ALIGNMENT > const &han_src, MATRIXTYPE &com_dst)
 Copies a Hankel matrix from the OpenCL device (either GPU or multi-core CPU) to the matrix-like object.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename MATRIXTYPE >
void copy (MATRIXTYPE const &com_src, hankel_matrix< SCALARTYPE, ALIGNMENT > &han_dst)
 Copies a the matrix-like object to the Hankel matrix from the OpenCL device (either GPU or multi-core CPU).
template<class SCALARTYPE , unsigned int ALIGNMENT>
std::ostream & operator<< (std::ostream &s, hankel_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix)
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT>
std::ostream & operator<< (std::ostream &s, const matrix< SCALARTYPE, F, ALIGNMENT > &gpu_matrix)
 Prints the matrix. Output is compatible to boost::numeric::ublas.
template<typename LHS , typename RHS , typename OP >
std::ostream & operator<< (std::ostream &s, const matrix_expression< LHS, RHS, OP > &expr)
 Prints the matrix. Output is compatible to boost::numeric::ublas.
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT>
matrix_expression< const
matrix< SCALARTYPE, F,
ALIGNMENT >, const matrix
< SCALARTYPE, F, ALIGNMENT >
, op_trans > 
trans (const matrix< SCALARTYPE, F, ALIGNMENT > &mat)
 Returns an expression template class representing a transposed matrix.
template<typename CPU_MATRIX , typename SCALARTYPE , typename F , unsigned int ALIGNMENT>
void copy (const CPU_MATRIX &cpu_matrix, matrix< SCALARTYPE, F, ALIGNMENT > &gpu_matrix)
 Copies a dense matrix from the host (CPU) to the OpenCL device (GPU or multi-core CPU).
template<typename SCALARTYPE , typename A1 , typename A2 , typename F , unsigned int ALIGNMENT>
void copy (const std::vector< std::vector< SCALARTYPE, A1 >, A2 > &cpu_matrix, matrix< SCALARTYPE, F, ALIGNMENT > &gpu_matrix)
 Copies a dense STL-type matrix from the host (CPU) to the OpenCL device (GPU or multi-core CPU).
template<typename SCALARTYPE , typename F , unsigned int ALIGNMENT>
void fast_copy (SCALARTYPE *cpu_matrix_begin, SCALARTYPE *cpu_matrix_end, matrix< SCALARTYPE, F, ALIGNMENT > &gpu_matrix)
 Copies a dense matrix from the host (CPU) to the OpenCL device (GPU or multi-core CPU) without temporary. Matrix-Layout on CPU must be equal to the matrix-layout on the GPU.
template<typename CPU_MATRIX , typename SCALARTYPE , typename F , unsigned int ALIGNMENT>
void copy (const matrix< SCALARTYPE, F, ALIGNMENT > &gpu_matrix, CPU_MATRIX &cpu_matrix)
 Copies a dense matrix from the OpenCL device (GPU or multi-core CPU) to the host (CPU).
template<typename SCALARTYPE , typename A1 , typename A2 , typename F , unsigned int ALIGNMENT>
void copy (const matrix< SCALARTYPE, F, ALIGNMENT > &gpu_matrix, std::vector< std::vector< SCALARTYPE, A1 >, A2 > &cpu_matrix)
 Copies a dense matrix from the OpenCL device (GPU or multi-core CPU) to the host (CPU).
template<typename SCALARTYPE , typename F , unsigned int ALIGNMENT>
void fast_copy (const matrix< SCALARTYPE, F, ALIGNMENT > &gpu_matrix, SCALARTYPE *cpu_matrix_begin)
 Copies a dense matrix from the OpenCL device (GPU or multi-core CPU) to the host (CPU).
template<typename CPU_SCALAR , typename SCALARTYPE , unsigned int VECTOR_ALIGNMENT>
viennacl::matrix_expression
< const
viennacl::matrix_expression
< const viennacl::vector
< SCALARTYPE, VECTOR_ALIGNMENT >
, const viennacl::vector
< SCALARTYPE, VECTOR_ALIGNMENT >
, op_prod >, const SCALARTYPE,
op_prod > 
operator* (const viennacl::matrix_expression< const viennacl::vector< SCALARTYPE, VECTOR_ALIGNMENT >, const viennacl::vector< SCALARTYPE, VECTOR_ALIGNMENT >, op_prod > &proxy, CPU_SCALAR const &val)
template<typename CPU_SCALAR , typename SCALARTYPE , unsigned int VA1, unsigned int VA2>
viennacl::matrix_expression
< const
viennacl::matrix_expression
< const viennacl::vector
< SCALARTYPE, VA1 >, const
viennacl::vector< SCALARTYPE,
VA2 >, op_prod >, const
SCALARTYPE, op_prod > 
operator* (CPU_SCALAR const &val, viennacl::matrix_expression< const viennacl::vector< SCALARTYPE, VA1 >, const viennacl::vector< SCALARTYPE, VA2 >, op_prod > const &proxy)
template<typename MatrixType >
matrix_expression< const
matrix_range< MatrixType >
, const matrix_range
< MatrixType >, op_trans > 
trans (const matrix_range< MatrixType > &mat)
 Returns an expression template class representing a transposed matrix.
template<typename CPU_MATRIX , typename SCALARTYPE >
void copy (const CPU_MATRIX &cpu_matrix, matrix_range< matrix< SCALARTYPE, row_major, 1 > > &gpu_matrix_range)
template<typename CPU_MATRIX , typename SCALARTYPE >
void copy (const CPU_MATRIX &cpu_matrix, matrix_range< matrix< SCALARTYPE, column_major, 1 > > &gpu_matrix_range)
template<typename CPU_MATRIX , typename SCALARTYPE >
void copy (matrix_range< matrix< SCALARTYPE, row_major, 1 > > const &gpu_matrix_range, CPU_MATRIX &cpu_matrix)
template<typename CPU_MATRIX , typename SCALARTYPE >
void copy (matrix_range< matrix< SCALARTYPE, column_major, 1 > > const &gpu_matrix_range, CPU_MATRIX &cpu_matrix)
template<typename MatrixType >
std::vector< int > reorder (MatrixType const &matrix, cuthill_mckee_tag)
 Function for the calculation of a node number permutation to reduce the bandwidth of an incidence matrix by the Cuthill-McKee algorithm.
template<typename MatrixType >
std::vector< int > reorder (MatrixType const &matrix, advanced_cuthill_mckee_tag const &tag)
 Function for the calculation of a node number permutation to reduce the bandwidth of an incidence matrix by the advanced Cuthill-McKee algorithm.
template<typename MatrixType >
std::vector< int > reorder (MatrixType const &matrix, gibbs_poole_stockmeyer_tag)
 Function for the calculation of a node numbering permutation vector to reduce the bandwidth of a incidence matrix by the Gibbs-Poole-Stockmeyer algorithm.
template<class SCALARTYPE >
std::ostream & operator<< (std::ostream &s, const scalar< SCALARTYPE > &val)
 Allows to directly print the value of a scalar to an output stream.
template<class SCALARTYPE >
std::istream & operator>> (std::istream &s, const scalar< SCALARTYPE > &val)
 Allows to directly read a value of a scalar from an input stream.
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (std::vector< SCALARTYPE > const &cpu_vec, toeplitz_matrix< SCALARTYPE, ALIGNMENT > &gpu_mat)
 Copies a Toeplitz matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU).
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (toeplitz_matrix< SCALARTYPE, ALIGNMENT > const &gpu_mat, std::vector< SCALARTYPE > &cpu_vec)
 Copies a Toeplitz matrix from the OpenCL device (either GPU or multi-core CPU) to the std::vector.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename MATRIXTYPE >
void copy (toeplitz_matrix< SCALARTYPE, ALIGNMENT > const &tep_src, MATRIXTYPE &com_dst)
 Copies a Toeplitz matrix from the OpenCL device (either GPU or multi-core CPU) to the matrix-like object.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename MATRIXTYPE >
void copy (MATRIXTYPE const &com_src, toeplitz_matrix< SCALARTYPE, ALIGNMENT > &tep_dst)
 Copies a the matrix-like object to the Toeplitz matrix from the OpenCL device (either GPU or multi-core CPU).
template<class SCALARTYPE , unsigned int ALIGNMENT>
std::ostream & operator<< (std::ostream &s, toeplitz_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix)
 Prints the matrix. Output is compatible to boost::numeric::ublas.
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (std::vector< SCALARTYPE > &cpu_vec, vandermonde_matrix< SCALARTYPE, ALIGNMENT > &gpu_mat)
 Copies a Vandermonde matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU).
template<typename SCALARTYPE , unsigned int ALIGNMENT>
void copy (vandermonde_matrix< SCALARTYPE, ALIGNMENT > &gpu_mat, std::vector< SCALARTYPE > &cpu_vec)
 Copies a Vandermonde matrix from the OpenCL device (either GPU or multi-core CPU) to the std::vector.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename MATRIXTYPE >
void copy (vandermonde_matrix< SCALARTYPE, ALIGNMENT > &vander_src, MATRIXTYPE &com_dst)
 Copies a Vandermonde matrix from the OpenCL device (either GPU or multi-core CPU) to the matrix-like object.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename MATRIXTYPE >
void copy (MATRIXTYPE &com_src, vandermonde_matrix< SCALARTYPE, ALIGNMENT > &vander_dst)
 Copies a the matrix-like object to the Vandermonde matrix from the OpenCL device (either GPU or multi-core CPU).
template<class SCALARTYPE , unsigned int ALIGNMENT>
std::ostream & operator<< (std::ostream &s, vandermonde_matrix< SCALARTYPE, ALIGNMENT > &gpu_matrix)
 Prints the matrix. Output is compatible to boost::numeric::ublas.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename CPU_ITERATOR >
void copy (const const_vector_iterator< SCALARTYPE, ALIGNMENT > &gpu_begin, const const_vector_iterator< SCALARTYPE, ALIGNMENT > &gpu_end, CPU_ITERATOR cpu_begin)
 STL-like transfer for the entries of a GPU vector to the CPU. The cpu type does not need to lie in a linear piece of memory.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename CPU_ITERATOR >
void copy (const vector_iterator< SCALARTYPE, ALIGNMENT > &gpu_begin, const vector_iterator< SCALARTYPE, ALIGNMENT > &gpu_end, CPU_ITERATOR cpu_begin)
 STL-like transfer for the entries of a GPU vector to the CPU. The cpu type does not need to lie in a linear piece of memory.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename CPUVECTOR >
void copy (vector< SCALARTYPE, ALIGNMENT > const &gpu_vec, CPUVECTOR &cpu_vec)
 Transfer from a gpu vector to a cpu vector. Convenience wrapper for viennacl::linalg::copy(gpu_vec.begin(), gpu_vec.end(), cpu_vec.begin());.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename CPU_ITERATOR >
void fast_copy (const const_vector_iterator< SCALARTYPE, ALIGNMENT > &gpu_begin, const const_vector_iterator< SCALARTYPE, ALIGNMENT > &gpu_end, CPU_ITERATOR cpu_begin)
 STL-like transfer of a GPU vector to the CPU. The cpu type is assumed to reside in a linear piece of memory, such as e.g. for std::vector.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename CPUVECTOR >
void fast_copy (vector< SCALARTYPE, ALIGNMENT > const &gpu_vec, CPUVECTOR &cpu_vec)
 Transfer from a gpu vector to a cpu vector. Convenience wrapper for viennacl::linalg::fast_copy(gpu_vec.begin(), gpu_vec.end(), cpu_vec.begin());.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename CPU_ITERATOR >
void copy (CPU_ITERATOR const &cpu_begin, CPU_ITERATOR const &cpu_end, const_vector_iterator< SCALARTYPE, ALIGNMENT > gpu_begin)
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename CPUVECTOR >
void copy (const CPUVECTOR &cpu_vec, vector< SCALARTYPE, ALIGNMENT > &gpu_vec)
 Transfer from a cpu vector to a gpu vector. Convenience wrapper for viennacl::linalg::copy(cpu_vec.begin(), cpu_vec.end(), gpu_vec.begin());.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename CPU_ITERATOR >
void fast_copy (CPU_ITERATOR const &cpu_begin, CPU_ITERATOR const &cpu_end, vector_iterator< SCALARTYPE, ALIGNMENT > gpu_begin)
 STL-like transfer of a CPU vector to the GPU. The cpu type is assumed to reside in a linear piece of memory, such as e.g. for std::vector.
template<typename SCALARTYPE , unsigned int ALIGNMENT, typename CPUVECTOR >
void fast_copy (const CPUVECTOR &cpu_vec, vector< SCALARTYPE, ALIGNMENT > &gpu_vec)
 Transfer from a cpu vector to a gpu vector. Convenience wrapper for viennacl::linalg::fast_copy(cpu_vec.begin(), cpu_vec.end(), gpu_vec.begin());.
template<typename SCALARTYPE , unsigned int ALIGNMENT_SRC, unsigned int ALIGNMENT_DEST>
void copy (vector< SCALARTYPE, ALIGNMENT_SRC > const &gpu_src_vec, vector< SCALARTYPE, ALIGNMENT_DEST > &gpu_dest_vec)
 Transfer from a ViennaCL vector to another ViennaCL vector. Convenience wrapper for viennacl::linalg::copy(gpu_src_vec.begin(), gpu_src_vec.end(), gpu_dest_vec.begin());.
template<class SCALARTYPE , unsigned int ALIGNMENT>
std::ostream & operator<< (std::ostream &s, vector< SCALARTYPE, ALIGNMENT > const &val)
 Output stream. Output format is ublas compatible.
template<class SCALARTYPE , unsigned int ALIGNMENT>
void swap (viennacl::vector< SCALARTYPE, ALIGNMENT > &vec1, viennacl::vector< SCALARTYPE, ALIGNMENT > &vec2)
 Swaps the contents of two vectors, data is copied.
template<typename SCALARTYPE , unsigned int ALIGNMENT>
vector< SCALARTYPE, ALIGNMENT > & fast_swap (vector< SCALARTYPE, ALIGNMENT > &v1, vector< SCALARTYPE, ALIGNMENT > &v2)
 Swaps the content of two vectors by swapping OpenCL handles only, NO data is copied.
template<typename SCALARTYPE , unsigned int A>
vector_expression< const
vector< SCALARTYPE, A >, const
SCALARTYPE, op_prod > 
operator* (SCALARTYPE const &value, vector< SCALARTYPE, A > const &vec)
 Operator overload for the expression alpha * v1, where alpha is a host scalar (float or double) and v1 is a ViennaCL vector.
template<typename SCALARTYPE , unsigned int A>
vector_expression< const
vector< SCALARTYPE, A >, const
scalar< SCALARTYPE >, op_prod > 
operator* (scalar< SCALARTYPE > const &value, vector< SCALARTYPE, A > const &vec)
 Operator overload for the expression alpha * v1, where alpha is a ViennaCL scalar (float or double) and v1 is a ViennaCL vector.
template<typename LHS1 , typename RHS1 , typename OP1 , typename LHS2 , typename RHS2 , typename OP2 >
vector_expression< LHS1, RHS1,
OP1 >::VectorType 
operator+ (vector_expression< LHS1, RHS1, OP1 > const &proxy1, vector_expression< LHS2, RHS2, OP2 > const &proxy2)
 Operator overload for the addition of two vector expressions.
template<typename LHS1 , typename RHS1 , typename OP1 , typename LHS2 , typename RHS2 , typename OP2 >
vector_expression< LHS1, RHS1,
OP1 >::VectorType 
operator- (vector_expression< LHS1, RHS1, OP1 > const &proxy1, vector_expression< LHS2, RHS2, OP2 > const &proxy2)
 Operator overload for the subtraction of two vector expressions.
template<typename SCALARTYPE , unsigned int A, typename LHS , typename RHS , typename OP >
vector< SCALARTYPE, A > operator+ (vector_expression< LHS, RHS, OP > const &proxy, vector< SCALARTYPE, A > const &vec)
 Operator overload for the addition of a vector expression from the left, e.g. alpha * vec1 + vec2. Here, alpha * vec1 is wrapped into a vector_expression and then added to vec2.
template<typename SCALARTYPE , unsigned int A, typename LHS , typename RHS , typename OP >
vector< SCALARTYPE, A > operator- (vector_expression< LHS, RHS, OP > const &proxy, vector< SCALARTYPE, A > const &vec)
 Operator overload for the subtraction of a vector expression from the left, e.g. alpha * vec1 + vec2. Here, alpha * vec1 is wrapped into a vector_expression and then added to vec2.
template<typename SCALARTYPE , typename LHS , typename RHS , typename OP >
vector< SCALARTYPE > operator* (vector_expression< LHS, RHS, OP > const &proxy, scalar< SCALARTYPE > const &val)
 Operator overload for the multiplication of a vector expression with a scalar from the right, e.g. (beta * vec1) * alpha. Here, beta * vec1 is wrapped into a vector_expression and then multiplied with alpha from the right.
template<typename SCALARTYPE , typename LHS , typename RHS , typename OP >
vector< SCALARTYPE > operator/ (vector_expression< LHS, RHS, OP > const &proxy, scalar< SCALARTYPE > const &val)
 Operator overload for the division of a vector expression by a scalar from the right, e.g. (beta * vec1) / alpha. Here, beta * vec1 is wrapped into a vector_expression and then divided by alpha.
template<typename SCALARTYPE , typename LHS , typename RHS , typename OP >
vector< SCALARTYPE > operator* (scalar< SCALARTYPE > const &val, vector_expression< LHS, RHS, OP > const &proxy)
 Operator overload for the multiplication of a vector expression with a ViennaCL scalar from the left, e.g. alpha * (beta * vec1). Here, beta * vec1 is wrapped into a vector_expression and then multiplied with alpha from the left.
template<typename SCALARTYPE , typename LHS , typename RHS , typename OP >
viennacl::vector< SCALARTYPE > operator* (SCALARTYPE val, viennacl::vector_expression< LHS, RHS, OP > const &proxy)
 Operator overload for the multiplication of a vector expression with a host scalar (float or double) from the left, e.g. alpha * (beta * vec1). Here, beta * vec1 is wrapped into a vector_expression and then multiplied with alpha from the left.
template<typename VectorType >
std::ostream & operator<< (std::ostream &s, vector_range< VectorType > const &proxy)
template<typename VectorType , typename SCALARTYPE >
void copy (const VectorType &cpu_vector, vector_range< vector< SCALARTYPE > > &gpu_vector_range)
template<typename VectorType , typename SCALARTYPE >
void copy (vector_range< vector< SCALARTYPE > > const &gpu_vector_range, VectorType &cpu_vector)

Typedef Documentation

typedef basic_range range
typedef std::ptrdiff_t vcl_ptrdiff_t
typedef std::size_t vcl_size_t

Function Documentation

void viennacl::copy ( std::vector< SCALARTYPE > &  cpu_vec,
circulant_matrix< SCALARTYPE, ALIGNMENT > &  gpu_mat 
)

Copies a circulant matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU).

Parameters:
cpu_vec A std::vector on the host.
gpu_mat A circulant_matrix from ViennaCL
void viennacl::copy ( circulant_matrix< SCALARTYPE, ALIGNMENT > &  gpu_mat,
std::vector< SCALARTYPE > &  cpu_vec 
)

Copies a circulant matrix from the OpenCL device (either GPU or multi-core CPU) to the std::vector.

Parameters:
gpu_mat A circulant_matrix from ViennaCL
cpu_vec A std::vector on the host.
void viennacl::copy ( MATRIXTYPE &  com_src,
circulant_matrix< SCALARTYPE, ALIGNMENT > &  circ_dst 
)

Copies a the matrix-like object to the circulant matrix from the OpenCL device (either GPU or multi-core CPU).

Parameters:
com_src A std::vector on the host
circ_dst A circulant_matrix from ViennaCL
void viennacl::copy ( const compressed_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix,
CPU_MATRIX &  cpu_matrix 
)

Copies a sparse matrix from the OpenCL device (either GPU or multi-core CPU) to the host.

There are two type requirements on the CPU_MATRIX type (fulfilled by e.g. boost::numeric::ublas):

  • resize(rows, cols) A resize function to bring the matrix into the correct size
  • operator(i,j) Write new entries via the parenthesis operator
Parameters:
gpu_matrix A compressed_matrix from ViennaCL
cpu_matrix A sparse matrix on the host.
void copy ( const_vector_iterator< SCALARTYPE, ALIGNMENT_SRC > const &  gpu_src_begin,
const_vector_iterator< SCALARTYPE, ALIGNMENT_SRC > const &  gpu_src_end,
const_vector_iterator< SCALARTYPE, ALIGNMENT_DEST >  gpu_dest_begin 
)

Copy (parts of a) GPU vector to another GPU vector.

Parameters:
gpu_src_begin GPU iterator pointing to the beginning of the gpu vector (STL-like)
gpu_src_end GPU iterator pointing to the end of the vector (STL-like)
gpu_dest_begin Output iterator for the gpu vector. The gpu vector must be at least as long as the cpu vector!
void viennacl::copy ( std::vector< SCALARTYPE > const &  cpu_vec,
hankel_matrix< SCALARTYPE, ALIGNMENT > &  gpu_mat 
)

Copies a Hankel matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU).

Parameters:
cpu_vec A std::vector on the host.
gpu_mat A hankel_matrix from ViennaCL
void viennacl::copy ( const CPU_MATRIX &  cpu_matrix,
matrix_range< matrix< SCALARTYPE, row_major, 1 > > &  gpu_matrix_range 
)
void viennacl::copy ( const CPU_MATRIX &  cpu_matrix,
matrix_range< matrix< SCALARTYPE, column_major, 1 > > &  gpu_matrix_range 
)
void viennacl::copy ( const compressed_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix,
std::vector< std::map< unsigned int, SCALARTYPE > > &  cpu_matrix 
)

Copies a sparse matrix from an OpenCL device to the host. The host type is the std::vector< std::map < > > format .

Parameters:
gpu_matrix A compressed_matrix from ViennaCL
cpu_matrix A sparse matrix on the host.
void viennacl::copy ( hankel_matrix< SCALARTYPE, ALIGNMENT > const &  gpu_mat,
std::vector< SCALARTYPE > &  cpu_vec 
)

Copies a Hankel matrix from the OpenCL device (either GPU or multi-core CPU) to the std::vector.

Parameters:
gpu_mat A hankel_matrix from ViennaCL
cpu_vec A std::vector on the host.
void viennacl::copy ( matrix_range< matrix< SCALARTYPE, row_major, 1 > > const &  gpu_matrix_range,
CPU_MATRIX &  cpu_matrix 
)
void viennacl::copy ( matrix_range< matrix< SCALARTYPE, column_major, 1 > > const &  gpu_matrix_range,
CPU_MATRIX &  cpu_matrix 
)
void viennacl::copy ( hankel_matrix< SCALARTYPE, ALIGNMENT > const &  han_src,
MATRIXTYPE &  com_dst 
)

Copies a Hankel matrix from the OpenCL device (either GPU or multi-core CPU) to the matrix-like object.

Parameters:
han_src A hankel_matrix from ViennaCL
com_dst A matrix-like object
void viennacl::copy ( const VectorType &  cpu_vector,
vector_range< vector< SCALARTYPE > > &  gpu_vector_range 
)
void viennacl::copy ( vector_range< vector< SCALARTYPE > > const &  gpu_vector_range,
VectorType &  cpu_vector 
)
void viennacl::copy ( const CPU_MATRIX &  cpu_matrix,
coordinate_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix 
)

Copies a sparse matrix from the host to the OpenCL device (either GPU or multi-core CPU).

For the requirements on the CPU_MATRIX type, see the documentation of the function copy(CPU_MATRIX, compressed_matrix<>)

Parameters:
cpu_matrix A sparse matrix on the host.
gpu_matrix A compressed_matrix from ViennaCL
void viennacl::copy ( MATRIXTYPE const &  com_src,
hankel_matrix< SCALARTYPE, ALIGNMENT > &  han_dst 
)

Copies a the matrix-like object to the Hankel matrix from the OpenCL device (either GPU or multi-core CPU).

Parameters:
com_src A std::vector on the host
han_dst A hankel_matrix from ViennaCL
void viennacl::copy ( std::vector< SCALARTYPE > const &  cpu_vec,
toeplitz_matrix< SCALARTYPE, ALIGNMENT > &  gpu_mat 
)

Copies a Toeplitz matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU).

Parameters:
cpu_vec A std::vector on the host.
gpu_mat A toeplitz_matrix from ViennaCL
void viennacl::copy ( const std::vector< std::map< unsigned int, SCALARTYPE > > &  cpu_matrix,
coordinate_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix 
)

Copies a sparse matrix in the std::vector< std::map < > > format to an OpenCL device.

Parameters:
cpu_matrix A sparse matrix on the host.
gpu_matrix A coordinate_matrix from ViennaCL
void viennacl::copy ( toeplitz_matrix< SCALARTYPE, ALIGNMENT > const &  gpu_mat,
std::vector< SCALARTYPE > &  cpu_vec 
)

Copies a Toeplitz matrix from the OpenCL device (either GPU or multi-core CPU) to the std::vector.

Parameters:
gpu_mat A toeplitz_matrix from ViennaCL
cpu_vec A std::vector on the host.
void viennacl::copy ( const CPUVECTOR &  cpu_vec,
vector< SCALARTYPE, ALIGNMENT > &  gpu_vec 
)

Transfer from a cpu vector to a gpu vector. Convenience wrapper for viennacl::linalg::copy(cpu_vec.begin(), cpu_vec.end(), gpu_vec.begin());.

Parameters:
cpu_vec A cpu vector. Type requirements: Iterator can be obtained via member function .begin() and .end()
gpu_vec The gpu vector.
void viennacl::copy ( CPU_ITERATOR const &  cpu_begin,
CPU_ITERATOR const &  cpu_end,
const_vector_iterator< SCALARTYPE, ALIGNMENT >  gpu_begin 
)
void viennacl::copy ( toeplitz_matrix< SCALARTYPE, ALIGNMENT > const &  tep_src,
MATRIXTYPE &  com_dst 
)

Copies a Toeplitz matrix from the OpenCL device (either GPU or multi-core CPU) to the matrix-like object.

Parameters:
tep_src A toeplitz_matrix from ViennaCL
com_dst A matrix-like object
void viennacl::copy ( MATRIXTYPE const &  com_src,
toeplitz_matrix< SCALARTYPE, ALIGNMENT > &  tep_dst 
)

Copies a the matrix-like object to the Toeplitz matrix from the OpenCL device (either GPU or multi-core CPU).

Parameters:
com_src A std::vector on the host
tep_dst A toeplitz_matrix from ViennaCL
void viennacl::copy ( vector< SCALARTYPE, ALIGNMENT > const &  gpu_vec,
CPUVECTOR &  cpu_vec 
)

Transfer from a gpu vector to a cpu vector. Convenience wrapper for viennacl::linalg::copy(gpu_vec.begin(), gpu_vec.end(), cpu_vec.begin());.

Parameters:
gpu_vec A gpu vector
cpu_vec The cpu vector. Type requirements: Output iterator can be obtained via member function .begin()
void viennacl::copy ( circulant_matrix< SCALARTYPE, ALIGNMENT > &  circ_src,
MATRIXTYPE &  com_dst 
)

Copies a circulant matrix from the OpenCL device (either GPU or multi-core CPU) to the matrix-like object.

Parameters:
circ_src A circulant_matrix from ViennaCL
com_dst A matrix-like object
void viennacl::copy ( const const_vector_iterator< SCALARTYPE, ALIGNMENT > &  gpu_begin,
const const_vector_iterator< SCALARTYPE, ALIGNMENT > &  gpu_end,
CPU_ITERATOR  cpu_begin 
)

STL-like transfer for the entries of a GPU vector to the CPU. The cpu type does not need to lie in a linear piece of memory.

Parameters:
gpu_begin GPU constant iterator pointing to the beginning of the gpu vector (STL-like)
gpu_end GPU constant iterator pointing to the end of the vector (STL-like)
cpu_begin Output iterator for the cpu vector. The cpu vector must be at least as long as the gpu vector!
void viennacl::copy ( const CPU_MATRIX &  cpu_matrix,
compressed_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix 
)

Copies a sparse matrix from the host to the OpenCL device (either GPU or multi-core CPU).

There are some type requirements on the CPU_MATRIX type (fulfilled by e.g. boost::numeric::ublas):

  • .size1() returns the number of rows
  • .size2() returns the number of columns
  • const_iterator1 is a type definition for an iterator along increasing row indices
  • const_iterator2 is a type definition for an iterator along increasing columns indices
  • The const_iterator1 type provides an iterator of type const_iterator2 via members .begin() and .end() that iterates along column indices in the current row.
  • The types const_iterator1 and const_iterator2 provide members functions .index1() and .index2() that return the current row and column indices respectively.
  • Dereferenciation of an object of type const_iterator2 returns the entry.
Parameters:
cpu_matrix A sparse matrix on the host.
gpu_matrix A compressed_matrix from ViennaCL
void viennacl::copy ( MATRIXTYPE &  com_src,
vandermonde_matrix< SCALARTYPE, ALIGNMENT > &  vander_dst 
)

Copies a the matrix-like object to the Vandermonde matrix from the OpenCL device (either GPU or multi-core CPU).

Parameters:
com_src A std::vector on the host
vander_dst A vandermonde_matrix from ViennaCL
void viennacl::copy ( vandermonde_matrix< SCALARTYPE, ALIGNMENT > &  vander_src,
MATRIXTYPE &  com_dst 
)

Copies a Vandermonde matrix from the OpenCL device (either GPU or multi-core CPU) to the matrix-like object.

Parameters:
vander_src A vandermonde_matrix from ViennaCL
com_dst A matrix-like object
void viennacl::copy ( const coordinate_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix,
CPU_MATRIX &  cpu_matrix 
)

Copies a sparse matrix from the OpenCL device (either GPU or multi-core CPU) to the host.

There are two type requirements on the CPU_MATRIX type (fulfilled by e.g. boost::numeric::ublas):

  • resize(rows, cols) A resize function to bring the matrix into the correct size
  • operator(i,j) Write new entries via the parenthesis operator
Parameters:
gpu_matrix A coordinate_matrix from ViennaCL
cpu_matrix A sparse matrix on the host.
void viennacl::copy ( std::vector< SCALARTYPE > &  cpu_vec,
vandermonde_matrix< SCALARTYPE, ALIGNMENT > &  gpu_mat 
)

Copies a Vandermonde matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU).

Parameters:
cpu_vec A std::vector on the host.
gpu_mat A vandermonde_matrix from ViennaCL
void viennacl::copy ( vandermonde_matrix< SCALARTYPE, ALIGNMENT > &  gpu_mat,
std::vector< SCALARTYPE > &  cpu_vec 
)

Copies a Vandermonde matrix from the OpenCL device (either GPU or multi-core CPU) to the std::vector.

Parameters:
gpu_mat A vandermonde_matrix from ViennaCL
cpu_vec A std::vector on the host.
void viennacl::copy ( const CPU_MATRIX &  cpu_matrix,
matrix< SCALARTYPE, F, ALIGNMENT > &  gpu_matrix 
)

Copies a dense matrix from the host (CPU) to the OpenCL device (GPU or multi-core CPU).

Parameters:
cpu_matrix A dense matrix on the host. Type requirements: .size1() returns number of rows, .size2() returns number of columns. Access to entries via operator()
gpu_matrix A dense ViennaCL matrix
void viennacl::copy ( const coordinate_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix,
std::vector< std::map< unsigned int, SCALARTYPE > > &  cpu_matrix 
)

Copies a sparse matrix from an OpenCL device to the host. The host type is the std::vector< std::map < > > format .

Parameters:
gpu_matrix A coordinate_matrix from ViennaCL
cpu_matrix A sparse matrix on the host.
void viennacl::copy ( const std::vector< std::vector< SCALARTYPE, A1 >, A2 > &  cpu_matrix,
matrix< SCALARTYPE, F, ALIGNMENT > &  gpu_matrix 
)

Copies a dense STL-type matrix from the host (CPU) to the OpenCL device (GPU or multi-core CPU).

Parameters:
cpu_matrix A dense matrix on the host of type std::vector< std::vector<> >. cpu_matrix[i][j] returns the element in the i-th row and j-th columns (both starting with zero)
gpu_matrix A dense ViennaCL matrix
void viennacl::copy ( const vector_iterator< SCALARTYPE, ALIGNMENT > &  gpu_begin,
const vector_iterator< SCALARTYPE, ALIGNMENT > &  gpu_end,
CPU_ITERATOR  cpu_begin 
)

STL-like transfer for the entries of a GPU vector to the CPU. The cpu type does not need to lie in a linear piece of memory.

Parameters:
gpu_begin GPU iterator pointing to the beginning of the gpu vector (STL-like)
gpu_end GPU iterator pointing to the end of the vector (STL-like)
cpu_begin Output iterator for the cpu vector. The cpu vector must be at least as long as the gpu vector!
void viennacl::copy ( const std::vector< std::map< unsigned int, SCALARTYPE > > &  cpu_matrix,
compressed_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix 
)

Copies a sparse matrix in the std::vector< std::map < > > format to an OpenCL device.

Parameters:
cpu_matrix A sparse matrix on the host.
gpu_matrix A compressed_matrix from ViennaCL
void copy ( CPU_ITERATOR const &  cpu_begin,
CPU_ITERATOR const &  cpu_end,
vector_iterator< SCALARTYPE, ALIGNMENT >  gpu_begin 
)

STL-like transfer for the entries of a GPU vector to the CPU. The cpu type does not need to lie in a linear piece of memory.

Parameters:
cpu_begin CPU iterator pointing to the beginning of the gpu vector (STL-like)
cpu_end CPU iterator pointing to the end of the vector (STL-like)
gpu_begin Output iterator for the gpu vector. The gpu vector must be at least as long as the cpu vector!
void viennacl::copy ( const matrix< SCALARTYPE, F, ALIGNMENT > &  gpu_matrix,
CPU_MATRIX &  cpu_matrix 
)

Copies a dense matrix from the OpenCL device (GPU or multi-core CPU) to the host (CPU).

Parameters:
gpu_matrix A dense ViennaCL matrix
cpu_matrix A dense memory on the host. Must have at least as many rows and columns as the gpu_matrix! Type requirement: Access to entries via operator()
void viennacl::copy ( const matrix< SCALARTYPE, F, ALIGNMENT > &  gpu_matrix,
std::vector< std::vector< SCALARTYPE, A1 >, A2 > &  cpu_matrix 
)

Copies a dense matrix from the OpenCL device (GPU or multi-core CPU) to the host (CPU).

Parameters:
gpu_matrix A dense ViennaCL matrix
cpu_matrix A dense memory on the host using STL types, typically std::vector< std::vector<> > Must have at least as many rows and columns as the gpu_matrix! Type requirement: Access to entries via operator()
void copy ( const_vector_iterator< SCALARTYPE, ALIGNMENT_SRC > const &  gpu_src_begin,
const_vector_iterator< SCALARTYPE, ALIGNMENT_SRC > const &  gpu_src_end,
vector_iterator< SCALARTYPE, ALIGNMENT_DEST >  gpu_dest_begin 
)

Copy (parts of a) GPU vector to another GPU vector.

Parameters:
gpu_src_begin GPU iterator pointing to the beginning of the gpu vector (STL-like)
gpu_src_end GPU iterator pointing to the end of the vector (STL-like)
gpu_dest_begin Output iterator for the gpu vector. The gpu_dest vector must be at least as long as the gpu_src vector!
void viennacl::copy ( vector< SCALARTYPE, ALIGNMENT_SRC > const &  gpu_src_vec,
vector< SCALARTYPE, ALIGNMENT_DEST > &  gpu_dest_vec 
)

Transfer from a ViennaCL vector to another ViennaCL vector. Convenience wrapper for viennacl::linalg::copy(gpu_src_vec.begin(), gpu_src_vec.end(), gpu_dest_vec.begin());.

Parameters:
gpu_src_vec A gpu vector
gpu_dest_vec The cpu vector. Type requirements: Output iterator can be obtained via member function .begin()
void viennacl::fast_copy ( const const_vector_iterator< SCALARTYPE, ALIGNMENT > &  gpu_begin,
const const_vector_iterator< SCALARTYPE, ALIGNMENT > &  gpu_end,
CPU_ITERATOR  cpu_begin 
)

STL-like transfer of a GPU vector to the CPU. The cpu type is assumed to reside in a linear piece of memory, such as e.g. for std::vector.

This method is faster than the plain copy() function, because entries are directly written to the cpu vector, starting with &(*cpu.begin()) However, keep in mind that the cpu type MUST represent a linear piece of memory, otherwise you will run into undefined behavior.

Parameters:
gpu_begin GPU iterator pointing to the beginning of the gpu vector (STL-like)
gpu_end GPU iterator pointing to the end of the vector (STL-like)
cpu_begin Output iterator for the cpu vector. The cpu vector must be at least as long as the gpu vector!
void viennacl::fast_copy ( vector< SCALARTYPE, ALIGNMENT > const &  gpu_vec,
CPUVECTOR &  cpu_vec 
)

Transfer from a gpu vector to a cpu vector. Convenience wrapper for viennacl::linalg::fast_copy(gpu_vec.begin(), gpu_vec.end(), cpu_vec.begin());.

Parameters:
gpu_vec A gpu vector.
cpu_vec The cpu vector. Type requirements: Output iterator can be obtained via member function .begin()
void viennacl::fast_copy ( CPU_ITERATOR const &  cpu_begin,
CPU_ITERATOR const &  cpu_end,
vector_iterator< SCALARTYPE, ALIGNMENT >  gpu_begin 
)

STL-like transfer of a CPU vector to the GPU. The cpu type is assumed to reside in a linear piece of memory, such as e.g. for std::vector.

This method is faster than the plain copy() function, because entries are directly read from the cpu vector, starting with &(*cpu.begin()). However, keep in mind that the cpu type MUST represent a linear piece of memory, otherwise you will run into undefined behavior.

Parameters:
cpu_begin CPU iterator pointing to the beginning of the cpu vector (STL-like)
cpu_end CPU iterator pointing to the end of the vector (STL-like)
gpu_begin Output iterator for the gpu vector. The gpu iterator must be incrementable (cpu_end - cpu_begin) times, otherwise the result is undefined.
void viennacl::fast_copy ( const CPUVECTOR &  cpu_vec,
vector< SCALARTYPE, ALIGNMENT > &  gpu_vec 
)

Transfer from a cpu vector to a gpu vector. Convenience wrapper for viennacl::linalg::fast_copy(cpu_vec.begin(), cpu_vec.end(), gpu_vec.begin());.

Parameters:
cpu_vec A cpu vector. Type requirements: Iterator can be obtained via member function .begin() and .end()
gpu_vec The gpu vector.
void viennacl::fast_copy ( SCALARTYPE *  cpu_matrix_begin,
SCALARTYPE *  cpu_matrix_end,
matrix< SCALARTYPE, F, ALIGNMENT > &  gpu_matrix 
)

Copies a dense matrix from the host (CPU) to the OpenCL device (GPU or multi-core CPU) without temporary. Matrix-Layout on CPU must be equal to the matrix-layout on the GPU.

Parameters:
cpu_matrix_begin Pointer to the first matrix entry. Cf. iterator concept in STL
cpu_matrix_end Pointer past the last matrix entry. Cf. iterator concept in STL
gpu_matrix A dense ViennaCL matrix
void viennacl::fast_copy ( const matrix< SCALARTYPE, F, ALIGNMENT > &  gpu_matrix,
SCALARTYPE *  cpu_matrix_begin 
)

Copies a dense matrix from the OpenCL device (GPU or multi-core CPU) to the host (CPU).

Parameters:
gpu_matrix A dense ViennaCL matrix
cpu_matrix_begin Pointer to the output memory on the CPU. User must ensure that provided memory is large enough.
vector<SCALARTYPE, ALIGNMENT>& viennacl::fast_swap ( vector< SCALARTYPE, ALIGNMENT > &  v1,
vector< SCALARTYPE, ALIGNMENT > &  v2 
)

Swaps the content of two vectors by swapping OpenCL handles only, NO data is copied.

Parameters:
v1 The first vector
v2 The second vector
vector_expression< const vector<SCALARTYPE, A>, const SCALARTYPE, op_prod> viennacl::operator* ( SCALARTYPE const &  value,
vector< SCALARTYPE, A > const &  vec 
)

Operator overload for the expression alpha * v1, where alpha is a host scalar (float or double) and v1 is a ViennaCL vector.

Parameters:
value The host scalar (float or double)
vec A ViennaCL vector
vector<SCALARTYPE> viennacl::operator* ( scalar< SCALARTYPE > const &  val,
vector_expression< LHS, RHS, OP > const &  proxy 
)

Operator overload for the multiplication of a vector expression with a ViennaCL scalar from the left, e.g. alpha * (beta * vec1). Here, beta * vec1 is wrapped into a vector_expression and then multiplied with alpha from the left.

Parameters:
val Right hand side scalar
proxy Left hand side vector expression
viennacl::matrix_expression< const viennacl::matrix_expression< const viennacl::vector<SCALARTYPE, VA1>, const viennacl::vector<SCALARTYPE, VA2>, op_prod>, const SCALARTYPE, op_prod> viennacl::operator* ( CPU_SCALAR const &  val,
viennacl::matrix_expression< const viennacl::vector< SCALARTYPE, VA1 >, const viennacl::vector< SCALARTYPE, VA2 >, op_prod > const &  proxy 
)
viennacl::vector<SCALARTYPE> viennacl::operator* ( SCALARTYPE  val,
viennacl::vector_expression< LHS, RHS, OP > const &  proxy 
)

Operator overload for the multiplication of a vector expression with a host scalar (float or double) from the left, e.g. alpha * (beta * vec1). Here, beta * vec1 is wrapped into a vector_expression and then multiplied with alpha from the left.

Parameters:
val Right hand side scalar
proxy Left hand side vector expression
vector_expression< const vector<SCALARTYPE, A>, const scalar<SCALARTYPE>, op_prod> viennacl::operator* ( scalar< SCALARTYPE > const &  value,
vector< SCALARTYPE, A > const &  vec 
)

Operator overload for the expression alpha * v1, where alpha is a ViennaCL scalar (float or double) and v1 is a ViennaCL vector.

Parameters:
value The ViennaCL scalar
vec A ViennaCL vector
vector<SCALARTYPE> viennacl::operator* ( vector_expression< LHS, RHS, OP > const &  proxy,
scalar< SCALARTYPE > const &  val 
)

Operator overload for the multiplication of a vector expression with a scalar from the right, e.g. (beta * vec1) * alpha. Here, beta * vec1 is wrapped into a vector_expression and then multiplied with alpha from the right.

Parameters:
proxy Left hand side vector expression
val Right hand side scalar
viennacl::matrix_expression< const viennacl::matrix_expression< const viennacl::vector<SCALARTYPE, VECTOR_ALIGNMENT>, const viennacl::vector<SCALARTYPE, VECTOR_ALIGNMENT>, op_prod>, const SCALARTYPE, op_prod> viennacl::operator* ( const viennacl::matrix_expression< const viennacl::vector< SCALARTYPE, VECTOR_ALIGNMENT >, const viennacl::vector< SCALARTYPE, VECTOR_ALIGNMENT >, op_prod > &  proxy,
CPU_SCALAR const &  val 
)
vector_expression< LHS1, RHS1, OP1>::VectorType viennacl::operator+ ( vector_expression< LHS1, RHS1, OP1 > const &  proxy1,
vector_expression< LHS2, RHS2, OP2 > const &  proxy2 
)

Operator overload for the addition of two vector expressions.

Parameters:
proxy1 Left hand side vector expression
proxy2 Right hand side vector expression
vector<SCALARTYPE, A> viennacl::operator+ ( vector_expression< LHS, RHS, OP > const &  proxy,
vector< SCALARTYPE, A > const &  vec 
)

Operator overload for the addition of a vector expression from the left, e.g. alpha * vec1 + vec2. Here, alpha * vec1 is wrapped into a vector_expression and then added to vec2.

Parameters:
proxy Left hand side vector expression
vec Right hand side vector
vector_expression< LHS1, RHS1, OP1>::VectorType viennacl::operator- ( vector_expression< LHS1, RHS1, OP1 > const &  proxy1,
vector_expression< LHS2, RHS2, OP2 > const &  proxy2 
)

Operator overload for the subtraction of two vector expressions.

Parameters:
proxy1 Left hand side vector expression
proxy2 Right hand side vector expression
vector<SCALARTYPE, A> viennacl::operator- ( vector_expression< LHS, RHS, OP > const &  proxy,
vector< SCALARTYPE, A > const &  vec 
)

Operator overload for the subtraction of a vector expression from the left, e.g. alpha * vec1 + vec2. Here, alpha * vec1 is wrapped into a vector_expression and then added to vec2.

Parameters:
proxy Left hand side vector expression
vec Right hand side vector
vector<SCALARTYPE> viennacl::operator/ ( vector_expression< LHS, RHS, OP > const &  proxy,
scalar< SCALARTYPE > const &  val 
)

Operator overload for the division of a vector expression by a scalar from the right, e.g. (beta * vec1) / alpha. Here, beta * vec1 is wrapped into a vector_expression and then divided by alpha.

Parameters:
proxy Left hand side vector expression
val Right hand side scalar
std::ostream& viennacl::operator<< ( std::ostream &  s,
toeplitz_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix 
)

Prints the matrix. Output is compatible to boost::numeric::ublas.

Parameters:
s STL output stream
gpu_matrix A ViennaCL Toeplitz matrix
std::ostream& viennacl::operator<< ( std::ostream &  s,
hankel_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix 
)
std::ostream& viennacl::operator<< ( std::ostream &  s,
const matrix_expression< LHS, RHS, OP > &  expr 
)

Prints the matrix. Output is compatible to boost::numeric::ublas.

Parameters:
s STL output stream
expr A matrix expression
std::ostream& viennacl::operator<< ( std::ostream &  s,
const scalar< SCALARTYPE > &  val 
)

Allows to directly print the value of a scalar to an output stream.

std::ostream& viennacl::operator<< ( std::ostream &  s,
vector< SCALARTYPE, ALIGNMENT > const &  val 
)

Output stream. Output format is ublas compatible.

Parameters:
s STL output stream
val The vector that should be printed
std::ostream& viennacl::operator<< ( std::ostream &  s,
circulant_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix 
)

Prints the matrix. Output is compatible to boost::numeric::ublas.

Parameters:
s STL output stream
gpu_matrix A ViennaCL circulant matrix
std::ostream& viennacl::operator<< ( std::ostream &  s,
const matrix< SCALARTYPE, F, ALIGNMENT > &  gpu_matrix 
)

Prints the matrix. Output is compatible to boost::numeric::ublas.

Parameters:
s STL output stream
gpu_matrix A dense ViennaCL matrix
std::ostream& viennacl::operator<< ( std::ostream &  s,
vandermonde_matrix< SCALARTYPE, ALIGNMENT > &  gpu_matrix 
)

Prints the matrix. Output is compatible to boost::numeric::ublas.

Parameters:
s STL output stream
gpu_matrix A ViennaCL Vandermonde matrix
std::ostream& viennacl::operator<< ( std::ostream &  s,
vector_range< VectorType > const &  proxy 
)
std::istream& viennacl::operator>> ( std::istream &  s,
const scalar< SCALARTYPE > &  val 
)

Allows to directly read a value of a scalar from an input stream.

std::vector<int> viennacl::reorder ( MatrixType const &  matrix,
cuthill_mckee_tag   
)

Function for the calculation of a node number permutation to reduce the bandwidth of an incidence matrix by the Cuthill-McKee algorithm.

references: Algorithm was implemented similary as described in "Tutorial: Bandwidth Reduction - The CutHill- McKee Algorithm" posted by Ciprian Zavoianu as weblog at http://ciprian-zavoianu.blogspot.com/2009/01/project-bandwidth-reduction.html on January 15, 2009 (URL taken on June 14, 2011)

Parameters:
matrix vector of n matrix rows, where each row is a map<int, double> containing only the nonzero elements
Returns:
permutation vector r. r[l] = i means that the new label of node i will be l.
std::vector<int> viennacl::reorder ( MatrixType const &  matrix,
gibbs_poole_stockmeyer_tag   
)

Function for the calculation of a node numbering permutation vector to reduce the bandwidth of a incidence matrix by the Gibbs-Poole-Stockmeyer algorithm.

references: Werner Neudorf: "Bandbreitenreduktion - Teil 3. Algorithmus von Gibbs-Poole-Stockmeyer. Testbeispiele mit CM und GPS", Preprint No. M 08/02, September 2002. Technische Universität Ilmenau, Fakultät für Mathematik und Naturwissenschaften, Institut für Mathematik. http://www.db-thueringen.de/servlets/DerivateServlet/Derivate-8673/IfM_Preprint_M_02_08.pdf (URL taken on June 14, 2011)

Parameters:
matrix vector of n matrix rows, where each row is a map<int, double> containing only the nonzero elements
Returns:
permutation vector r. r[l] = i means that the new label of node i will be l.
std::vector<int> viennacl::reorder ( MatrixType const &  matrix,
advanced_cuthill_mckee_tag const &  tag 
)

Function for the calculation of a node number permutation to reduce the bandwidth of an incidence matrix by the advanced Cuthill-McKee algorithm.

references: see description of original Cuthill McKee implementation, and E. Cuthill and J. McKee: "Reducing the Bandwidth of sparse symmetric Matrices". Naval Ship Research and Development Center, Washington, D. C., 20007

void viennacl::swap ( viennacl::vector< SCALARTYPE, ALIGNMENT > &  vec1,
viennacl::vector< SCALARTYPE, ALIGNMENT > &  vec2 
)

Swaps the contents of two vectors, data is copied.

Parameters:
vec1 The first vector
vec2 The second vector
matrix_expression< const matrix<SCALARTYPE, F, ALIGNMENT>, const matrix<SCALARTYPE, F, ALIGNMENT>, op_trans> viennacl::trans ( const matrix< SCALARTYPE, F, ALIGNMENT > &  mat  ) 

Returns an expression template class representing a transposed matrix.

matrix_expression< const matrix_range<MatrixType>, const matrix_range<MatrixType>, op_trans> viennacl::trans ( const matrix_range< MatrixType > &  mat  ) 

Returns an expression template class representing a transposed matrix.