27 #ifndef _H_GRB_VECTOR_BASE 28 #define _H_GRB_VECTOR_BASE 63 template<
typename D, enum Backend implementation,
typename C >
141 public std::iterator<
142 std::forward_iterator_tag,
143 std::pair< const size_t, const D >,
174 return std::pair< const size_t, const D >();
226 Vector(
const size_t n,
const size_t nz ) {
257 Vector(
const std::initializer_list< D > &vals ) {
413 const_iterator
end()
const {
505 typename fwd_iterator =
const D * __restrict__
509 const fwd_iterator start,
const fwd_iterator
end,
620 typename ind_iterator =
const size_t * __restrict__,
621 typename nnz_iterator =
const D * __restrict__,
626 const ind_iterator ind_start,
const ind_iterator ind_end,
627 const nnz_iterator nnz_start,
const nnz_iterator nnz_end,
628 const Dup &dup = Dup()
746 typename ind_iterator =
const size_t * __restrict__,
747 typename nnz_iterator =
const D * __restrict__,
753 const ind_iterator ind_start,
754 const ind_iterator ind_end,
755 const nnz_iterator nnz_start,
756 const nnz_iterator nnz_end,
757 const Dup &dup = Dup()
793 template<
typename T >
823 template<
typename T >
888 template<
class Mono
id >
943 #ifndef _GRB_NO_EXCEPTIONS 944 throw std::runtime_error(
945 "Requesting lambda reference of unimplemented Vector backend." 953 #endif // _H_GRB_VECTOR_BASE D & lambda_reference
Defines a reference to a value of type D.
Definition: vector.hpp:124
Defines the ALP error codes.
This file contains a register of all backends that are either implemented, under implementation,...
RC
Return codes of ALP primitives.
Definition: rc.hpp:47
A GraphBLAS vector.
Definition: vector.hpp:64
RC nnz(T &nnz) const
Return the number of nonzeroes in this vector.
Definition: vector.hpp:824
Vector(Vector< D, implementation, C > &&x) noexcept
Move constructor.
Definition: vector.hpp:281
static constexpr Descriptor no_operation
Indicates no additional pre- or post-processing on any of the GraphBLAS function arguments.
Definition: descriptors.hpp:63
RC build(const Accum &accum, const fwd_iterator start, const fwd_iterator end, fwd_iterator npos)
Copy from raw user-supplied data into a vector.
Definition: vector.hpp:507
unsigned int Descriptor
Descriptors indicate pre- or post-processing for some or all of the arguments to an ALP/GraphBLAS cal...
Definition: descriptors.hpp:54
A standard iterator for the Vector< D > class.
Definition: vector.hpp:140
const_iterator cbegin() const
Provides the only mechanism to extract data from this GraphBLAS vector.
Definition: vector.hpp:362
RC build(const Accum &accum, const ind_iterator ind_start, const ind_iterator ind_end, const nnz_iterator nnz_start, const nnz_iterator nnz_end, const Dup &dup=Dup())
Copy from raw user-supplied data into a vector.
Definition: vector.hpp:624
const_iterator begin() const
Same as cbegin().
Definition: vector.hpp:373
const_iterator & operator++()
Advances the position of this iterator by one.
Definition: vector.hpp:190
lambda_reference operator()(const size_t i, const Monoid &monoid=Monoid())
Returns a lambda reference to an element of this sparse vector.
Definition: vector.hpp:889
const_iterator end() const
Same as cend().
Definition: vector.hpp:413
Vector(const size_t n)
Creates an ALP/GraphBLAS vector.
Definition: vector.hpp:235
~Vector()
Default destructor.
Definition: vector.hpp:329
Defines all ALP/GraphBLAS descriptors.
RC build(const Vector< mask_type, implementation, C > &mask, const Accum &accum, const ind_iterator ind_start, const ind_iterator ind_end, const nnz_iterator nnz_start, const nnz_iterator nnz_end, const Dup &dup=Dup())
Copy from raw user-supplied data into a vector.
Definition: vector.hpp:750
Vector< D, implementation, C > & operator=(Vector< D, implementation, C > &&x) noexcept
Move-from-temporary assignment.
Definition: vector.hpp:300
This operator discards all left-hand side input and simply copies the right-hand side input to the ou...
Definition: ops.hpp:115
const_iterator cend() const
Indicates the end to the elements in this container.
Definition: vector.hpp:402
The ALP/GraphBLAS namespace.
Definition: graphblas.hpp:477
Vector(const size_t n, const size_t nz)
Creates an ALP/GraphBLAS vector.
Definition: vector.hpp:226
Generic fatal error code.
Definition: rc.hpp:68
bool operator==(const const_iterator &other) const
Standard equals operator.
Definition: vector.hpp:151
RC size(T &size) const
Return the dimension of this vector.
Definition: vector.hpp:794
D value_type
The type of elements stored in this vector.
Definition: vector.hpp:69
bool operator!=(const const_iterator &other) const
Definition: vector.hpp:157
lambda_reference operator[](const size_t i)
Returns a lambda reference to an element of this vector.
Definition: vector.hpp:941
std::pair< const size_t, const D > operator*() const
Dereferences the current position of this iterator.
Definition: vector.hpp:173
Provides a set of standard binary operators.
Vector(const std::initializer_list< D > &vals)
Creates a dense ALP/GraphBLAS vector.
Definition: vector.hpp:257
A generalised monoid.
Definition: monoid.hpp:54