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
1137 const bool should_not_call_base_setElement =
false;
1138 assert( should_not_call_base_setElement );
1155 typename InputType,
typename fwd_iterator,
1156 Backend backend,
typename Coords
1160 fwd_iterator start,
const fwd_iterator end,
1164 return buildVector< descr >( x, accum, start, end, mode );
1176 class Merger = operators::right_assign< InputType >,
1177 typename fwd_iterator1,
typename fwd_iterator2,
1178 Backend backend,
typename Coords
1181 fwd_iterator1 ind_start,
const fwd_iterator1 ind_end,
1182 fwd_iterator2 val_start,
const fwd_iterator2 val_end,
1183 const IOMode mode,
const Merger & merger = Merger()
1186 return buildVector< descr >( x, accum, ind_start, ind_end, val_start, val_end,
1224 class Merger = operators::right_assign< InputType >,
1225 typename fwd_iterator1,
typename fwd_iterator2,
1226 Backend backend,
typename Coords
1230 fwd_iterator1 ind_start,
const fwd_iterator1 ind_end,
1231 fwd_iterator2 val_start,
const fwd_iterator2 val_end,
1234 return buildVector< descr | descriptors::no_duplicates >(
1331 typename fwd_iterator1 =
const size_t * __restrict__,
1332 typename fwd_iterator2 =
const size_t * __restrict__,
1333 typename fwd_iterator3 =
const InputType * __restrict__,
1334 Backend implementation = config::default_backend
1338 fwd_iterator1 I,
const fwd_iterator1 I_end,
1339 fwd_iterator2 J,
const fwd_iterator2 J_end,
1340 fwd_iterator3 V,
const fwd_iterator3 V_end,
1344 auto start = internal::makeSynchronized(
1348 const auto end = internal::makeSynchronized(
1349 I_end, J_end, V_end,
1353 return buildMatrixUnique< descr >( A, start, end, mode );
1363 typename fwd_iterator1 =
const size_t * __restrict__,
1364 typename fwd_iterator2 =
const size_t * __restrict__,
1365 typename fwd_iterator3 =
const InputType * __restrict__,
1366 Backend implementation = config::default_backend
1370 fwd_iterator1 I, fwd_iterator2 J, fwd_iterator3 V,
1371 const size_t nz,
const IOMode mode
1373 return buildMatrixUnique< descr >(
1388 typename InputType,
typename RIT,
typename CIT,
typename NIT,
1389 typename fwd_iterator1 =
const size_t * __restrict__,
1390 typename fwd_iterator2 =
const size_t * __restrict__,
1391 typename length_type = size_t,
1392 Backend implementation = config::default_backend
1396 fwd_iterator1 I, fwd_iterator2 J,
1397 const length_type nz,
const IOMode mode
1400 auto start = internal::makeSynchronized( I, J, I + nz, J + nz );
1401 const auto end = internal::makeSynchronized(
1402 I + nz, J + nz, I + nz, J + nz );
1404 return buildMatrixUnique< descr >( A, start, end, mode );
1450 typename InputType,
typename RIT,
typename CIT,
typename NIT,
1451 typename fwd_iterator,
1452 Backend implementation = config::default_backend
1456 fwd_iterator start,
const fwd_iterator end,
1464 std::cerr <<
"Should not call base grb::buildMatrixUnique" << std::endl;
1465 const bool should_not_call_base_buildMatrixUnique =
false;
1466 assert( should_not_call_base_buildMatrixUnique );
1517 template< Backend backend = config::default_backend >
1520 const bool should_not_call_base_wait =
false;
1521 assert( should_not_call_base_wait );
1552 Backend backend,
typename InputType,
typename Coords,
1557 const Args &... args
1560 const bool should_not_call_base_vector_wait =
false;
1561 assert( should_not_call_base_vector_wait );
1564 return wait( args... );
1594 typename InputType,
typename RIT,
typename CIT,
typename NIT,
1599 const Args &... args
1602 const bool should_not_call_base_matrix_wait =
false;
1603 assert( should_not_call_base_matrix_wait );
1606 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:117
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 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:1336
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
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 size(const Vector< DataType, backend, Coords > &x) noexcept
Request the size of a given vector.
Definition: io.hpp:235
size_t ncols(const Matrix< InputType, backend, RIT, CIT, NIT > &A) noexcept
Requests the column size of a given matrix.
Definition: io.hpp:339
size_t capacity(const Vector< InputType, backend, Coords > &x) noexcept
Queries the capacity of the given ALP/GraphBLAS container.
Definition: io.hpp:388
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:1228
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:1158
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
RC wait()
Depending on the backend, ALP/GraphBLAS primitives may be non-blocking, meaning that the operation im...
Definition: io.hpp:1518
RC resize(Vector< InputType, backend, Coords > &x, const size_t new_nz) noexcept
Resizes the nonzero capacity of this vector.
Definition: io.hpp:703
RC clear(Vector< DataType, backend, Coords > &x) noexcept
Clears a given vector of all nonzeroes.
Definition: io.hpp:574
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:452
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.