ViennaCL - The Vienna Computing Library  1.7.0
Free open-source GPU-accelerated linear algebra and solver library.
viennacl::vector_range< VectorType > Class Template Reference

Class for representing non-strided subvectors of a bigger vector x. More...

#include <forwards.h>

Inheritance diagram for viennacl::vector_range< VectorType >:
viennacl::vector_base< VectorType::cpu_value_type >

Public Types

typedef VectorType::value_type value_type
 
typedef range::size_type size_type
 
typedef range::difference_type difference_type
 
typedef value_type reference
 
typedef const value_typeconst_reference
 
typedef VectorType::const_iterator const_iterator
 
typedef VectorType::iterator iterator
 
typedef VectorType::handle_type handle_type
 
typedef VectorType::cpu_value_type cpu_value_type
 
- Public Types inherited from viennacl::vector_base< VectorType::cpu_value_type >
typedef scalar< VectorType::cpu_value_type > value_type
 
typedef VectorType::cpu_value_type cpu_value_type
 
typedef viennacl::backend::mem_handle handle_type
 
typedef SizeT size_type
 
typedef DistanceT difference_type
 
typedef const_vector_iterator< VectorType::cpu_value_type, 1 > const_iterator
 
typedef vector_iterator< VectorType::cpu_value_type, 1 > iterator
 

Public Member Functions

 vector_range (VectorType const &v, range const &entry_range)
 
 vector_range (self_type const &v, range const &entry_range)
 
 vector_range (self_type const &other)
 
template<typename OtherNumericT >
base_typeoperator= (viennacl::vector< OtherNumericT > const &v)
 
template<typename OtherNumericT >
base_typeoperator= (viennacl::vector_range< viennacl::vector< OtherNumericT > > const &v)
 
template<typename OtherNumericT >
base_typeoperator= (viennacl::vector_slice< viennacl::vector< OtherNumericT > > const &v)
 
- Public Member Functions inherited from viennacl::vector_base< VectorType::cpu_value_type >
size_type size () const
 Returns the length of the vector (cf. std::vector) More...
 
size_type internal_size () const
 Returns the internal length of the vector, which is given by size() plus the extra memory due to padding the memory with zeros up to a multiple of 'AlignmentV'. More...
 
size_type start () const
 Returns the offset within the buffer. More...
 
size_type stride () const
 Returns the stride within the buffer (in multiples of sizeof(NumericT)) More...
 
bool empty () const
 Returns true is the size is zero. More...
 
const handle_typehandle () const
 Returns the memory handle. More...
 
handle_typehandle ()
 Returns the memory handle. More...
 
viennacl::memory_types memory_domain () const
 
 vector_base ()
 Default constructor in order to be compatible with various containers. More...
 
 vector_base (viennacl::backend::mem_handle &h, size_type vec_size, size_type vec_start, size_type vec_stride)
 An explicit constructor for wrapping an existing vector into a vector_range or vector_slice. More...
 
 vector_base (size_type vec_size, viennacl::context ctx=viennacl::context())
 Creates a vector and allocates the necessary memory. More...
 
 vector_base (VectorType::cpu_value_type *ptr_to_mem, viennacl::memory_types mem_type, size_type vec_size, vcl_size_t start=0, size_type stride=1)
 
 vector_base (vector_expression< const LHS, const RHS, OP > const &proxy)
 
 vector_base (const self_type &other)
 
 vector_base (const vector_base< OtherNumericT > &v1)
 
self_typeoperator= (const self_type &vec)
 Assignment operator. Other vector needs to be of the same size, or this vector is not yet initialized. More...
 
self_typeoperator= (const vector_expression< const LHS, const RHS, OP > &proxy)
 Implementation of the operation v1 = v2 @ alpha, where @ denotes either multiplication or division, and alpha is either a CPU or a GPU scalar. More...
 
self_typeoperator= (const vector_base< OtherNumericT > &v1)
 Converts a vector of a different numeric type to the current numeric type. More...
 
self_typeoperator= (unit_vector< VectorType::cpu_value_type > const &v)
 Creates the vector from the supplied unit vector. More...
 
self_typeoperator= (zero_vector< VectorType::cpu_value_type > const &v)
 Creates the vector from the supplied zero vector. More...
 
