|
using | This = ZeroVector< Type, TF, Tag > |
| Type of this ZeroVector instance.
|
|
using | BaseType = Expression< SparseVector< This, TF > > |
| Base type of this ZeroVector instance.
|
|
using | ResultType = This |
| Result type for expression template evaluations.
|
|
using | TransposeType = ZeroVector< Type,!TF, Tag > |
| Transpose type for expression template evaluations.
|
|
using | ElementType = Type |
| Type of the zero vector elements.
|
|
using | TagType = Tag |
| Tag type of this ZeroVector instance.
|
|
using | ReturnType = const Type & |
| Return type for expression template evaluations.
|
|
using | CompositeType = const This & |
| Data type for composite expression templates.
|
|
using | Reference = const Type & |
| Reference to a zero vector element.
|
|
using | ConstReference = const Type & |
| Reference to a constant zero vector element.
|
|
using | Iterator = Element * |
| Iterator over non-constant elements.
|
|
using | ConstIterator = const Element * |
| Iterator over constant elements.
|
|
using | VectorType = ZeroVector< Type, TF, Tag > |
| Type of the vector.
|
|
|
template<typename VT > |
ZeroVector< Type, TF, Tag > & | operator= (const Vector< VT, TF > &rhs) & |
| Assignment operator for different zero vectors. More...
|
|
|
constexpr | ZeroVector () noexcept |
| The default constructor for ZeroVector.
|
|
constexpr | ZeroVector (size_t size) noexcept |
| Constructor for a zero vector of size n. More...
|
|
template<typename VT > |
| ZeroVector (const Vector< VT, TF > &v) |
| Conversion constructor for different zero vectors. More...
|
|
| ZeroVector (const ZeroVector &)=default |
|
| ZeroVector (ZeroVector &&)=default |
|
|
| ~ZeroVector ()=default |
|
|
constexpr ConstReference | operator[] (size_t index) const noexcept |
| Subscript operator for the direct access to the zero vector elements. More...
|
|
ConstReference | at (size_t index) const |
| Checked access to the zero vector elements. More...
|
|
constexpr ConstIterator | begin () const noexcept |
| Returns an iterator to the first non-zero element of the zero vector. More...
|
|
constexpr ConstIterator | cbegin () const noexcept |
| Returns an iterator to the first non-zero element of the zero vector. More...
|
|
constexpr ConstIterator | end () const noexcept |
| Returns an iterator just past the last non-zero element of the zero vector. More...
|
|
constexpr ConstIterator | cend () const noexcept |
| Returns an iterator just past the last non-zero element of the zero vector. More...
|
|
|
template<typename VT > |
ZeroVector & | operator= (const Vector< VT, TF > &rhs) & |
|
ZeroVector & | operator= (const ZeroVector &) &=default |
|
ZeroVector & | operator= (ZeroVector &&) &=default |
|
|
constexpr size_t | size () const noexcept |
| Returns the current size/dimension of the zero vector. More...
|
|
constexpr size_t | capacity () const noexcept |
| Returns the maximum capacity of the zero vector. More...
|
|
constexpr size_t | nonZeros () const noexcept |
| Returns the number of non-zero elements in the zero vector. More...
|
|
constexpr void | clear () noexcept |
| Clearing the zero vector. More...
|
|
constexpr void | resize (size_t n) noexcept |
| Changing the size of the zero vector. More...
|
|
constexpr void | swap (ZeroVector &v) noexcept |
| Swapping the contents of two zero vectors. More...
|
|
|
ConstIterator | find (size_t index) const |
| Searches for a specific vector element. More...
|
|
ConstIterator | lowerBound (size_t index) const |
| Returns an iterator to the first index not less then the given index. More...
|
|
ConstIterator | upperBound (size_t index) const |
| Returns an iterator to the first index greater then the given index. 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...
|
|
|
BLAZE_ALWAYS_INLINE constexpr ZeroVector< Type, TF, Tag > & | operator~ () noexcept |
| CRTP-based conversion operation for non-constant vectors. More...
|
|
BLAZE_ALWAYS_INLINE constexpr const ZeroVector< Type, TF, Tag > & | operator~ () const noexcept |
| CRTP-based conversion operation for constant vectors. More...
|
|
constexpr ZeroVector< Type, TF, Tag > & | operator* () noexcept |
| CRTP-based conversion operation for non-constant vectors. More...
|
|
constexpr const ZeroVector< Type, TF, Tag > & | operator* () const noexcept |
| CRTP-based conversion operation for constant vectors. More...
|
|
template<typename Type, bool TF, typename Tag>
class blaze::ZeroVector< Type, TF, Tag >
Efficient implementation of an arbitrary sized zero vector.
The ZeroVector class template is the representation of an immutable, arbitrary sized zero vector with N elements of arbitrary type. The type of the elements, the transpose flag, and the group tag of the vector can be specified via the three template parameters:
namespace blaze {
template< typename Type, bool TF, typename Tag >
}
constexpr ZeroVector() noexcept
The default constructor for ZeroVector.
Definition: ZeroVector.h:361
- Type: specifies the type of the vector elements. ZeroVector can be used with any non-cv-qualified, non-reference, non-pointer element type.
- TF : specifies whether the vector is a row vector (blaze::rowVector) or a column vector (blaze::columnVector). The default value is blaze::defaultTransposeFlag.
- Tag : optional type parameter to tag the vector. The default type is blaze::Group0. See Grouping/Tagging for details.
It is not possible to insert, erase or modify the elements of a zero vector. It is only possible to read from the elements:
ZeroVector<double,columnVector> a( 4 );
a[1] = 2.0;
double d = a[2];
... = i->value();
... = i->index();
}
Efficient implementation of an arbitrary sized zero vector.
Definition: ZeroVector.h:183
Element * Iterator
Iterator over non-constant elements.
Definition: ZeroVector.h:207
constexpr bool columnVector
Transpose flag for column vectors.
Definition: TransposeFlag.h:58
The use of ZeroVector is very natural and intuitive. All operations (addition, subtraction, multiplication, ...) can be performed on all possible combinations of dense and sparse vectors with fitting element types. The following example gives an impression of the use of ZeroVector:
ZeroVector<double> z( 3 );
DynamicVector<double,columnMajor> a( 3 );
CompressedVector<double,rowMajor> b( 3 );
CompressedVector<float,rowMajor> c( 3 );
DynamicVector<double> d( z );
CompressedVector<double> e;
d = z + a;
d = b - z;
e = z * c;
d = 2.0 * z;
e = z * 2.0;
Efficient implementation of an arbitrary sized sparse vector.
Definition: CompressedVector.h:220
Efficient implementation of an arbitrary sized vector.
Definition: DynamicVector.h:223