Sparse Functions - GNU Octave
Description: GNU Octave

Next: Return Types of Operators and Functions, Up: Operators and Functions

##### 21.1.4.1 Sparse Functions

Many Octave functions have been overloaded to work with either sparse or full matrices. There is no difference in calling convention when using an overloaded function with a sparse matrix, however, there is also no access to potentially sparse-specific features. At any time the sparse matrix specific version of a function can be used by explicitly calling its function name.

The table below lists all of the sparse functions of Octave. Note that the names of the specific sparse forms of the functions are typically the same as the general versions with a sp prefix. In the table below, and in the rest of this article, the specific sparse versions of functions are used.

Generate sparse matrices:
  spalloc, spdiags, speye, sprand, sprandn, sprandsym
Sparse matrix conversion:
  full, sparse, spconvert
Manipulate sparse matrices
  issparse, nnz, nonzeros, nzmax, spfun, spones, spy
Graph Theory:
  etree, etreeplot, gplot, treeplot
Sparse matrix reordering:
  amd, ccolamd, colamd, colperm, csymamd, dmperm, symamd, randperm, symrcm
Linear algebra:
  condest, eigs, matrix_type, normest, sprank, spaugment, svds
Iterative techniques:
  luinc, pcg, pcr
Miscellaneous:
  spparms, symbfact, spstats

In addition all of the standard Octave mapper functions (i.e., basic math functions that take a single argument) such as abs, etc. can accept sparse matrices. The reader is referred to the documentation supplied with these functions within Octave itself for further details.