self_typeoperator= (scalar_vector< VectorType::cpu_value_type > const &v)
 Creates the vector from the supplied scalar vector. More...
 
self_typeoperator= (const viennacl::vector_expression< const matrix_base< VectorType::cpu_value_type >, const vector_base< VectorType::cpu_value_type >, viennacl::op_prod > &proxy)
 Operator overload for v1 = A * v2, where v1, v2 are vectors and A is a dense matrix. More...
 
self_typeoperator= (const vector_expression< const matrix_expression< const matrix_base< VectorType::cpu_value_type >, const matrix_base< VectorType::cpu_value_type >, op_trans >, const vector_base< VectorType::cpu_value_type >, op_prod > &proxy)
 Operator overload for v1 = trans(A) * v2, where v1, v2 are vectors and A is a dense matrix. More...
 
entry_proxy< VectorType::cpu_value_type > operator() (size_type index)
 Read-write access to a single element of the vector. More...
 
const_entry_proxy< VectorType::cpu_value_type > operator() (size_type index) const
 Read access to a single element of the vector. More...
 
entry_proxy< VectorType::cpu_value_type > operator[] (size_type index)
 Read-write access to a single element of the vector. More...
 
const_entry_proxy< VectorType::cpu_value_type > operator[] (size_type index) const
 Read access to a single element of the vector. More...
 
self_typeoperator+= (const self_type &vec)
 
self_typeoperator-= (const self_type &vec)
 
self_typeoperator*= (char val)
 Scales a vector (or proxy) by a char (8-bit integer) More...
 
self_typeoperator*= (short val)
 Scales a vector (or proxy) by a short integer. More...
 
self_typeoperator*= (int val)
 Scales a vector (or proxy) by an integer. More...
 
self_typeoperator*= (long val)
 Scales a vector (or proxy) by a long integer. More...
 
self_typeoperator*= (float val)
 Scales a vector (or proxy) by a single precision floating point value. More...
 
self_typeoperator*= (double val)
 Scales a vector (or proxy) by a double precision floating point value. More...
 
self_typeoperator/= (char val)
 Scales a vector (or proxy) by a char (8-bit integer) More...
 
self_typeoperator/= (short val)
 Scales a vector (or proxy) by a short integer. More...
 
self_typeoperator/= (int val)
 Scales a vector (or proxy) by an integer. More...
 
self_typeoperator/= (long val)
 Scales a vector (or proxy) by a long integer. More...
 
self_typeoperator/= (float val)
 Scales a vector (or proxy) by a single precision floating point value. More...
 
self_typeoperator/= (double val)
 Scales a vector (or proxy) by a double precision floating point value. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_multoperator* (char value) const
 Scales the vector by a char (8-bit integer) 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_multoperator* (short value) const
 Scales the vector by a short integer 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_multoperator* (int value) const
 Scales the vector by an integer 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_multoperator* (long value) const
 Scales the vector by a long integer 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_multoperator* (float value) const
 Scales the vector by a single precision floating point value 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_multoperator* (double value) const
 Scales the vector by a double precision floating point value 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_divoperator/ (char value) const
 Scales the vector by a char (8-bit integer) 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_divoperator/ (short value) const
 Scales the vector by a short integer 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_divoperator/ (int value) const
 Scales the vector by an integer 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_divoperator/ (long value) const
 Scales the vector by a long integer 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_divoperator/ (float value) const
 Scales the vector by a single precision floating point value 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_divoperator/ (double value) const
 Scales the vector by a double precision floating point value 'alpha' and returns an expression template. More...
 
vector_expression< const self_type, const VectorType::cpu_value_type, op_multoperator- () const
 Sign flip for the vector. Emulated to be equivalent to -1.0 * vector. More...
 
iterator begin ()
 Returns an iterator pointing to the beginning of the vector (STL like) More...
 
const_iterator begin () const
 Returns a const-iterator pointing to the beginning of the vector (STL like) More...
 
iterator end ()
 Returns an iterator pointing to the end of the vector (STL like) More...
 
const_iterator end () const
 Returns a const-iterator pointing to the end of the vector (STL like) More...
 
