If you are getting 'Out of memory' errors while manipulating symmetric matrices, read on. (Usage instructions are down at the bottom.)
I should say upfront that linear algebra is significantly slower (compared to full storage) because of the well-known lack of level-3 BLAS operations for packed storage; it's up to you to judge if this price is worth to pay for being able to solve larger systems before you get an 'Out of memory' error.
Symmetric matrices stored in packed format take up only (approximately) half of the memory that would be necessary to store them in full; furthermore, element-wise arithmetic operations are performed only over the non-redundant lower or upper triangular part of the matrix, and operations such as matrix transposition have zero cost.
This package adds support to matrices stored in packed format to Matlab. It provides an interface for the creation and access to such matrices. Furthermore, it extends a package called trilin for linear algebra (factorization, solution of linear systems, inversion, and estimation of conditioning number) on packed storage. (Notice that trilin doesn't implement linear algebra algorithms, only exposes LAPACK's. It is useful if you want to factorize a matrix once then re-use its result multiple times; for example, in linear least squares problems A * x = b + r one employes the same factorization of A to solve the linear system x = A'*A \ A'b, to obtain the a posteriori covariance matrix C = inv(A'*A), and to estimate its conditioning.)
I tried to follow as much as possible the design and implementation of sparse matrices in Matlab (Gilbert et al., 1992). More especifically:
- no packed matrices are created without some overt direction from the user (i.e., via class constructor packed());
- operations of packed matrices produce packed matrices unless the operator destroys structures (e.g., A(1,end) = +1; A(end,1) = -1; destroys symmetry);
- operations on a mixture of packed and non-packed matrices produce a packed result unless the operator destroys structure;
- the value of the result of an operation does not depend on the storage class of the operands, although the storage class of the result may;
- in the interest of simplicity, we rejected the possibility of packed matrices in which all the values not explicitily stored would be some scalar rather than zero (in the case of triangular matrices or the symmetric part in the case of symmetric matrices).
Known limitations are:
- the access of individual elements in packed stored matrices is expected to be more costly than in full storage, because of the more complicated indexing necessary;
- complex data is marginally supported, meaning you can create triangular or symmetric (but not Hermitian) complex matrices, but operations and functions are undefined for complex data;
- linear algebra is significantly slower (compared to full storage) because of the well-known lack of level-3 BLAS operations for packed storage; it's up to you to judge if this price is worth to pay for being able to solve larger systems before you get an 'Out of memory' error.
- this package was built before the recent release of LAPACK routines for Rectangular Full Packed format (RFPF; see Gustavson et al., 2008). Such a formulation is remarkable in the sense that it requires minimal storage while at the same time is much more efficient than the then existing packed storage LAPACK routines. It'd be great if the package offered here were adapted to offer support for RFPF in Matlab.
A few technical details:
- data types supported are
'double', 'single', ...
'int8', 'uint8', ...
'int16', 'uint16', ...
'int32', 'uint32', ...
'logical', 'char'
- ideally this package would offer a new matrix storage class (packed, in addition to full and sparse already available), instead of a user class. That being said, I've overloaded functions class and isa to evaluate its data's class, so class(packed(single(0))) will return 'single', not 'packed'; use function ispacked to check for that, like you'd use function issparse;
- I let @sparse do the error checking for size compatibility; that significantly simplifies the code;
- the routines are accompanied by an extensive test suite, which can be ran by calling test_packed.
For background on the packed format, see the relevant sections in the LAPACK User's Guide (specially sections "Matrix Storage Schemes", "Packed Storage", and "Naming Scheme").
At last, I must mention that I wrote this package a few years ago and have not used it since then, so please report any bugs that you might encounter.
Gilbert, John R., Cleve Moler, and Robert Schreiber, "Sparse Matrices in MATLAB: Design and Implementation," SIAM Journal on Matrix Analysis and Applications, Vol. 13, 1992, pp. 333-356. Available at <http://www.mathworks.com/access/helpdesk/help/pdf_doc/otherdocs/simax.pdf>.
Fred G. Gustavson, Jerzy Wasniewski, and Jack J. Dongarra. "Rectangular Full Packed Format for Cholesky's Algorithm: Factorization, Solution and Inversion." LAPACK Working Note 199, April 2008. Available at <http://www.netlib.org/lapack/lawnspdf/lawn199.pdf>.
E. Anderson, Z. Bai, C. Bischof, S. Blackford, J. Demmel, J. Dongarra, J. Du Croz, A. Greenbaum, S. Hammarling, A. McKenney, D. Sorensen, "LAPACK Users' Guide," Third Edition (Updated 22 Aug 1999); SIAM, 407 pp., 1999. Available at <http://www.netlib.org/lapack/lug/>.
HOW TO USE IT: unpack zipfile into c:\Work\fx\, then copy & paste the following in the Matlab prompt:
addpath(genpath('c:\Work\fx\'))
test_trilin
test_packed
do_myprofile
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
matlab_GPS_用于近地表的GNSS多路径模拟器_反射测量和定位应用 (1972个子文件)
call_lapack.c 13KB
get_legendre_normal_assoc_func_c.c 10KB
mtimes.c 8KB
frontal_mtimes_helper.c 6KB
interp2_linear_c.c 6KB
interp1_linear_c.c 4KB
lininterp1f.c 4KB
mx2.c 3KB
besselj0_fast_c.c 2KB
besselj0.c 808B
sst.cpt 13KB
earth.cpt 12KB
ncar.cpt 10KB
GMT_rainbow.cpt 7KB
GMT_globe.cpt 2KB
wiki-2.0.cpt 2KB
dkbluered.cpt 2KB
GMT_sealand.cpt 1KB
GMT_haxby.cpt 1011B
GMT_topo.cpt 953B
GMT_relief.cpt 772B
GMT_gebco.cpt 755B
GMT_wysiwyg.cpt 715B
GMT_no_green.cpt 668B
GMT_ocean.cpt 455B
subtle.cpt 434B
GMT_seis.cpt 434B
wave.cpt 385B
elevation.cpt 335B
DEM_poster.cpt 323B
DEM_print.cpt 320B
GMT_drywet.cpt 279B
GMT_jet.cpt 267B
GMT_split.cpt 257B
DEM_screen.cpt 254B
GMT_red2green.cpt 206B
GMT_copper.cpt 204B
GMT_hot.cpt 203B
GMT_polar.cpt 173B
GMT_cool.cpt 146B
differences.cpt 135B
GMT_gray.cpt 133B
NOV750.R4__NONE__L1__LHCP__GAIN.DAT 10KB
TRM57971.00__NONE__L2__LHCP__GAIN.DAT 10KB
NOV750.R4__NONE__L2__LHCP__GAIN.DAT 10KB
NOV750.R4__NONE__L5__LHCP__GAIN.DAT 9KB
TRM57971.00__NONE__L5__LHCP__GAIN.DAT 9KB
TRM57971.00__NONE__L1__LHCP__GAIN.DAT 9KB
TRM41249.00__NONE__L1__RHCP__GAIN.DAT 7KB
TRM41249.00__NONE__L1__LHCP__GAIN.DAT 7KB
TRM41249.00__NONE__L2__LHCP__GAIN.DAT 6KB
TRM41249.00__NONE__L2__RHCP__GAIN.DAT 6KB
JAV_GRANT-G3T__NONE__L5__RHCP__GAIN.DAT 5KB
LEIAR25__NONE__L5__LHCP__GAIN.DAT 5KB
JAV_GRANT-G3T__NONE__L5__LHCP__GAIN.DAT 5KB
JAV_RINGANT_G3T__NONE__L5__RHCP__GAIN.DAT 5KB
JAV_GRANT-G3T__NONE__L2__LHCP__GAIN.DAT 5KB
LEIAR20__NONE__L1__LHCP__GAIN.DAT 5KB
JAV_GRANT-G3T__NONE__L1__RHCP__GAIN.DAT 4KB
LEIAR25__NONE__L5__RHCP__GAIN.DAT 4KB
JAV_GRANT-G3T__NONE__L1__LHCP__GAIN.DAT 4KB
JAV_RINGANT_G3T__NONE__L2__LHCP__GAIN.DAT 4KB
JAV_RINGANT_G3T__NONE__L5__LHCP__GAIN.DAT 4KB
JAV_RINGANT_G3T__NONE__L2__RHCP__GAIN.DAT 4KB
NOV750.R4__NONE__L5__RHCP__GAIN.DAT 4KB
LEIAR25__NONE__L2__LHCP__GAIN.DAT 4KB
LEIAR20__NONE__L2__LHCP__GAIN.DAT 4KB
NOV750.R4__NONE__L2__RHCP__GAIN.DAT 4KB
JAV_RINGANT_G3T__NONE__L1__RHCP__GAIN.DAT 4KB
NOV750.R4__NONE__L1__RHCP__GAIN.DAT 4KB
JAV_GRANT-G3T__NONE__L2__RHCP__GAIN.DAT 4KB
TRM59800.00-OLD__NONE__L1__LHCP__GAIN.DAT 3KB
snr_s2_vs_sc_fit2.dat 3KB
TRM59800.00__NONE__L5__LHCP__GAIN.DAT 3KB
TRM59800.00-OLD__NONE__L2__LHCP__GAIN.DAT 3KB
LEIAR20__NONE__L5__LHCP__GAIN.DAT 3KB
TRM29659.00__SCIT__L1__RHCP__GAIN.DAT 3KB
LEIAR25__NONE__L2__RHCP__GAIN.DAT 3KB
TRM29659.00__NONE__L2__LHCP__GAIN.DAT 3KB
TRM29659.00__SCIT__L2__RHCP__GAIN.DAT 3KB
TRM29659.00__NONE__L1__LHCP__GAIN.DAT 3KB
TRM57971.00__NONE__L5__RHCP__GAIN.DAT 3KB
JAVRINGANT_DM__NONE__L2__RHCP__GAIN.DAT 3KB
TRM59800.00-OLD__NONE__L2__RHCP__GAIN.DAT 3KB
TRM59800.00-OLD__NONE__L1__RHCP__GAIN.DAT 3KB
TRM29659.00__NONE__L2__RHCP__GAIN.DAT 3KB
TRM59800.00__NONE__L5__RHCP__GAIN.DAT 3KB
TRM57971.00__NONE__L1__RHCP__GAIN.DAT 3KB
JAVRINGANT_DM__NONE__L5__RHCP__GAIN.DAT 3KB
TRM57971.00__NONE__L2__RHCP__GAIN.DAT 3KB
TRM29659.00__SCIT__L1__LHCP__GAIN.DAT 3KB
TRM29659.00__SCIT__L2__LHCP__GAIN.DAT 3KB
TRM29659.00__NONE__L1__RHCP__GAIN.DAT 3KB
soil_im.dat 3KB
JAVRINGANT_DM__NONE__L1__RHCP__GAIN.DAT 3KB
JAV_RINGANT_G3T__NONE__L1__LHCP__GAIN.DAT 3KB
LEIAT504GG__NONE__L1__RHCP__GAIN.DAT 3KB
soil_re.dat 3KB
LEIAT504GG__NONE__L1__LHCP__GAIN.DAT 2KB
AOAD_M_T__NONE__L2__RHCP__GAIN.DAT 2KB
共 1972 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
wouderw
- 粉丝: 278
- 资源: 2959
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功