<< gf_solve SciGetFem gf_spmat_get >>

SciGetFem >> SciGetFem > gf_spmat

gf_spmat

Create a new sparse matrix in getfem++ format. These sparse matrix can be stored as CSC (compressed column sparse), which is the format used by Matlab, or they can be stored as WSC (internal format to getfem). The CSC matrices are not writable (it would be very inefficient), but they are optimized for multiplication with vectors, and memory usage. The WSC are writable, they are very fast with respect to random read/write operation. However their memory overhead is higher than CSC matrices, and they are a little bit slower for matrix-vector multiplications. By default, all newly created matrices are build as WSC matrices. This can be changed later with gf_spmat_set(spmat S, 'to_csc',...), or may be changed automatically by getfem (for example gf_linsolve() converts the matrices to CSC). The matrices may store REAL or COMPLEX values.

Calling Sequence

SM = gf_spmat('empty', int m [, int n])
SM = gf_spmat('copy', mat K [,  I [,  J]])
SM = gf_spmat('identity', int n)
SM = gf_spmat('mult', spmat A, spmat B)
SM = gf_spmat('add', spmat A, spmat B)
SM = gf_spmat('diag', mat D [, ivec E [, int n [,int m]]])
SM = gf_spmat('load','hb'|'harwell-boeing'|'mm'|'matrix-market', string filename)

Description

General constructor for spmat objects.

Create a new sparse matrix in getfem++ format. These sparse matrix can be stored as CSC (compressed column sparse), which is the format used by Matlab, or they can be stored as WSC (internal format to getfem). The CSC matrices are not writable (it would be very inefficient), but they are optimized for multiplication with vectors, and memory usage. The WSC are writable, they are very fast with respect to random read/write operation. However their memory overhead is higher than CSC matrices, and they are a little bit slower for matrix-vector multiplications. By default, all newly created matrices are build as WSC matrices. This can be changed later with gf_spmat_set(spmat S, 'to_csc',...), or may be changed automatically by getfem (for example gf_linsolve() converts the matrices to CSC). The matrices may store REAL or COMPLEX values.

Command list

See Also

Authors

Y. Collette


Report an issue
<< gf_solve SciGetFem gf_spmat_get >>