36#include <graphblas/SynchronizedNonzeroIterator.hpp>
37#include <graphblas/utils/iterators/type_traits.hpp>
154 typename ElementType,
typename Coords,
155 Backend implementation = config::default_backend
162 const bool this_is_an_invalid_default_implementation =
false;
164 assert( this_is_an_invalid_default_implementation );
165 return static_cast< uintptr_t
>(-1);
175 typename ElementType,
typename RIT,
typename CIT,
typename NIT,
176 Backend implementation = config::default_backend
183 const bool this_is_an_invalid_default_implementation =
false;
185 assert( this_is_an_invalid_default_implementation );
186 return static_cast< uintptr_t
>(-1);
233 Backend backend,
typename Coords
237 const bool may_not_call_base_size =
false;
240 assert( may_not_call_base_size );
283 typename InputType,
Backend backend,
284 typename RIT,
typename CIT,
typename NIT
290 const bool may_not_call_base_nrows =
false;
293 assert( may_not_call_base_nrows );
336 typename InputType,
Backend backend,
337 typename RIT,
typename CIT,
typename NIT
343 const bool may_not_call_base_ncols =
false;
346 assert( may_not_call_base_ncols );
386 typename InputType,
Backend backend,
typename Coords
390 const bool should_not_call_base_vector_capacity =
false;
392 assert( should_not_call_base_vector_capacity );
429 typename InputType,
Backend backend,
430 typename RIT,
typename CIT,
typename NIT
436 const bool should_not_call_base_matrix_capacity =
false;
438 assert( should_not_call_base_matrix_capacity );
478 template<
typename DataType, Backend backend,
typename Coords >
481 const bool should_not_call_base_vector_nnz =
false;
484 assert( should_not_call_base_vector_nnz );
520 typename InputType,
Backend backend,
521 typename RIT,
typename CIT,
typename NIT
527 const bool should_not_call_base_matrix_nnz =
false;
530 assert( should_not_call_base_matrix_nnz );
573 template<
typename DataType, Backend backend,
typename Coords >
576 const bool should_not_call_base_vector_clear =
false;
579 assert( should_not_call_base_vector_clear );
619 typename InputType,
Backend backend,
620 typename RIT,
typename CIT,
typename NIT
626 const bool should_not_call_base_matrix_clear =
false;
629 assert( should_not_call_base_matrix_clear );
701 Backend backend,
typename Coords
708 const bool should_not_call_base_vector_resize =
false;
712 assert( should_not_call_base_vector_resize );
783 typename InputType,
Backend backend,
784 typename RIT,
typename CIT,
typename NIT
790 const bool should_not_call_base_matrix_resize =
false;
794 assert( should_not_call_base_matrix_resize );
854 typename DataType,
typename T,
855 typename Coords,
Backend backend
860 const typename std::enable_if<
863 void >::type *
const =
nullptr
866 const bool should_not_call_base_vector_set =
false;
867 assert( should_not_call_base_vector_set );
938 typename DataType,
typename MaskType,
typename T,
939 Backend backend,
typename Coords
946 const typename std::enable_if<
948 void >::type *
const =
nullptr
951 const bool should_not_call_base_masked_vector_set =
false;
952 assert( should_not_call_base_masked_vector_set );
995 typename OutputType,
typename InputType,
996 Backend backend,
typename Coords
1004 const bool should_not_call_base_vector_set_copy =
false;
1005 assert( should_not_call_base_vector_set_copy );
1056 typename OutputType,
typename MaskType,
typename InputType,
1057 Backend backend,
typename Coords
1067 void >::type *
const =
nullptr
1070 const bool should_not_call_base_vector_set_copy_masked =
false;
1071 assert( should_not_call_base_vector_set_copy_masked );
1125 typename DataType,
typename T,
1126 Backend backend,
typename Coords
1136 const bool should_not_call_base_setElement =
false;
1137 assert( should_not_call_base_setElement );
1154 typename InputType,
typename fwd_iterator,
1155 Backend backend,
typename Coords
1159 fwd_iterator start,
const fwd_iterator end,
1163 return buildVector< descr >( x, accum, start, end, mode );
1175 class Merger = operators::right_assign< InputType >,
1176 typename fwd_iterator1,
typename fwd_iterator2,
1177 Backend backend,
typename Coords
1180 fwd_iterator1 ind_start,
const fwd_iterator1 ind_end,
1181 fwd_iterator2 val_start,
const fwd_iterator2 val_end,
1182 const IOMode mode,
const Merger & merger = Merger()
1185 return buildVector< descr >( x, accum, ind_start, ind_end, val_start, val_end,
1223 class Merger = operators::right_assign< InputType >,
1224 typename fwd_iterator1,
typename fwd_iterator2,
1225 Backend backend,
typename Coords
1229 fwd_iterator1 ind_start,
const fwd_iterator1 ind_end,
1230 fwd_iterator2 val_start,
const fwd_iterator2 val_end,
1233 return buildVector< descr | descriptors::no_duplicates >(
1330 typename fwd_iterator1 =
const size_t * __restrict__,
1331 typename fwd_iterator2 =
const size_t * __restrict__,
1332 typename fwd_iterator3 =
const InputType * __restrict__,
1333 Backend implementation = config::default_backend
1337 fwd_iterator1 I,
const fwd_iterator1 I_end,
1338 fwd_iterator2 J,
const fwd_iterator2 J_end,
1339 fwd_iterator3 V,
const fwd_iterator3 V_end,
1343 auto start = internal::makeSynchronized(
1347 const auto end = internal::makeSynchronized(
1348 I_end, J_end, V_end,
1352 return buildMatrixUnique< descr >( A, start, end, mode );
1362 typename fwd_iterator1 =
const size_t * __restrict__,
1363 typename fwd_iterator2 =
const size_t * __restrict__,
1364 typename fwd_iterator3 =
const InputType * __restrict__,
1365 Backend implementation = config::default_backend
1369 fwd_iterator1 I, fwd_iterator2 J, fwd_iterator3 V,
1370 const size_t nz,
const IOMode mode
1372 return buildMatrixUnique< descr >(
1387 typename InputType,
typename RIT,
typename CIT,
typename NIT,
1388 typename fwd_iterator1 =
const size_t * __restrict__,
1389 typename fwd_iterator2 =
const size_t * __restrict__,
1390 typename length_type = size_t,
1391 Backend implementation = config::default_backend
1395 fwd_iterator1 I, fwd_iterator2 J,
1396 const length_type nz,
const IOMode mode
1399 auto start = internal::makeSynchronized( I, J, I + nz, J + nz );
1400 const auto end = internal::makeSynchronized(
1401 I + nz, J + nz, I + nz, J + nz );
1403 return buildMatrixUnique< descr >( A, start, end, mode );
1449 typename InputType,
typename RIT,
typename CIT,
typename NIT,
1450 typename fwd_iterator,
1451 Backend implementation = config::default_backend
1455 fwd_iterator start,
const fwd_iterator end,
1463 std::cerr <<
"Should not call base grb::buildMatrixUnique" << std::endl;
1464 const bool should_not_call_base_buildMatrixUnique =
false;
1465 assert( should_not_call_base_buildMatrixUnique );
1516 template< Backend backend = config::default_backend >
1519 const bool should_not_call_base_wait =
false;
1520 assert( should_not_call_base_wait );
1551 Backend backend,
typename InputType,
typename Coords,
1556 const Args &... args
1559 const bool should_not_call_base_vector_wait =
false;
1560 assert( should_not_call_base_vector_wait );
1563 return wait( args... );
1593 typename InputType,
typename RIT,
typename CIT,
typename NIT,
1598 const Args &... args
1601 const bool should_not_call_base_matrix_wait =
false;
1602 assert( should_not_call_base_matrix_wait );
1605 return wait( args... );
An ALP/GraphBLAS matrix.
Definition: matrix.hpp:71
A GraphBLAS vector.
Definition: vector.hpp:64
This operator discards all left-hand side input and simply copies the right-hand side input to the ou...
Definition: ops.hpp:116
RC buildVectorUnique(Vector< InputType, backend, Coords > &x, fwd_iterator1 ind_start, const fwd_iterator1 ind_end, fwd_iterator2 val_start, const fwd_iterator2 val_end, const IOMode mode)
Ingests a set of nonzeroes into a given vector x.
Definition: io.hpp:1227
RC buildVector(Vector< InputType, backend, Coords > &x, fwd_iterator start, const fwd_iterator end, const IOMode mode)
Constructs a dense vector from a container of exactly grb::size(x) elements.
Definition: io.hpp:1157
RC wait()
Depending on the backend, ALP/GraphBLAS primitives may be non-blocking, meaning that the operation im...
Definition: io.hpp:1517
uintptr_t getID(const Vector< ElementType, implementation, Coords > &x)
Function that returns a unique ID for a given non-empty container.
Definition: io.hpp:157
RC resize(Vector< InputType, backend, Coords > &x, const size_t new_nz) noexcept
Resizes the nonzero capacity of this vector.
Definition: io.hpp:703
size_t capacity(const Vector< InputType, backend, Coords > &x) noexcept
Queries the capacity of the given ALP/GraphBLAS container.
Definition: io.hpp:388
RC buildMatrixUnique(Matrix< InputType, implementation > &A, fwd_iterator1 I, const fwd_iterator1 I_end, fwd_iterator2 J, const fwd_iterator2 J_end, fwd_iterator3 V, const fwd_iterator3 V_end, const IOMode mode)
Assigns nonzeroes to the matrix from a coordinate format.
Definition: io.hpp:1335
RC set(Vector< DataType, backend, Coords > &x, const T val, const Phase &phase=EXECUTE, const typename std::enable_if< !grb::is_object< DataType >::value &&!grb::is_object< T >::value, void >::type *const =nullptr) noexcept
Sets all elements of a vector to the given value.
Definition: io.hpp:857
RC setElement(Vector< DataType, backend, Coords > &x, const T val, const size_t i, const Phase &phase=EXECUTE, const typename std::enable_if< !grb::is_object< DataType >::value &&!grb::is_object< T >::value, void >::type *const =nullptr)
Sets the element of a given vector at a given position to a given value.
Definition: io.hpp:1128
size_t nrows(const Matrix< InputType, backend, RIT, CIT, NIT > &A) noexcept
Requests the row size of a given matrix.
Definition: io.hpp:286
size_t nnz(const Vector< DataType, backend, Coords > &x) noexcept
Request the number of nonzeroes in a given vector.
Definition: io.hpp:479
size_t ncols(const Matrix< InputType, backend, RIT, CIT, NIT > &A) noexcept
Requests the column size of a given matrix.
Definition: io.hpp:339
RC clear(Vector< DataType, backend, Coords > &x) noexcept
Clears a given vector of all nonzeroes.
Definition: io.hpp:574
size_t size(const Vector< DataType, backend, Coords > &x) noexcept
Request the size of a given vector.
Definition: io.hpp:235
Backend
A collection of all backends.
Definition: backends.hpp:46
Defines the various I/O modes a user could employ with ALP data ingestion or extraction.
Specifies the ALP/GraphBLAS matrix container.
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:450
IOMode
The GraphBLAS input and output functionalities can either be used in a sequential or parallel fashion...
Definition: iomode.hpp:67
RC
Return codes of ALP primitives.
Definition: rc.hpp:47
@ PANIC
Generic fatal error code.
Definition: rc.hpp:68
@ UNSUPPORTED
Indicates that the execution of the requested primitive with the given arguments is not supported by ...
Definition: rc.hpp:129
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
Phase
Primitives with sparse ALP/GraphBLAS output containers may run into the issue where an appropriate gr...
Definition: phase.hpp:152
@ EXECUTE
Speculatively assumes that the output container of the requested operation has enough capacity to com...
Definition: phase.hpp:257
Defines the various phases an ALP/GraphBLAS primitive may be executed with.
Defines the ALP error codes.
Used to inspect whether a given type is an ALP/GraphBLAS object.
Definition: type_traits.hpp:130
Specifies the ALP/GraphBLAS vector container.