ALP User Documentation 0.7.0
Algebraic Programming User Documentation
Namespaces | Functions
io.hpp File Reference

Specifies all I/O primitives for use with ALP/GraphBLAS containers. More...

Go to the source code of this file.

Namespaces

namespace  grb
 The ALP/GraphBLAS namespace.
 

Functions

template<Descriptor descr = descriptors::no_operation, typename InputType , typename fwd_iterator1 = const size_t * __restrict__, typename fwd_iterator2 = const size_t * __restrict__, typename fwd_iterator3 = const InputType * __restrict__, Backend implementation = config::default_backend>
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. More...
 
template<Descriptor descr = descriptors::no_operation, typename InputType , typename fwd_iterator1 = const size_t * __restrict__, typename fwd_iterator2 = const size_t * __restrict__, typename fwd_iterator3 = const InputType * __restrict__, Backend implementation = config::default_backend>
RC buildMatrixUnique (Matrix< InputType, implementation > &A, fwd_iterator1 I, fwd_iterator2 J, fwd_iterator3 V, const size_t nz, const IOMode mode)
 Alias that transforms a set of pointers and an array length to the buildMatrixUnique variant based on iterators.
 
template<Descriptor descr = descriptors::no_operation, typename InputType , typename RIT , typename CIT , typename NIT , typename fwd_iterator , Backend implementation = config::default_backend>
RC buildMatrixUnique (Matrix< InputType, implementation, RIT, CIT, NIT > &A, fwd_iterator start, const fwd_iterator end, const IOMode mode)
 Version of buildMatrixUnique that works by supplying a single iterator (instead of three). More...
 
template<Descriptor descr = descriptors::no_operation, typename InputType , typename RIT , typename CIT , typename NIT , typename fwd_iterator1 = const size_t * __restrict__, typename fwd_iterator2 = const size_t * __restrict__, typename length_type = size_t, Backend implementation = config::default_backend>
RC buildMatrixUnique (Matrix< InputType, implementation, RIT, CIT, NIT > &A, fwd_iterator1 I, fwd_iterator2 J, const length_type nz, const IOMode mode)
 Version of the above buildMatrixUnique that handles nullptr value pointers.
 
template<Descriptor descr = descriptors::no_operation, typename InputType , typename fwd_iterator , Backend backend, typename Coords >
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. More...
 
template<Descriptor descr = descriptors::no_operation, typename InputType , class Merger = operators::right_assign< InputType >, typename fwd_iterator1 , typename fwd_iterator2 , Backend backend, typename Coords >
RC buildVector (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, const Merger &merger=Merger())
 Ingests possibly sparse input from a container to which iterators are provided. More...
 
template<Descriptor descr = descriptors::no_operation, typename InputType , class Merger = operators::right_assign< InputType >, typename fwd_iterator1 , typename fwd_iterator2 , Backend backend, typename Coords >
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. More...
 
template<typename InputType , Backend backend, typename RIT , typename CIT , typename NIT >
size_t capacity (const Matrix< InputType, backend, RIT, CIT, NIT > &A) noexcept
 Queries the capacity of the given ALP/GraphBLAS container. More...
 
template<typename InputType , Backend backend, typename Coords >
size_t capacity (const Vector< InputType, backend, Coords > &x) noexcept
 Queries the capacity of the given ALP/GraphBLAS container. More...
 
template<typename InputType , Backend backend, typename RIT , typename CIT , typename NIT >
RC clear (Matrix< InputType, backend, RIT, CIT, NIT > &A) noexcept
 Clears a given matrix of all nonzeroes. More...
 
template<typename DataType , Backend backend, typename Coords >
RC clear (Vector< DataType, backend, Coords > &x) noexcept
 Clears a given vector of all nonzeroes. More...
 
template<typename ElementType , typename RIT , typename CIT , typename NIT , Backend implementation = config::default_backend>
uintptr_t getID (const Matrix< ElementType, implementation, RIT, CIT, NIT > &x)
 Specialisation of getID for matrix containers. More...
 
template<typename ElementType , typename Coords , Backend implementation = config::default_backend>
uintptr_t getID (const Vector< ElementType, implementation, Coords > &x)
 Function that returns a unique ID for a given non-empty container. More...
 
