![]() |
Modules | |
Dense Vectors | |
Sparse Vectors | |
Classes | |
struct | blaze::Vector< VT, TF > |
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... | |
Vector global functions | |
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 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... | |
Vector operators | |
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 ( ![]() | |
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 ( ![]() | |
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 ( ![]() | |
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 ( ![]() | |
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 ( ![]() | |
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 ( ![]() | |
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 ( ![]() | |
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 ( ![]() | |
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 ( ![]() | |
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 ( ![]() | |
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... | |
BLAZE_ALWAYS_INLINE VT::Iterator blaze::begin | ( | Vector< VT, TF > & | vector | ) |
Returns an iterator to the first element of the given vector.
vector | The given dense or sparse vector. |
BLAZE_ALWAYS_INLINE VT::ConstIterator blaze::begin | ( | const Vector< VT, TF > & | vector | ) |
Returns an iterator to the first element of the given vector.
vector | The given dense or sparse vector. |
|
noexcept |
Returns the maximum capacity of the vector.
vector | The given vector. |
BLAZE_ALWAYS_INLINE VT::ConstIterator blaze::cbegin | ( | const Vector< VT, TF > & | vector | ) |
Returns an iterator to the first element of the given vector.
vector | The given dense or sparse vector. |
BLAZE_ALWAYS_INLINE VT::ConstIterator blaze::cend | ( | const Vector< VT, TF > & | vector | ) |
Returns an iterator just past the last element of the given vector.
vector | The given dense or sparse vector. |
|
inline |
Multiplication operator for the scalar product (dot/inner product) of two vectors ( ).
lhs | The left-hand side vector for the scalar product. |
rhs | The right-hand side vector for the scalar product. |
BLAZE_ALWAYS_INLINE VT::Iterator blaze::end | ( | Vector< VT, TF > & | vector | ) |
Returns an iterator just past the last element of the given vector.
vector | The given dense or sparse vector. |
BLAZE_ALWAYS_INLINE VT::ConstIterator blaze::end | ( | const Vector< VT, TF > & | vector | ) |
Returns an iterator just past the last element of the given vector.
vector | The given dense or sparse vector. |
|
inline |
Multiplication operator for the scalar product (dot/inner product) of two vectors ( ).
lhs | The left-hand side vector for the scalar product. |
rhs | The right-hand side vector for the scalar product. |
|
inline |
Multiplication operator for the scalar product (dot/inner product) of two vectors ( ).
lhs | The left-hand side vector for the scalar product. |
rhs | The right-hand side vector for the scalar product. |
|
inline |
Multiplication operator for the scalar product (dot/inner product) of two vectors ( ).
lhs | The left-hand side vector for the scalar product. |
rhs | The right-hand side vector for the scalar product. |
|
inline |
Multiplication operator for the scalar product (dot/inner product) of two vectors ( ).
lhs | The left-hand side vector for the scalar product. |
rhs | The right-hand side vector for the scalar product. |
|
noexcept |
Returns whether the two given vectors represent the same observable state.
a | The first vector to be tested for its state. |
b | The second vector to be tested for its state. |
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.
BLAZE_ALWAYS_INLINE size_t blaze::nonZeros | ( | const Vector< VT, TF > & | vector | ) |
Returns the number of non-zero elements in the vector.
vector | The given vector. |
Note that the number of non-zero elements is always less than or equal to the current size of the vector.
|
inline |
Multiplication operator for the scalar product (dot/inner product) of two vectors ( ).
lhs | The left-hand side vector for the scalar product. |
rhs | The right-hand side vector for the scalar product. |
|
inline |
Global output operator for dense and sparse vectors.
os | Reference to the output stream. |
v | Reference to a constant vector object. |
|
inline |
Multiplication operator for the outer product of two vectors ( ).
lhs | The left-hand side vector for the outer product. |
rhs | The right-hand side vector for the outer product. |
|
inline |
Multiplication operator for the outer product of two vectors ( ).
lhs | The left-hand side vector for the outer product. |
rhs | The right-hand side vector for the outer product. |
|
inline |
Multiplication operator for the outer product of two vectors ( ).
lhs | The left-hand side vector for the outer product. |
rhs | The right-hand side vector for the outer product. |
|
inline |
Multiplication operator for the outer product of two vectors ( ).
lhs | The left-hand side vector for the outer product. |
rhs | The right-hand side vector for the outer product. |
BLAZE_ALWAYS_INLINE void blaze::resize | ( | Vector< VT, TF > & | vector, |
size_t | n, | ||
bool | preserve | ||
) |
Changing the size of the vector.
vector | The given vector to be resized. |
n | The new size of the vector. |
preserve | true if the old values of the vector should be preserved, false if not. |
std::invalid_argument | Vector cannot be resized. |
This function provides a unified interface to resize dense and sparse vectors. In contrast to the resize()
member function, which is only available on resizable vector types, this function can be used on both resizable and non-resizable vectors. In case the given vector type VT is resizable (i.e. provides a resize()
function), the type-specific resize()
member function is called. Depending on the type VT, this may result in the allocation of new dynamic memory and the invalidation of existing views (subvectors, ...). In case VT is non-resizable (i.e. does not provide a resize()
function) and if the specified size is not identical to the current size of the vector, a std::invalid_argument exception is thrown.
|
noexcept |
Returns the current size/dimension of the vector.
vector | The given vector. |