Sparse matrix utilities.
This function should be used as a mex file. The .m file version does not support all functionalities, is significantly slower and requires more memory.
The mex code is not MATLAB clean, in the sense that it often modifies input arguments. You are thus not encouraged to call sp_util yourself.
The following comments are only provided, so that you can understand the purpose of various calls to sp_util.
sp_util with no argument returns its version number.
- sp_util('ismex') true if sp_util is a mex file on your platform/path.
- ind=sp_util('profile',k) returns the profile of a sparse matrix (assumed to be symmetric). This is useful to have an idea of the memory required to store a Cholesky factor of this matrix.
- ks=sp_util('sp2sky',sparse(k)) returns the structure array used by the ofact object.
- ks = sp_util('sky_dec',ks) computes the LDL' factor of a ofact object and replaces the object data by the factor. The sky_inv command is used for forward/backward substitution (take a look at the
\mldivide.m function). sky_mul provides matrix multiplication for unfactored ofact matrices.
- k = sp_util('nas2sp',K,RowStart,InColumn,opt) is used by nasread for fast transformation between NASTRAN binary format and MATLAB sparse matrix storage.
- k = sp_util('spind',k,ind) renumbering and/or block extraction of a matrix. The input and output arguments k MUST be the same. This is not typically acceptable behavior for MATLAB functions but the speed-up compared with k=k(ind,ind) can be significant.
- k = sp_util('xkx',x,k) coordinate change for x a 3 by 3 matrix and DOFs of k stacked by groups of 3 for which the coordinate change must be applied.
- ener = sp_util('ener',ki,ke,length(Up.DOF),mind,T) is used by upcom to compute energy distributions in a list of elements. Note that this function does not handle numerical round-off problems in the same way as previous calls.
- k = sp_util('mind',ki,ke,N,mind) returns the square sparse matrix k associated to the vector of full matrix indices ki (column-wise position from 1 to
N^2) and associated values ke. This is used for finite element model assembly by fe_mk and upcom. In the later case, the optional argument mind is used to multiply the blocks of ke by appropriate coefficients. mindsym has the same objective but assumes that ki,ke only store the upper half of a symmetric matrix.
- sparse = sp_util('sp2st',k) returns a structure array with fields corresponding to the MATLAB sparse matrix object. This is a debugging tool.
- sp_util('setinput',mat,vect,start) places vector vect in matrix mat starting at C position start. Be careful to note that start is modified to contain the end position.
©1991-2016 by SDTools