template<typename InputType , Backend backend, typename RIT , typename CIT , typename NIT >
size_t ncols (const Matrix< InputType, backend, RIT, CIT, NIT > &A) noexcept
 Requests the column size of a given matrix. More...
 
template<typename InputType , Backend backend, typename RIT , typename CIT , typename NIT >
size_t nnz (const Matrix< InputType, backend, RIT, CIT, NIT > &A) noexcept
 Retrieve the number of nonzeroes contained in this matrix. More...
 
template<typename DataType , Backend backend, typename Coords >
size_t nnz (const Vector< DataType, backend, Coords > &x) noexcept
 Request the number of nonzeroes in a given vector. More...
 
template<typename InputType , Backend backend, typename RIT , typename CIT , typename NIT >
size_t nrows (const Matrix< InputType, backend, RIT, CIT, NIT > &A) noexcept
 Requests the row size of a given matrix. More...
 
template<typename InputType , Backend backend, typename RIT , typename CIT , typename NIT >
RC resize (Matrix< InputType, backend, RIT, CIT, NIT > &A, const size_t new_nz) noexcept
 Resizes the nonzero capacity of this matrix. More...
 
template<typename InputType , Backend backend, typename Coords >
RC resize (Vector< InputType, backend, Coords > &x, const size_t new_nz) noexcept
 Resizes the nonzero capacity of this vector. More...
 
template<Descriptor descr = descriptors::no_operation, typename DataType , typename T , typename Coords , Backend backend>
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. More...
 
template<Descriptor descr = descriptors::no_operation, typename DataType , typename MaskType , typename T , Backend backend, typename Coords >
RC set (Vector< DataType, reference, Coords > &x, const Vector< MaskType, backend, Coords > &mask, 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)
 Sets all elements of a vector to the given value whenever the given mask evaluates true. More...
 
template<Descriptor descr = descriptors::no_operation, typename OutputType , typename InputType , Backend backend, typename Coords >
RC set (Vector< OutputType, backend, Coords > &x, const Vector< InputType, backend, Coords > &y, const Phase &phase=EXECUTE)
 Sets the content of a given vector x to be equal to that of another given vector y. More...
 
template<Descriptor descr = descriptors::no_operation, typename OutputType , typename MaskType , typename InputType , Backend backend, typename Coords >
RC set (Vector< OutputType, backend, Coords > &x, const Vector< MaskType, backend, Coords > &mask, const Vector< InputType, backend, Coords > &y, const Phase &phase=EXECUTE, const typename std::enable_if< !grb::is_object< OutputType >::value &&!grb::is_object< MaskType >::value &&!grb::is_object< InputType >::value, void >::type *const =nullptr)
 Sets the content of a given vector x to be equal to that of another given vector y. More...
 
template<Descriptor descr = descriptors::no_operation, typename DataType , typename T , Backend backend, typename Coords >
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. More...
 
template<typename DataType , Backend backend, typename Coords >
size_t size (const Vector< DataType, backend, Coords > &x) noexcept
 Request the size of a given vector. More...
 
template<Backend backend = config::default_backend>
RC wait ()
 Depending on the backend, ALP/GraphBLAS primitives may be non-blocking, meaning that the operation immediately returns even though the requested computation has not been performed. More...
 
template<Backend backend, typename InputType , typename RIT , typename CIT , typename NIT , typename... Args>
RC wait (const Matrix< InputType, backend, RIT, CIT, NIT > &A, const Args &... args)
 A variant of grb::wait that executes, at minimum, all nonblocking primitives required for computing a given output matrix as well as, optionally, for any additional output containers given in the variadic argument list. More...
 
template<Backend backend, typename InputType , typename Coords , typename... Args>
RC wait (const Vector< InputType, backend, Coords > &x, const Args &... args)
 A variant of grb::wait that executes, at minimum, all nonblocking primitives required for computing a given output vector as well as, optionally, for any additional output containers given in the variadic argument list. More...
 

Detailed Description

Specifies all I/O primitives for use with ALP/GraphBLAS containers.

Author
A. N. Yzelman
Date
21st of February, 2017