| igraph Reference Manual |
|---|
igraph_spmatrix_size — The number of elements in a sparse matrix.igraph_spmatrix_nrow — The number of rows in a sparse matrix.igraph_spmatrix_ncol — The number of columns in a sparse matrix.igraph_spmatrix_count_nonzero — The number of non-zero elements in a sparse matrix.igraph_spmatrix_max — Returns the maximum element of a matrix.
long int igraph_spmatrix_size(const igraph_spmatrix_t *m);
Arguments:
m: |
Pointer to an initialized sparse matrix object. |
Returns:
|
The size of the matrix. |
Time complexity: O(1).
long int igraph_spmatrix_nrow(const igraph_spmatrix_t *m);
Arguments:
m: |
Pointer to an initialized sparse matrix object. |
Returns:
|
The number of rows in the matrix. |
Time complexity: O(1).
long int igraph_spmatrix_ncol(const igraph_spmatrix_t *m);
Arguments:
m: |
Pointer to an initialized sparse matrix object. |
Returns:
|
The number of columns in the sparse matrix. |
Time complexity: O(1).
long int igraph_spmatrix_count_nonzero(const igraph_spmatrix_t *m);
Arguments:
m: |
Pointer to an initialized sparse matrix object. |
Returns:
|
The size of the matrix. |
Time complexity: O(1).
igraph_real_t igraph_spmatrix_max(const igraph_spmatrix_t *m,
igraph_real_t *ridx, igraph_real_t *cidx);
If the matrix is empty, zero is returned.
Arguments:
m: |
the matrix object. |
ridx: |
the row index of the maximum element if not |
cidx: |
the column index of the maximum element if not |
Time complexity: O(n), the number of nonzero elements in the matrix.
| << 4.3. Accessing elements of a sparse matrix | 4.5. Matrix operations >> |