| igraph Reference Manual |
|---|
int igraph_spmatrix_init(igraph_spmatrix_t *m, long int nrow, long int ncol);
Every sparse matrix needs to be initialized before using it, this is done
by calling this function. A matrix has to be destroyed if it is not
needed any more, see igraph_spmatrix_destroy().
Arguments:
m: |
Pointer to a not yet initialized sparse matrix object to be initialized. |
nrow: |
The number of rows in the matrix. |
ncol: |
The number of columns in the matrix. |
Returns:
|
Error code. |
Time complexity: operating system dependent.
int igraph_spmatrix_copy(igraph_spmatrix_t *to, const igraph_spmatrix_t *from);
Creates a sparse matrix object by copying another one.
Arguments:
to: |
Pointer to an uninitialized sparse matrix object. |
from: |
The initialized sparse matrix object to copy. |
Returns:
|
Error code, |
Time complexity: O(n), the number of elements in the matrix.
| << 4.1. About igraph_spmatrix_t objects | 4.3. Accessing elements of a sparse matrix >> |