All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Modules | Classes | Functions

Modules

 Dense Vectors
 
 Sparse Vectors
 

Classes

struct  blaze::Vector< typename, bool >
 Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-dimensional) dense and sparse vector classes within the Blaze library. It provides an abstraction from the actual type of the vector, but enables a conversion back to this type via the 'Curiously Recurring Template Pattern' (CRTP). More...
 

Functions

template<typename VT , bool TF>
size_t blaze::size (Vector< VT, TF > &v)
 Returns the current size/dimension of the vector. More...
 
template<typename VT , bool TF>
size_t blaze::capacity (Vector< VT, TF > &v)
 Returns the maximum capacity of the vector. More...
 
template<typename VT , bool TF>
size_t blaze::nonZeros (Vector< VT, TF > &v)
 Returns the number of non-zero elements in the vector. More...
 

Vector global functions

template<typename VT1 , bool TF1, typename VT2 , bool TF2>
void blaze::assign (Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
 Default implementation of the assignment of a vector to a vector. More...
 
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
void blaze::addAssign (Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
 Default implementation of the addition assignment of a vector to a vector. More...
 
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
void blaze::subAssign (Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
 Default implementation of the subtraction assignment of a vector to a vector. More...
 
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
void blaze::multAssign (Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
 Default implementation of the multiplication assignment of a vector to a vector. More...
 
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::isSame (const Vector< VT1, TF1 > &a, const Vector< VT2, TF2 > &b)
 Returns whether the two given vectors represent the same observable state. More...
 

Vector operators

template<typename T1 , typename T2 >
const MultTrait< typename
T1::ElementType, typename
T2::ElementType >::Type 
blaze::operator, (const Vector< T1, false > &lhs, const Vector< T2, false > &rhs)
 Multiplication operator for the scalar product (inner product) of two vectors ( $ s=(\vec{a},\vec{b}) $). More...
 
template<typename T1 , typename T2 >
const MultTrait< typename
T1::ElementType, typename
T2::ElementType >::Type 
blaze::operator, (const Vector< T1, false > &lhs, const Vector< T2, true > &rhs)
 Multiplication operator for the scalar product (inner product) of two vectors ( $ s=(\vec{a},\vec{b}) $). More...
 
template<typename T1 , typename T2 >
const MultTrait< typename
T1::ElementType, typename
T2::ElementType >::Type 
blaze::operator, (const Vector< T1, true > &lhs, const Vector< T2, false > &rhs)
 Multiplication operator for the scalar product (inner product) of two vectors ( $ s=(\vec{a},\vec{b}) $). More...
 
template<typename T1 , typename T2 >
const MultTrait< typename
T1::ElementType, typename
T2::ElementType >::Type 
blaze::operator, (const Vector< T1, true > &lhs, const Vector< T2, true > &rhs)
 Multiplication operator for the scalar product (inner product) of two vectors ( $ s=(\vec{a},\vec{b}) $). More...
 
template<typename VT , bool TF>
std::ostream & blaze::operator<< (std::ostream &os, const Vector< VT, TF > &v)
 Global output operator for dense and sparse vectors. More...
 

Detailed Description

Function Documentation

template<typename VT1 , bool TF1, typename VT2 , bool TF2>
void blaze::addAssign ( Vector< VT1, TF1 > &  lhs,
const Vector< VT2, TF2 > &  rhs 
)
inline

Default implementation of the addition assignment of a vector to a vector.

Parameters
lhsThe target left-hand side vector.
rhsThe right-hand side vector to be added.
Returns
void

This function implements the default addition assignment of a vector to a vector.
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

template<typename VT1 , bool TF1, typename VT2 , bool TF2>
void blaze::assign ( Vector< VT1, TF1 > &  lhs,
const Vector< VT2, TF2 > &  rhs 
)
inline

Default implementation of the assignment of a vector to a vector.

Parameters
lhsThe target left-hand side vector.
rhsThe right-hand side vector to be assigned.
Returns
void

This function implements the default assignment of a vector to another vector.
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

template<typename VT , bool TF>
size_t blaze::capacity ( Vector< VT, TF > &  v)
inline

Returns the maximum capacity of the vector.

Parameters
vThe given vector.
Returns
The capacity of the vector.
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
bool blaze::isSame ( const Vector< VT1, TF1 > &  a,
const Vector< VT2, TF2 > &  b 
)
inline

Returns whether the two given vectors represent the same observable state.

Parameters
aThe first vector to be tested for its state.
bThe second vector to be tested for its state.
Returns
true in case the two vectors share a state, false otherwise.

The isSame function provides an abstract interface for testing if the two given vectors represent the same observable state. This happens for instance in case a and b refer to the same vector or in case a and b are aliases for the same vector. In case both vectors represent the same observable state, the function returns true, other it returns false.

typedef blaze::DynamicVector<int> VectorType;
typedef blaze::DenseSubvector<VectorType> SubvectorType;
VectorType vec1( 4UL ); // Setup of a 4-dimensional dynamic vector
VectorType vec2( 4UL ); // Setup of a second 4-dimensional dynamic vector
SubvectorType sub1 = subvector( vec1, 0UL, 4UL ); // Subvector of vec1 for the entire range
SubvectorType sub2 = subvector( vec1, 1UL, 2UL ); // Subvector of vec1 for the range [1..3]
SubvectorType sub3 = subvector( vec1, 1UL, 2UL ); // Second subvector of vec1 for the range [1..3]
isSame( vec1, vec1 ); // returns true since both objects refer to the same vector
isSame( vec1, vec2 ); // returns false since vec1 and vec2 are two different vectors
isSame( vec1, sub1 ); // returns true since sub1 represents the same observable state as vec1
isSame( vec1, sub3 ); // returns false since sub3 only covers part of the range of vec1
isSame( sub2, sub3 ); // returns true since sub1 and sub2 refer to exactly the same range of vec1
isSame( sub1, sub3 ); // returns false since sub1 and sub3 refer to different ranges of vec1
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
void blaze::multAssign ( Vector< VT1, TF1 > &  lhs,
const Vector< VT2, TF2 > &  rhs 
)
inline

Default implementation of the multiplication assignment of a vector to a vector.

Parameters
lhsThe target left-hand side vector.
rhsThe right-hand side vector to be multiplied.
Returns
void

This function implements the default multiplication assignment of a vector to a vector.
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

template<typename VT , bool TF>
size_t blaze::nonZeros ( Vector< VT, TF > &  v)
inline

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

Parameters
vThe given 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 T1 , typename T2 >
const MultTrait< typename T1::ElementType, typename T2::ElementType >::Type blaze::operator, ( const Vector< T1, false > &  lhs,
const Vector< T2, false > &  rhs 
)
inline

Multiplication operator for the scalar product (inner product) of two vectors ( $ s=(\vec{a},\vec{b}) $).

Parameters
lhsThe left-hand side vector for the inner product.
rhsThe right-hand side vector for the inner product.
Returns
The scalar product.
template<typename T1 , typename T2 >
const MultTrait< typename T1::ElementType, typename T2::ElementType >::Type blaze::operator, ( const Vector< T1, false > &  lhs,
const Vector< T2, true > &  rhs 
)
inline

Multiplication operator for the scalar product (inner product) of two vectors ( $ s=(\vec{a},\vec{b}) $).

Parameters
lhsThe left-hand side vector for the inner product.
rhsThe right-hand side vector for the inner product.
Returns
The scalar product.
template<typename T1 , typename T2 >
const MultTrait< typename T1::ElementType, typename T2::ElementType >::Type blaze::operator, ( const Vector< T1, true > &  lhs,
const Vector< T2, false > &  rhs 
)
inline

Multiplication operator for the scalar product (inner product) of two vectors ( $ s=(\vec{a},\vec{b}) $).

Parameters
lhsThe left-hand side vector for the inner product.
rhsThe right-hand side vector for the inner product.
Returns
The scalar product.
template<typename T1 , typename T2 >
const MultTrait< typename T1::ElementType, typename T2::ElementType >::Type blaze::operator, ( const Vector< T1, true > &  lhs,
const Vector< T2, true > &  rhs 
)
inline

Multiplication operator for the scalar product (inner product) of two vectors ( $ s=(\vec{a},\vec{b}) $).

Parameters
lhsThe left-hand side vector for the inner product.
rhsThe right-hand side vector for the inner product.
Returns
The scalar product.
template<typename VT , bool TF>
std::ostream & blaze::operator<< ( std::ostream &  os,
const Vector< VT, TF > &  v 
)
inline

Global output operator for dense and sparse vectors.

Parameters
osReference to the output stream.
vReference to a constant vector object.
Returns
Reference to the output stream.
template<typename VT , bool TF>
size_t blaze::size ( Vector< VT, TF > &  v)
inline

Returns the current size/dimension of the vector.

Parameters
vThe given vector.
Returns
The size of the vector.
template<typename VT1 , bool TF1, typename VT2 , bool TF2>
void blaze::subAssign ( Vector< VT1, TF1 > &  lhs,
const Vector< VT2, TF2 > &  rhs 
)
inline

Default implementation of the subtraction assignment of a vector to a vector.

Parameters
lhsThe target left-hand side vector.
rhsThe right-hand side vector to be subtracted.
Returns
void

This function implements the default subtraction assignment of a vector to a vector.
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.