Public Types | Public Member Functions | List of all members
blaze::DenseVectorProxy< PT, VT > Class Template Reference

Proxy backend for dense vector types.The DenseVectorProxy class serves as a backend for the Proxy class. It is used in case the data type represented by the proxy is a dense vector and augments the Proxy interface by the complete interface required of dense vectors. More...

#include <DenseVectorProxy.h>

Inherits blaze::DenseVector< PT, IsRowVector< VT >::value >.

Public Types

enum  { vectorizable = VT::vectorizable }
 Compilation flag for intrinsic optimization.
 
enum  { smpAssignable = VT::smpAssignable }
 Compilation flag for SMP assignments.
 
typedef VT::ResultType ResultType
 Result type for expression template evaluations.
 
typedef VT::TransposeType TransposeType
 Transpose type for expression template evaluations.
 
typedef VT::ElementType ElementType
 Type of the vector elements.
 
typedef VT::ReturnType ReturnType
 Return type for expression template evaluations.
 
typedef VT::CompositeType CompositeType
 Data type for composite expression templates.
 
typedef VT::Reference Reference
 Reference to a non-constant vector value.
 
typedef VT::ConstReference ConstReference
 Reference to a constant vector value.
 
typedef VT::Pointer Pointer
 Pointer to a non-constant vector value.
 
typedef VT::ConstPointer ConstPointer
 Pointer to a constant vector value.
 
typedef VT::Iterator Iterator
 Iterator over non-constant elements.
 
typedef VT::ConstIterator ConstIterator
 Iterator over constant elements.
 
typedef PT VectorType
 Type of the vector.
 

Public Member Functions

BLAZE_ALWAYS_INLINE VectorTypeoperator~ ()
 Conversion operator for non-constant vectors. More...
 
BLAZE_ALWAYS_INLINE const VectorTypeoperator~ () const
 Conversion operator for constant vectors. More...
 
Data access functions
Reference operator[] (size_t index) const
 Subscript operator for the direct access to vector elements. More...
 
Pointer data () const
 Low-level data access to vector elements. More...
 
Iterator begin () const
 Returns an iterator to the first element of the represented vector. More...
 
ConstIterator cbegin () const
 Returns an iterator to the first element of the represented vector. More...
 
Iterator end () const
 Returns an iterator just past the last element of the represented vector. More...
 
ConstIterator cend () const
 Returns an iterator just past the last element of the represented vector. More...
 
Utility functions
size_t size () const
 Returns the current size/dimension of the represented vector. More...
 
size_t capacity () const
 Returns the maximum capacity of the represented vector. More...
 
size_t nonZeros () const
 Returns the number of non-zero elements in the represented vector. More...
 
void reset () const
 Reset to the default initial value. More...
 
void clear () const
 Clearing the represented vector. More...
 
void resize (size_t n, bool preserve=true) const
 Changing the size of the represented vector. More...
 
void extend (size_t n, bool preserve=true) const
 Extending the size of the represented vector. More...
 
void reserve (size_t n) const
 Setting the minimum capacity of the represented vector. More...
 
template<typename Other >
void scale (const Other &scalar) const
 Scaling of the vector by the scalar value scalar ( $ \vec{a}=\vec{b}*s $). More...
 

Detailed Description

template<typename PT, typename VT>
class blaze::DenseVectorProxy< PT, VT >

Proxy backend for dense vector types.

The DenseVectorProxy class serves as a backend for the Proxy class. It is used in case the data type represented by the proxy is a dense vector and augments the Proxy interface by the complete interface required of dense vectors.

Member Function Documentation

template<typename PT , typename VT >
DenseVectorProxy< PT, VT >::Iterator blaze::DenseVectorProxy< PT, VT >::begin ( ) const
inline

Returns an iterator to the first element of the represented vector.

Returns
Iterator to the first element of the vector.
template<typename PT , typename VT >
size_t blaze::DenseVectorProxy< PT, VT >::capacity ( ) const
inline

Returns the maximum capacity of the represented vector.

Returns
The capacity of the vector.
template<typename PT , typename VT >
DenseVectorProxy< PT, VT >::ConstIterator blaze::DenseVectorProxy< PT, VT >::cbegin ( ) const
inline

Returns an iterator to the first element of the represented vector.

Returns
Iterator to the first element of the vector.
template<typename PT , typename VT >
DenseVectorProxy< PT, VT >::ConstIterator blaze::DenseVectorProxy< PT, VT >::cend ( ) const
inline

