![]() |
Expression object for the transposition of a sparse vector.The SVecTransposer class is a wrapper object for the temporary transposition of a sparse vector. More...
#include <SVecTransposer.h>
Inherits blaze::SparseVector< SVecTransposer< VT, TF >, TF >.
Public Types | |
enum | : bool { smpAssignable = VT::smpAssignable } |
Compilation flag for SMP assignments. More... | |
using | This = SVecTransposer< VT, TF > |
Type of this SVecTransposer instance. | |
using | ResultType = TransposeType_< VT > |
Result type for expression template evaluations. | |
using | TransposeType = ResultType_< VT > |
Transpose type for expression template evaluations. | |
using | ElementType = ElementType_< VT > |
Resulting element type. | |
using | ReturnType = ReturnType_< VT > |
Return type for expression template evaluations. | |
using | CompositeType = const This & |
Data type for composite expression templates. | |
using | Reference = Reference_< VT > |
Reference to a non-constant matrix value. | |
using | ConstReference = ConstReference_< VT > |
Reference to a constant matrix value. | |
using | Iterator = Iterator_< VT > |
Iterator over non-constant elements. | |
using | ConstIterator = ConstIterator_< VT > |
Iterator over constant elements. | |
using | VectorType = SVecTransposer< VT, TF > |
Type of the vector. | |
Public Member Functions | |
SVecTransposer (VT &sv) noexcept | |
Constructor for the SVecTransposer class. More... | |
ConstReference | operator[] (size_t index) const |
Subscript operator for the direct access to the vector elements. More... | |
ConstReference | at (size_t index) const |
Checked access to the vector elements. More... | |
Iterator | begin () |
Returns an iterator to the first non-zero element of the sparse vector. More... | |
ConstIterator | begin () const |
Returns an iterator to the first non-zero element of the sparse vector. More... | |
ConstIterator | cbegin () const |
Returns an iterator to the first non-zero element of the sparse vector. More... | |
Iterator | end () |
Returns an iterator just past the last non-zero element of the sparse vector. More... | |
ConstIterator | end () const |
Returns an iterator just past the last non-zero element of the sparse vector. More... | |
ConstIterator | cend () const |
Returns an iterator just past the last non-zero element of the sparse vector. More... | |
size_t | size () const noexcept |
Returns the current size/dimension of the vector. More... | |
size_t | capacity () const noexcept |
Returns the maximum capacity of the vector. More... | |
size_t | nonZeros () const |
Returns the number of non-zero elements in the vector. More... | |
void | reset () |
Resets the vector elements. More... | |
Iterator | insert (size_t index, const ElementType &value) |
Inserting an element into the sparse vector. More... | |
Iterator | find (size_t index) |
Inserting an element into the sparse vector. More... | |
void | reserve (size_t nonzeros) |
Setting the minimum capacity of the sparse vector. More... | |
void | append (size_t index, const ElementType &value, bool check=false) |
Appending an element to the sparse vector. More... | |
bool | isIntact () const noexcept |
Returns whether the invariants of the vector are intact. More... | |
template<typename Other > | |
bool | canAlias (const Other *alias) const noexcept |
Returns whether the vector can alias with the given address alias. More... | |
template<typename Other > | |
bool | isAliased (const Other *alias) const noexcept |
Returns whether the vector is aliased with the given address alias. More... | |
bool | canSMPAssign () const noexcept |
Returns whether the vector can be used in SMP assignments. More... | |
template<typename VT2 > | |
void | assign (const Vector< VT2, TF > &rhs) |
Implementation of the transpose assignment of a vector. More... | |
BLAZE_ALWAYS_INLINE VectorType & | operator~ () noexcept |
Conversion operator for non-constant vectors. More... | |
BLAZE_ALWAYS_INLINE const VectorType & | operator~ () const noexcept |
Conversion operator for constant vectors. More... | |
Private Member Functions | |
size_t | extendCapacity () const noexcept |
Calculating a new vector capacity. More... | |
Private Attributes | |
VT & | sv_ |
The sparse vector operand. | |
Expression object for the transposition of a sparse vector.
The SVecTransposer class is a wrapper object for the temporary transposition of a sparse vector.
anonymous enum : bool |
Compilation flag for SMP assignments.
The smpAssignable compilation flag indicates whether the vector can be used in SMP (shared memory parallel) assignments (both on the left-hand and right-hand side of the assignment).
|
inlineexplicitnoexcept |
Constructor for the SVecTransposer class.
sv | The sparse vector operand. |
|
inline |
Appending an element to the sparse vector.
index | The index of the new element. The index has to be in the range ![]() |
value | The value of the element to be appended. |
check | true if the new value should be checked for default values, false if not. |
This function provides a very efficient way to fill a sparse vector with elements. It appends a new element to the end of the sparse vector without any additional memory allocation. Therefore it is strictly necessary to keep the following preconditions in mind:
Ignoring these preconditions might result in undefined behavior! The optional check parameter specifies whether the new value should be tested for a default value. If the new value is a default value (for instance 0 in case of an integral element type) the value is not appended. Per default the values are not tested.
|
inline |
Implementation of the transpose assignment of a vector.
rhs | The right-hand side vector to be assigned. |
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.
|
inline |
Checked access to the vector elements.
index | Access index. The index has to be in the range ![]() |
std::out_of_range | Invalid vector access index. |
|
inline |
Returns an iterator to the first non-zero element of the sparse vector.
|
inline |
Returns an iterator to the first non-zero element of the sparse vector.
|
inlinenoexcept |
Returns whether the vector can alias with the given address alias.
alias | The alias to be checked. |
|
inlinenoexcept |
Returns whether the vector can be used in SMP assignments.
|
inlinenoexcept |
Returns the maximum capacity of the vector.
|
inline |
Returns an iterator to the first non-zero element of the sparse vector.
|
inline |
Returns an iterator just past the last non-zero element of the sparse vector.
|
inline |
Returns an iterator just past the last non-zero element of the sparse vector.
|
inline |
Returns an iterator just past the last non-zero element of the sparse vector.
|
inlineprivatenoexcept |
Calculating a new vector capacity.
This function calculates a new vector capacity based on the current capacity of the sparse vector. Note that the new capacity is restricted to the interval .
|
inline |
Inserting an element into the sparse vector.
index | The index of the search element. The index has to be in the range ![]() |
This function can be used to check whether a specific element is contained in the sparse vector. It specifically searches for the element with index index. In case the element is found, the function returns an iterator to the element. Otherwise an iterator just past the last non-zero element of the sparse vector (the end() iterator) is returned. Note that the returned sparse vector iterator is subject to invalidation due to inserting operations via the subscript operator or the insert() function!
|
inline |
Inserting an element into the sparse vector.
index | The index of the new element. The index has to be in the range ![]() |
value | The value of the element to be inserted. |
std::invalid_argument | Invalid sparse vector access index. |
This function inserts a new element into the sparse vector. However, duplicate elements are not allowed. In case the sparse matrix already contains an element with row index index, a std::invalid_argument exception is thrown.
|
inlinenoexcept |
Returns whether the vector is aliased with the given address alias.
alias | The alias to be checked. |
|
inlinenoexcept |
Returns whether the invariants of the vector are intact.
|
inline |
Returns the number of non-zero elements in the vector.
|
inline |
Subscript operator for the direct access to the vector elements.
index | Access index. The index has to be in the range ![]() |
|
inlinenoexceptinherited |
Conversion operator for non-constant vectors.
|
inlinenoexceptinherited |
Conversion operator for constant vectors.
|
inline |
Setting the minimum capacity of the sparse vector.
nonzeros | The new minimum capacity of the sparse vector. |
This function increases the capacity of the sparse vector to at least nonzeros elements. The current values of the vector elements are preserved.
|
inline |
Resets the vector elements.
|
inlinenoexcept |
Returns the current size/dimension of the vector.