Decomposition object saveobj method not supported?

Hi there,
I need to perform a lot of computation. I am using some sort of 3D histogram, which is filled with logs about entitites for each cell. Each cell is associated with some particular matrix, which plays the role of RHS of system of linear equations. In order to speed up my computations, solving systems with variable LHS but for specific cell with constant RHS (mentioned earlier), I want to use decomposition object, which is preferable way of handling such issue. The problem is, that creating the grid can be computationally exhaustive and because of that I create it once, save to the mat file and load. This approach is much faster. But if part of the grid is cell array with decomposition object, I receive this warning
Warning: Saving a decomposition is not supported.
> In decomposition/saveobj (line 667).
Minimal not working example could be
decomp = decomposition([1 2; 3 5], 'lu');
save('decomp.mat', 'decomp', '-v7.3');
I use Matlab R2018a. Thank you for advice.

 採用された回答

Christine Tobler
Christine Tobler 2018 年 5 月 17 日

1 投票

This is a limitation on the decomposition object: It cannot be saved into .mat file. The background for this is that some types of decompositions are stored in an internal format defined by a library we use: We can't practically save these to a file, and if we tried, there would likely be problems when loading such a mat-file on a different computer.
As a workaround, you could instead store the factors of an LU decomposition of each matrix, and then use this matrix to solve the linear system. Unfortunately, this is less elegant than using the decomposition object.

5 件のコメント

Hilmar Gudmundsson
Hilmar Gudmundsson 2021 年 8 月 4 日
What about the solution suggested here: https://merzba.ch/dw/blg:matlab_decomposition_parfor
This appears to work.
The decompositon approach saves so much time that it seems a shame not to be able to use it with parfor.
Shumao Zhang
Shumao Zhang 2021 年 12 月 6 日
Just want to report that the approach mentioned in the link seems not working. You can see the details from the post https://www.mathworks.com/matlabcentral/answers/1593439-decomposition-in-parfor-failure. Hope we can get saveobj availablae asap.
Michal
Michal 2022 年 8 月 18 日
編集済み: Michal 2022 年 8 月 18 日
@Shumao Zhang Any progress regarding "Saving a decomposition is not supported." problem? Did you find any way how to use effectively parallelization together with decomposition object???
Shumao Zhang
Shumao Zhang 2022 年 8 月 18 日
編集済み: Shumao Zhang 2022 年 8 月 18 日
@Michal Unfortunately I don't see any progress... I eventually gave up parallelizing the decomposition objects.
Michal
Michal 2022 年 8 月 18 日
編集済み: Michal 2022 年 8 月 18 日
Take a look on this thread. Should be interesting for you, too!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

PKL
2018 年 5 月 17 日

編集済み:

2022 年 8 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by