![]() |
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 | { smpAssignable = VT::smpAssignable } |
Compilation flag for SMP assignments. More... | |
typedef SVecTransposer< VT, TF > | This |
Type of this SVecTransposer instance. | |
typedef VT::TransposeType | ResultType |
Result type for expression template evaluations. | |
typedef VT::ResultType | TransposeType |
Transpose type for expression template evaluations. | |
typedef VT::ElementType | ElementType |
Resulting element type. | |
typedef VT::ReturnType | ReturnType |
Return type for expression template evaluations. | |
typedef const This & | CompositeType |
Data type for composite expression templates. | |
typedef VT::Reference | Reference |
Reference to a non-constant matrix value. | |
typedef VT::ConstReference | ConstReference |
Reference to a constant matrix value. | |
typedef VT::Iterator | Iterator |
Iterator over non-constant elements. | |
typedef VT::ConstIterator | ConstIterator |
Iterator over constant elements. | |
typedef SVecTransposer< VT, TF > | VectorType |
Type of the vector. | |
Public Member Functions | |
SVecTransposer (VT &sv) | |
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... | |
template<typename Other > | |
EnableIf< IsNumeric< Other >, SVecTransposer >::Type & | operator*= (Other rhs) |
Multiplication assignment operator for the multiplication between a vector and a scalar value ( ![]() | |
template<typename Other > | |
EnableIf< IsNumeric< Other >, SVecTransposer >::Type & | operator/= (Other rhs) |
Division assignment operator for the division of a vector by a scalar value ( ![]() | |
size_t | size () const |
Returns the current size/dimension of 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... | |
template<typename Other > | |
bool | canAlias (const Other *alias) const |
Returns whether the vector can alias with the given address alias. More... | |
template<typename Other > | |
bool | isAliased (const Other *alias) const |
Returns whether the vector is aliased with the given address alias. More... | |
bool | canSMPAssign () const |
Returns whether the vector can be used in SMP assignments. More... | |
template<typename VT2 > | |
void | assign (const DenseVector< VT2, TF > &rhs) |
Implementation of the transpose assignment of a dense vector. More... | |
template<typename VT2 > | |
void | assign (const SparseVector< VT2, TF > &rhs) |
Implementation of the transpose assignment of a sparse vector. More... | |
BLAZE_ALWAYS_INLINE VectorType & | operator~ () |
Conversion operator for non-constant vectors. More... | |
BLAZE_ALWAYS_INLINE const VectorType & | operator~ () const |
Conversion operator for constant vectors. More... | |
Private Member Functions | |
size_t | extendCapacity () const |
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 |
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).
|
inlineexplicit |
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 dense vector.
rhs | The right-hand side dense 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 |
Implementation of the transpose assignment of a sparse vector.
rhs | The right-hand side sparse 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.
|
inline |
Returns whether the vector can alias with the given address alias.
alias | The alias to be checked. |
|
inline |
Returns whether the vector can be used in SMP assignments.
|
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.
|
inlineprivate |
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.
|
inline |
Returns whether the vector is aliased with the given address alias.
alias | The alias to be checked. |
|
inline |
Multiplication assignment operator for the multiplication between a vector and a scalar value ( ).
rhs | The right-hand side scalar value for the multiplication. |
|
inline |
Division assignment operator for the division of a vector by a scalar value ( ).
rhs | The right-hand side scalar value for the division. |
|
inline |
Subscript operator for the direct access to the vector elements.
index | Access index. The index has to be in the range ![]() |
|
inlineinherited |
Conversion operator for non-constant vectors.
|
inlineinherited |
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.
|
inline |
Returns the current size/dimension of the vector.