ALP User Documentation 0.7.0
Algebraic Programming User Documentation
|
An ALP/GraphBLAS matrix. More...
#include <matrix.hpp>
Classes | |
class | const_iterator |
A standard iterator for an ALP/GraphBLAS matrix. More... | |
Public Types | |
typedef Matrix< D, implementation, RowIndexType, ColIndexType, NonzeroIndexType > | self_type |
The type of this container. | |
typedef D | value_type |
The value type of elements stored in this matrix. | |
Public Member Functions | |
Matrix (const Matrix< D, implementation, RowIndexType, ColIndexType, NonzeroIndexType > &other) | |
Copy constructor. More... | |
Matrix (const size_t rows, const size_t columns) | |
ALP/GraphBLAS matrix constructor that sets a default initial capacity. More... | |
Matrix (const size_t rows, const size_t columns, const size_t nz) | |
ALP/GraphBLAS matrix constructor that sets an initial capacity. More... | |
Matrix (self_type &&other) | |
Move constructor. More... | |
~Matrix () | |
Matrix destructor. More... | |
const_iterator | begin () const |
Same as cbegin(). More... | |
const_iterator | cbegin () const |
Provides the only mechanism to extract data from a GraphBLAS matrix. More... | |
const_iterator | cend () const |
Indicates the end to the elements in this container. More... | |
const_iterator | end () const |
Same as cend(). More... | |
self_type & | operator= (self_type &&other) noexcept |
Move-assignment. More... | |
An ALP/GraphBLAS matrix.
This is an opaque data type that implements the below constructors, member functions, and destructors.
D | The type of a nonzero element. |
The given type D shall not be an ALP/GraphBLAS object.
implementation | Allows multiple backends to implement different versions of this data type. |
|
inline |
ALP/GraphBLAS matrix constructor that sets an initial capacity.
[in] | rows | The number of rows of the matrix to be instantiated. |
[in] | columns | The number of columns of the matrix to be instantiated. |
[in] | nz | The minimum initial capacity of the matrix to be instantiated. |
After successful construction, the resulting matrix has a capacity of at least nz nonzeroes. If either rows or columns is 0, then the capacity may instead be 0 as well.
On errors such as out-of-memory, this constructor may throw exceptions.
|
inline |
ALP/GraphBLAS matrix constructor that sets a default initial capacity.
[in] | rows | The number of rows in the new matrix. |
[in] | columns | The number of columns in the new matrix. |
The default capacity is the maximum of rows and columns.
On errors such as out-of-memory, this constructor may throw exceptions.
For the full specification, please see the full constructor signature.
|
inline |
Copy constructor.
[in] | other | The matrix to copy. |
This performs a deep copy; a new matrix is allocated with the same (or larger) capacity as other, after which the contents of other are copied into the new instance.
The use of this constructor is semantically the same as:
grb::Matrix< T > newMatrix( grb::nrows( other ), grb::ncols( other ), grb::capacity( other ) ); grb::set( newMatrix, other );
(Under the condition that all calls are successful.)
Move constructor.
This will take over the resources of the given other matrix, invalidating the contents of other while its contents are now moved into this instance instead.
[in] | other | The matrix to move to this new instance. |
|
inline |
Matrix destructor.
|
inline |
Same as cbegin().
Since iterators are only supplied as a data extraction mechanism, there is no overloaded version of this function that returns a non-const iterator.
|
inline |
Provides the only mechanism to extract data from a GraphBLAS matrix.
The order in which nonzero elements are returned is undefined.
|
inline |
Indicates the end to the elements in this container.
|
inline |
Same as cend().
Since iterators are only supplied as a data extraction mechanism, there is no overloaded version of this function that returns a non-const iterator.
Move-assignment.
This will take over the resources of the given other matrix, invalidating the contents of other while its contents are now moved into this instance instead.
This will destroy any current contents in this container.
[in] | other | The matrix contents to move into this instance. |