self_typeswap (self_type &other)
 Swaps the entries of the two vectors. More...
 
void clear ()
 Resets all entries to zero. Does not change the size of the vector. More...
 

Additional Inherited Members

- Protected Member Functions inherited from viennacl::vector_base< VectorType::cpu_value_type >
void set_handle (viennacl::backend::mem_handle const &h)
 
self_typefast_swap (self_type &other)
 Swaps the handles of two vectors by swapping the OpenCL handles only, no data copy. More...
 
void pad ()
 Pads vectors with alignment > 1 with trailing zeros if the internal size is larger than the visible size. More...
 
void switch_memory_context (viennacl::context new_ctx)
 
void resize (size_type new_size, bool preserve=true)
 Resizes the allocated memory for the vector. Pads the memory to be a multiple of 'AlignmentV'. More...
 
void resize (size_type new_size, viennacl::context ctx, bool preserve=true)
 Resizes the allocated memory for the vector. Convenience function for setting an OpenCL context in case reallocation is needed. More...
 

Detailed Description

template<typename VectorType>
class viennacl::vector_range< VectorType >

Class for representing non-strided subvectors of a bigger vector x.

In MATLAB notation, this could for example refer to the subvector x(3:8) of a vector x.

Examples:
least-squares.cpp, and vector-range.cpp.

Definition at line 434 of file forwards.h.

Member Typedef Documentation

template<typename VectorType>
typedef VectorType::const_iterator viennacl::vector_range< VectorType >::const_iterator

Definition at line 50 of file vector_proxy.hpp.

template<typename VectorType>
typedef const value_type& viennacl::vector_range< VectorType >::const_reference

Definition at line 49 of file vector_proxy.hpp.

template<typename VectorType>
typedef VectorType::cpu_value_type viennacl::vector_range< VectorType >::cpu_value_type

Definition at line 54 of file vector_proxy.hpp.

template<typename VectorType>
typedef range::difference_type viennacl::vector_range< VectorType >::difference_type

Definition at line 47 of file vector_proxy.hpp.

template<typename VectorType>
typedef VectorType::handle_type viennacl::vector_range< VectorType >::handle_type

Definition at line 52 of file vector_proxy.hpp.

template<typename VectorType>
typedef VectorType::iterator viennacl::vector_range< VectorType >::iterator

Definition at line 51 of file vector_proxy.hpp.

template<typename VectorType>
typedef value_type viennacl::vector_range< VectorType >::reference

Definition at line 48 of file vector_proxy.hpp.

template<typename VectorType>
typedef range::size_type viennacl::vector_range< VectorType >::size_type

Definition at line 46 of file vector_proxy.hpp.

template<typename VectorType>
typedef VectorType::value_type viennacl::vector_range< VectorType >::value_type

Definition at line 45 of file vector_proxy.hpp.

Constructor & Destructor Documentation

template<typename VectorType>
viennacl::vector_range< VectorType >::vector_range ( VectorType const &  v,
range const &  entry_range 
)
inline

Definition at line 56 of file vector_proxy.hpp.

template<typename VectorType>
viennacl::vector_range< VectorType >::vector_range ( self_type const &  v,
range const &  entry_range 
)
inline

Definition at line 60 of file vector_proxy.hpp.

template<typename VectorType>
viennacl::vector_range< VectorType >::vector_range ( self_type const &  other)
inline

Definition at line 64 of file vector_proxy.hpp.

Member Function Documentation

template<typename VectorType>
template<typename OtherNumericT >
base_type& viennacl::vector_range< VectorType >::operator= ( viennacl::vector< OtherNumericT > const &  v)
inline

Definition at line 72 of file vector_proxy.hpp.

template<typename VectorType>
template<typename OtherNumericT >
base_type& viennacl::vector_range< VectorType >::operator= ( viennacl::vector_range< viennacl::vector< OtherNumericT > > const &  v)
inline

Definition at line 75 of file vector_proxy.hpp.

template<typename VectorType>
template<typename OtherNumericT >
base_type& viennacl::vector_range< VectorType >::operator= ( viennacl::vector_slice< viennacl::vector< OtherNumericT > > const &  v)
inline

Definition at line 78 of file vector_proxy.hpp.


The documentation for this class was generated from the following files: