|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE VT::Iterator | blaze::begin (Vector< VT, TF > &vector) |
| Returns an iterator to the first element of the given vector. More...
|
|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE VT::ConstIterator | blaze::begin (const Vector< VT, TF > &vector) |
| Returns an iterator to the first element of the given vector. More...
|
|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE VT::ConstIterator | blaze::cbegin (const Vector< VT, TF > &vector) |
| Returns an iterator to the first element of the given vector. More...
|
|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE VT::Iterator | blaze::end (Vector< VT, TF > &vector) |
| Returns an iterator just past the last element of the given vector. More...
|
|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE VT::ConstIterator | blaze::end (const Vector< VT, TF > &vector) |
| Returns an iterator just past the last element of the given vector. More...
|
|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE VT::ConstIterator | blaze::cend (const Vector< VT, TF > &vector) |
| Returns an iterator just past the last element of the given vector. More...
|
|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE size_t | blaze::size (const Vector< VT, TF > &vector) noexcept |
| Returns the current size/dimension of the vector. More...
|
|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE size_t | blaze::capacity (const Vector< VT, TF > &vector) noexcept |
| Returns the maximum capacity of the vector. More...
|
|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE size_t | blaze::nonZeros (const Vector< VT, TF > &vector) |
| Returns the number of non-zero elements in the vector. More...
|
|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE void | blaze::resize (Vector< VT, TF > &vector, size_t n, bool preserve) |
| Changing the size of the vector. More...
|
|
template<typename VT , bool TF> |
BLAZE_ALWAYS_INLINE void | blaze::shrinkToFit (Vector< VT, TF > &vector) |
| Requesting the removal of unused capacity. More...
|
|
template<typename VT , bool TF> |
const VT::ResultType | blaze::evaluate (const Vector< VT, TF > &vector) |
| Evaluates the given vector expression. More...
|
|
template<typename VT1 , bool TF1, typename VT2 , bool TF2> |
BLAZE_ALWAYS_INLINE bool | blaze::isSame (const Vector< VT1, TF1 > &a, const Vector< VT2, TF2 > &b) noexcept |
| Returns whether the two given vectors represent the same observable state. More...
|
|
|
template<typename T1 , typename T2 > |
const MultTrait_< ElementType_< T1 >, ElementType_< T2 > > | blaze::inner (const Vector< T1, false > &lhs, const Vector< T2, false > &rhs) |
| Multiplication operator for the scalar product (dot/inner product) of two vectors ( ). More...
|
|
template<typename T1 , typename T2 > |
const MultTrait_< ElementType_< T1 >, ElementType_< T2 > > | blaze::inner (const Vector< T1, false > &lhs, const Vector< T2, true > &rhs) |
| Multiplication operator for the scalar product (dot/inner product) of two vectors ( ). More...
|
|
template<typename T1 , typename T2 > |
const MultTrait_< ElementType_< T1 >, ElementType_< T2 > > | blaze::inner (const Vector< T1, true > &lhs, const Vector< T2, false > &rhs) |
| Multiplication operator for the scalar product (dot/inner product) of two vectors ( ). More...
|
|
template<typename T1 , typename T2 > |
const MultTrait_< ElementType_< T1 >, ElementType_< T2 > > | blaze::inner (const Vector< T1, true > &lhs, const Vector< T2, true > &rhs) |
| Multiplication operator for the scalar product (dot/inner product) of two vectors ( ). More...
|
|
template<typename T1 , bool TF1, typename T2 , bool TF2> |
const MultTrait_< ElementType_< T1 >, ElementType_< T2 > > | blaze::dot (const Vector< T1, TF1 > &lhs, const Vector< T2, TF2 > &rhs) |
| Multiplication operator for the scalar product (dot/inner product) of two vectors ( ). More...
|
|
template<typename T1 , bool TF1, typename T2 , bool TF2> |
const MultTrait_< ElementType_< T1 >, ElementType_< T2 > > | blaze::operator, (const Vector< T1, TF1 > &lhs, const Vector< T2, TF2 > &rhs) |
| Multiplication operator for the scalar product (dot/inner product) of two vectors ( ). More...
|
|
template<typename T1 , typename T2 > |
const MultTrait_< ElementType_< T1 >, ElementType_< T2 > > | blaze::outer (const Vector< T1, false > &lhs, const Vector< T2, false > &rhs) |
| Multiplication operator for the outer product of two vectors ( ). More...
|
|
template<typename T1 , typename T2 > |
const MultTrait_< ElementType_< T1 >, ElementType_< T2 > > | blaze::outer (const Vector< T1, false > &lhs, const Vector< T2, true > &rhs) |
| Multiplication operator for the outer product of two vectors ( ). More...
|
|
template<typename T1 , typename T2 > |
const MultTrait_< ElementType_< T1 >, ElementType_< T2 > > | blaze::outer (const Vector< T1, true > &lhs, const Vector< T2, false > &rhs) |
| Multiplication operator for the outer product of two vectors ( ). More...
|
|
template<typename T1 , typename T2 > |
const MultTrait_< ElementType_< T1 >, ElementType_< T2 > > | blaze::outer (const Vector< T1, true > &lhs, const Vector< T2, true > &rhs) |
| Multiplication operator for the outer product of two vectors ( ). 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...
|
|
template<typename VT , bool TF>
const VT::ResultType blaze::evaluate |
( |
const Vector< VT, TF > & |
vector | ) |
|
|
inline |
Evaluates the given vector expression.
- Parameters
-
vector | The vector to be evaluated. |
- Returns
- The result of the evaluated vector expression.
This function forces an evaluation of the given vector expression and enables an automatic deduction of the correct result type of an operation. The following code example demonstrates its intended use for the multiplication of a dense and a sparse vector:
In this scenario, the evaluate() function assists in deducing the exact result type of the operation via the 'auto' keyword. Please note that if evaluate() is used in this way, no temporary vector is created and no copy operation is performed. Instead, the result is directly written to the target vector due to the return value optimization (RVO). However, if evaluate() is used in combination with an explicit target type, a temporary will be created and a copy operation will be performed if the used type differs from the type returned from the function:
CompressedVector<double> d( a * b );
DynamicVector<double> e( a * b );
Sometimes it might be desirable to explicitly evaluate a sub-expression within a larger expression. However, please note that evaluate() is not intended to be used for this purpose. This task is more elegantly and efficiently handled by the eval() function:
In contrast to the evaluate() function, eval() can take the complete expression into account and therefore can guarantee the most efficient way to evaluate it.