/*
* Stephen Becker, 11/10/08
* Computes A(omega), where A = U*V' is never explicitly computed
* srbecker@caltech.edu
*
* Partial Changelog:
*
* 3/24/09
* adding in "mxIsComplex" and "mxGetPi" routines to handle complex data seamlessly
* Not fully implemented yet, though; need to define .' vs ' convention (i.e. transpose vs adjoint)
* 5/13/09
* Finished implementing the complex stuff.
* The convention is A = U*V', not A = U*V.'
* Having problems with complex data on 64-bit linux though: zdot isn't working
* see
* http://matlab.izmiran.ru/help/techdoc/matlab_external/ch04cr17.html
* and the fort.h file in this directory, for alternative methods
* 5/19/09
* try mex -largeArrayDims -lblas -DWINDOWS XonOmega.c ??
* it only affects zdotu, not the level-3 blas
* tried -fPIC (as opposed to -fpic) in LDFLAGS, no luck
* So, my current solution is to implement the blas function myself for 64-bit processors
*
* 10/29/09
* see XonOmegaTranspose.c for a much faster implementation
* The idea is that we pass in U' and V' (instead of U and V)
* Very little modification of the code, but benefit is enormous:
* instead of stride lengths of M and N, stride lengths are now 1
* (because C and MATLAB use column-major order).
* Also, adding in new level-3 BLAS feature: if omega isn't sorted,
* and even if length(omega) isn't quite N*M, we still do level-3 BLAS
* call, and THEN sort it or subsample it. Also, extend to omegaX,omegaY case
* Also, why were omega, omegaI and omegaJ all doubles, not ints, or similar??
* Because MATLAB passes them in as doubles. Do NOT cast as integers!!
* 11/9/09
* Consider including blas.h and using ptrdiff_t as the types, not ints
* Added _WIN32 definition (implies WINDOWS) definition
* Switched malloc and free to mxMalloc and mxFree
*
*
* Note to the user:
* to really take advantage of this function, you should recompile it on
* your computer so that you can take advantage of any good BLAS libraries you might have
* However, it is unlikely that this will be the speed bottleneck for most applications...
*
* There are 3 ways to call this program:
*
* (1) b = XonOmega(U,V,omega)
* implicity forms the matrix A = U*V', then returns b = A(omega)
* where omega are linear indices.
* This is perhaps 20% faster if omega is sorted
*
* (2) b = XonOmega(U,V,omegaX,omegaY)
* does the same, but omegaX and omegaY are subscripts
* (i.e. omega = ind2sub(... OmegaX, OmegaY), or [OmegaX,OmegaY] = sub2ind(...,omega) )
* This is sometimes faster than method (1). If in addition, omegaX and omegaY
* are created from the indices of a sorted linear index
* (so that omegaY is sorted), then it will be about 20% faster
*
* (3) b = XonOmega(U,V,Y)
* gets information about omega from the sparsity pattern of the sparse matrix Y
* This is is actually the fastest method usually!
*
* (note: the relative speed of the different calling sequences
* will depend on your computer)
*
* Update: all of the above methods to call the program can be modified by adding
* an extra argument, cuttoff, to the end of the input sequence, e.g.
* (1) b = XonOmega(U,V,omega,cutoff)
* (2) b = XonOmega(U,V,omegaX,omegaY,cutoff)
* (3) b = XonOmega(U,V,Y,cutoff)
* where cutoff is a number between 0 and 1 that affects how the internal
* computation is done; specifically, if length(omega) > cutoff*size(U,1)*size(V,1),
* then the intermediate matrix A = U*V' is actually computed (using level-3 BLAS,
* which is usually very optimized). The default value of cutoff is .25,
* which is roughly the level where you begin to see benefit from not explicitly constructing A.
*
* Compilation notes:
* For efficieny, this program makes BLAS calls whenever possible;
* it uses level-3 BLAS if the entire matrix A = U*V' is needed,
* and if only a small subset is needed, then it makes many level-1 BLAS calls.
*
* On Windows computers, BLAS functions have no underscore, but for linux/unix/darwin, they do
* So, for Windows, either uncomment the line that says #define WINDOWS, or alternatively,
* when compiling, use mex -L(location) -lmwblas -largeArrayDims -DWINDOWS XonOmega.c
* (the -DWINDOWS is the same as putting "#define WINDOWS" in the code;
* "location<S-Del>) is fullfile(matlabroot,'extern','lib','win32',cc)
* where cc is usually 'lcc' (default) or 'microsoft' (for visual studio);
* The location string should be enclosed in quotes)
* ex. on my Windows machine, I do this
mex -O -L"C:\Program Files\MATLAB\R2008b\extern\lib\win32\microsoft" ...
-largeArrayDims -lmwblas -DWINDOWS XonOmega.c
*
*
*
* For linux, etc., you can specifically undefine the WINDOWS symbol
* by passing in the -UWINDOWS option to mex, but that's not
* necessary unless you uncommented the #define WINDOWS line below.
* You can use the mathwork's blas, -lmwblas, or, recommended,
* use a good blas that's already installed, and probably available
* with just -lblas. So, try this:
* mex -O -lblas -largeArrayDims updateSparse.c
* the -O is for optimized
* the -lblas may actually not even be necessary
*
* For both windows and linux, the -largeArrayDims flag is important if you have
* a 64-bit system, otherwise you can skip it.
*
* If you've never compiled with mex before, please see the MATHWORKS help page.
* You probably want to run "mex -setup" the first time.
*
*
* Dec '09 notes:
* zdotu -- if using libmwblas and matlab/extern/.../blas.h exists, use this for prototype and use blas call on 64-bit
* also, use fortran_wrapper stuff
* Source: zdotu.f
#define zdotu FORTRAN_WRAPPER(zdotu)
#ifndef FORTRAN_COMPLEX_FUNCTIONS_RETURN_VOID
extern doublecomplex zdotu(
#else
extern void zdotu(
doublecomplex* retval,
#endif
ptrdiff_t *n,
double *zx,
ptrdiff_t *incx,
double *zy,
ptrdiff_t *incy
);
*
extern complex16 zdotu_( int *K, complex16 *x, int *incx, complex16 *y, int *incy );
* */
#include "mex.h"
/* #include "limits.h" in mex.h already */
/* #include "blas.h" */ /* might want to try */
/* #define WINDOWS */
/* I use the "WINDOWS" symbol to change between underscores and no underscores
* _WIN32 *should* be automatically defined on WINDOWS machines, for most compilers */
#if defined(_WIN32)
#define WINDOWS
#endif
/* to use "mwSize", need matrix.h, but doesn't work for R2006a */
#include "matrix.h"
/* So, use the following definitions instead: */
#ifndef mwSize
#define mwSize size_t
#endif
#ifndef mwIndex
#define mwIndex size_t /* should make it compatible w/ 64-bit systems */
#endif
/* R2009a: BLAS is now 64-bit on 64-bit systems, so use mwSignedIndex
* For R2006a and earlier, when matrix.h doesn't exist, the following
* definitions can be used: */
#ifndef mwSignedIndex
#define mwSignedIndex ptrdiff_t
#endif
/* However, I'm not changing this just yet...
* http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/apiref/mwsignedindex.html&http://www.mathworks.com/access/helpdesk/help/techdoc/rn/brvak9c-1.html
*
*http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/rn/brvak9c-1.html&http://www.mathworks.com/access/helpdesk/help/techdoc/rn/bryg9vd-1.html#br02jub-1
* */
#ifndef true
#define true 1
#endif
#ifndef false
#define false 0
#endif
typedef struct{ double re; double im; } complex16; /* a hack */
/* this is what mathworks does in lapack.h: */
/*
#ifndef
没有合适的资源?快使用搜索试试~ 我知道了~
矩阵填充中的SVT重构算法
共80个文件
m:19个
c:8个
mexmaci64:6个
需积分: 46 125 下载量 120 浏览量
2016-10-08
19:41:52
上传
评论 5
收藏 676KB ZIP 举报
温馨提示
与压缩感知(CS)相类似的矩阵填充(MC)理论中的SVT重构算法。能够重构低秩、相关性较低的矩阵。
资源推荐
资源详情
资源评论
收起资源包目录
SVT.zip (80个子文件)
SVT.m 7KB
FPC.m 5KB
private
mexHelper.m 173B
updateSparse.mexmac 13KB
smvp.mexglx 13KB
bdsqr.mexmaci 9KB
updateSparse.mexglx 13KB
smvp.c 4KB
bdsqr.mexglx 14KB
XonOmega.mexmaci 17KB
reorth.mexmaci64 9KB
reorth.c 4KB
updateSparse_slow.m 1KB
reorth.mexglx 16KB
test_PROPACK.m 3KB
reorth.mexsg64 26KB
updateSparse.mexw32 56KB
findBestMultiply.m 2KB
XonOmegaTranspose.mexmaci64 17KB
XonOmega.mexmac 17KB
smvp.mexmac 9KB
updateSparse.map 47KB
reorth.mexw64 57KB
smvp.map 46KB
XonOmega.m 2KB
bdsqr.mexw64 56KB
bdsqr.mexsol 94KB
XonOmega.map 48KB
reorth.m 3KB
thresh.m 469B
smvp.mexa64 9KB
install_mex.m 4KB
updateSparse.mexa64 9KB
compute_int.m 1KB
XonOmega.mexmaci64 13KB
lansvd.m 12KB
reorth.mexa64 9KB
reorth.mexw32 56KB
XonOmegaTranspose.mexglx 22KB
reorth.mexsol 85KB
dbdqr.f 445B
XonOmegaTranspose.mexw64 62KB
XonOmega.mexw64 62KB
bdsqr.mexw32 56KB
refinebounds.m 939B
updateSparse.mexw64 57KB
bdsqr.mexa64 9KB
reorth_complex.m 3KB
reorth.mexmac 13KB
dbdqr.c 1KB
bdsqr.mexsg64 25KB
XonOmega.c 26KB
XonOmegaTranspose.mexw32 59KB
XonOmega.mexglx_bak 16KB
reorth_m.m 3KB
bdsqr.m 986B
XonOmegaTranspose.mexa64 14KB
smvp.mexw32 55KB
XonOmegaTranspose.mexmac 17KB
smvp.mexmaci64 9KB
updateSparse.c 5KB
reorth.f 3KB
test_MEX.m 3KB
XonOmega.mexw32 59KB
smvp.mexmaci 13KB
updateSparse.mexmaci64 13KB
bdsqr.mexmaci64 9KB
updateSparse.mexmaci 12KB
bdsqr.mexmac 13KB
smvp.mexw64 57KB
lanbpro.m 23KB
bdsqr_mex.c 5KB
reorth.mexsg 25KB
XonOmega.mexglx 21KB
reorth_mex.c 5KB
XonOmega.mexa64 14KB
bdsqr.mexsg 25KB
reorth.mexmaci 21KB
XonOmegaTranspose.c 23KB
Test_SVT.m 4KB
共 80 条
- 1
资源评论
百川到东海
- 粉丝: 11
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Win64OpenSSL-3-3-0.exe
- 课高分程设计-基于C++实现的民航飞行与地图简易管理系统-南京航空航天大学
- 航天器遥测数据故障检测系统python源码+文档说明+数据库(课程设计)
- 北京航空航天大学操作系统课设+ppt+实验报告
- 基于Vue+Echarts实现风力发电机中传感器的数据展示监控可视化系统+源代码+文档说明(高分课程设计)
- 基于单片机的风力发电机转速控制源码
- 基于C++实现的风力发电气动平衡监测系统+源代码+测量数据(高分课程设计)
- 毕业设计- 基于STM32F103C8T6 单片机,物联网技术的太阳能发电装置+源代码+文档说明+架构图+界面截图
- 基于 LSTM(长短期记忆)(即改进的循环神经网络)预测风力发电厂中风力涡轮机产生的功率+源代码+文档说明
- 基于stm32f103+空心杯电机+oled按键+运动算法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功