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 ) {
483 typename fwd_iterator =
const D * __restrict__
487 const fwd_iterator start,
const fwd_iterator
end,
598 typename ind_iterator =
const size_t * __restrict__,
599 typename nnz_iterator =
const D * __restrict__,
604 const ind_iterator ind_start,
const ind_iterator ind_end,
605 const nnz_iterator nnz_start,
const nnz_iterator nnz_end,
606 const Dup &dup = Dup()
724 typename ind_iterator =
const size_t * __restrict__,
725 typename nnz_iterator =
const D * __restrict__,
731 const ind_iterator ind_start,
732 const ind_iterator ind_end,
733 const nnz_iterator nnz_start,
734 const nnz_iterator nnz_end,
735 const Dup &dup = Dup()
771 template<
typename T >
801 template<
typename T >
866 template<
class Mono
id >
921 #ifndef _GRB_NO_EXCEPTIONS
922 throw std::runtime_error(
923 "Requesting lambda reference of unimplemented Vector backend."
This file contains a register of all backends that are either implemented, under implementation,...
A generalised monoid.
Definition: monoid.hpp:54
A standard iterator for the Vector< D > class.
Definition: vector.hpp:146
bool operator!=(const const_iterator &other) const
Definition: vector.hpp:157
std::pair< const size_t, const D > operator*() const
Dereferences the current position of this iterator.
Definition: vector.hpp:173
bool operator==(const const_iterator &other) const
Standard equals operator.
Definition: vector.hpp:151
const_iterator & operator++()
Advances the position of this iterator by one.
Definition: vector.hpp:190
A GraphBLAS vector.
Definition: vector.hpp:64
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:728
Vector(const size_t n)
Creates an ALP/GraphBLAS vector.
Definition: vector.hpp:235
Vector(Vector< D, implementation, C > &&x) noexcept
Move constructor.
Definition: vector.hpp:259
D value_type
The type of elements stored in this vector.
Definition: vector.hpp:69
const_iterator begin() const
Same as cbegin().
Definition: vector.hpp:351
const_iterator cbegin() const
Provides the only mechanism to extract data from this GraphBLAS vector.
Definition: vector.hpp:340
RC nnz(T &nnz) const
Return the number of nonzeroes in this vector.
Definition: vector.hpp:802
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:602
const_iterator cend() const
Indicates the end to the elements in this container.
Definition: vector.hpp:380
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:867
RC size(T &size) const
Return the dimension of this vector.
Definition: vector.hpp:772
Vector(const size_t n, const size_t nz)
Creates an ALP/GraphBLAS vector.
Definition: vector.hpp:226
~Vector()
Default destructor.
Definition: vector.hpp:307
lambda_reference operator[](const size_t i)
Returns a lambda reference to an element of this vector.
Definition: vector.hpp:919
Vector< D, implementation, C > & operator=(Vector< D, implementation, C > &&x) noexcept
Move-from-temporary assignment.
Definition: vector.hpp:278
const_iterator end() const
Same as cend().
Definition: vector.hpp:391
D & lambda_reference
Defines a reference to a value of type D.
Definition: vector.hpp:124
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:485
This operator discards all left-hand side input and simply copies the right-hand side input to the ou...
Definition: ops.hpp:117
Defines all ALP/GraphBLAS descriptors.
static constexpr Descriptor no_operation
Indicates no additional pre- or post-processing on any of the GraphBLAS function arguments.
Definition: descriptors.hpp:63
The ALP/GraphBLAS namespace.
Definition: graphblas.hpp:452
RC
Return codes of ALP primitives.
Definition: rc.hpp:47
@ PANIC
Generic fatal error code.
Definition: rc.hpp:68
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
Provides a set of standard binary operators.
Defines the ALP error codes.