A class for successive matrix products

版本 1.3.4 (13.7 KB) 作者: Matt J
A class representing products of matrices, internally storing/manipulating them separately.
668.0 次下载
更新时间 2025/8/6

查看许可证

This submission defines a class for representing products of matrices (or of any objects that know how to multiply) when it is more efficient to store and manipulate the matrices separately. Below is a basic example, but more can be found in the Examples tab.
N=6000;
u=rand(N,1);
v=rand(N,1);
x=rand(N,1);
Pmat=u*v.';
and let us also represent Pmat as a ProdCascade object.
P=ProdCascade({u,v.'});
Now, compare the execution time from multiplying with Pmat and its transpose,
tic;
y1=Pmat*x;
z1=Pmat.'*y1;
toc; %Elapsed time is 0.048516 seconds.
with the same operations using a ProdCascade representation,
tic
y2=P*x;
z2=P.'*y2;
toc %Elapsed time is 0.002752 seconds.
DISCAIMER: Error checking is never done to see whether the operators in a ProdCascade are compatible for successive multiplication.

引用格式

Matt J (2025). A class for successive matrix products (https://ww2.mathworks.cn/matlabcentral/fileexchange/29498-a-class-for-successive-matrix-products), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2010b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Handle Classes 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.3.4

Extended mrdivide & mldivide functionality to non-square matrices, but note that results are not guaranteed exact in this case.

1.3.3

Edit to Examples.mlx

1.3.2

Title change

1.3.1

* Added mldivide, mrdivide methods
* Added Examples.mlx

1.3.0.0

Edited the copywrite info. No new code.

1.1.0.0

Modified the description page. No new code to download.

1.0.0.0