Returns an iterator just past the last element of the represented vector.

Returns
Iterator just past the last element of the vector.
template<typename PT , typename VT >
void blaze::DenseVectorProxy< PT, VT >::clear ( ) const
inline

Clearing the represented vector.

Returns
void

This function clears the vector to its default initial state.

template<typename PT , typename VT >
DenseVectorProxy< PT, VT >::Pointer blaze::DenseVectorProxy< PT, VT >::data ( ) const
inline

Low-level data access to vector elements.

Returns
Pointer to the internal element storage.

This function returns a pointer to the internal storage of the dynamic vector.

template<typename PT , typename VT >
DenseVectorProxy< PT, VT >::Iterator blaze::DenseVectorProxy< PT, VT >::end ( ) const
inline

Returns an iterator just past the last element of the represented vector.

Returns
Iterator just past the last element of the vector.
template<typename PT , typename VT >
void blaze::DenseVectorProxy< PT, VT >::extend ( size_t  n,
bool  preserve = true 
) const
inline

Extending the size of the represented vector.

Parameters
nNumber of additional vector elements.
preservetrue if the old values of the vector should be preserved, false if not.
Returns
void

This function extends the size of the vector. Depending on the type of the vector, during this operation new dynamic memory may be allocated in case the capacity of the vector is too small. Therefore this function potentially changes all vector elements. In order to preserve the old vector values, the preserve flag can be set to true. However, note that depending on the type vector new vector elements may not initialized!

template<typename PT , typename VT >
size_t blaze::DenseVectorProxy< PT, VT >::nonZeros ( ) const
inline

Returns the number of non-zero elements in the represented vector.

Returns
The number of non-zero elements in the vector.

Note that the number of non-zero elements is always less than or equal to the current size of the vector.

template<typename PT , typename VT >
DenseVectorProxy< PT, VT >::Reference blaze::DenseVectorProxy< PT, VT >::operator[] ( size_t  index) const
inline

Subscript operator for the direct access to vector elements.

Parameters
indexAccess index. The index has to be in the range $[0..N-1]$.
Returns
Reference to the accessed value.
BLAZE_ALWAYS_INLINE VectorType& blaze::Vector< PT , TF >::operator~ ( )
inlineinherited

Conversion operator for non-constant vectors.

Returns
Reference of the actual type of the vector.
BLAZE_ALWAYS_INLINE const VectorType& blaze::Vector< PT , TF >::operator~ ( ) const
inlineinherited

Conversion operator for constant vectors.

Returns
Const reference of the actual type of the vector.
template<typename PT , typename VT >
void blaze::DenseVectorProxy< PT, VT >::reserve ( size_t  n) const
inline

Setting the minimum capacity of the represented vector.

Parameters
nThe new minimum capacity of the vector.
Returns
void

This function increases the capacity of the vector to at least n elements. The current values of the vector elements are preserved.

template<typename PT , typename VT >
void blaze::DenseVectorProxy< PT, VT >::reset ( ) const
inline

Reset to the default initial value.

Returns
void

This function resets all elements of the vector to the default initial values.

template<typename PT , typename VT >
void blaze::DenseVectorProxy< PT, VT >::resize ( size_t  n,
bool  preserve = true 
) const
inline

Changing the size of the represented vector.

Parameters
nThe new size of the vector.
preservetrue if the old values of the vector should be preserved, false if not.
Returns
void

This function changes the size of the vector. Depending on the type of the vector, during this operation new dynamic memory may be allocated in case the capacity of the vector is too small. Note that this function may invalidate all existing views (subvectors, ...) on the vector if it is used to shrink the vector. Additionally, the resize() operation potentially changes all vector elements. In order to preserve the old vector values, the preserve flag can be set to true. However, note that depending on the type of the vector new vector elements may not initialized!

template<typename PT , typename VT >
template<typename Other >
void blaze::DenseVectorProxy< PT, VT >::scale ( const Other &  scalar) const
inline

Scaling of the vector by the scalar value scalar ( $ \vec{a}=\vec{b}*s $).

Parameters
scalarThe scalar value for the vector scaling.
Returns
void
template<typename PT , typename VT >
size_t blaze::DenseVectorProxy< PT, VT >::size ( ) const
inline

Returns the current size/dimension of the represented vector.

Returns
The size of the vector.

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