kron on distributed arrays ?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone, I need to perform Kronecker products on (sparse) distributed arrays however the kron function is unfortunately not handled. I tried to edit the Matlab function and it appears that only the last line:
K = sparse(ik,jk,bsxfun(@times,sb,sa.'),ma*mb,na*nb);
produces an issue within an spdm loop
Any clue about how to overcome this? The error message is:
Error detected on lab(s) 1 2.
Caused by:
Error using codistributed/sparse>iCallSparseImpl (line 122)
Operands to the || and && operators must be convertible to logical scalar values.
Operands to the || and && operators must be convertible to logical scalar values.
Error using codistributed/sparse>iCallSparseImpl (line 122)
Operands to the || and && operators must be convertible to logical scalar values.
Operands to the || and && operators must be convertible to logical scalar values.
--
Thanks in advance
2 件のコメント
Walter Roberson
2014 年 2 月 4 日
When you use kron, are you doing no-trivial multiplications with it, or are you using it for its "replicate" behavior, where one of the arrays has only 0 and 1 entries ?
採用された回答
Hugo
2014 年 2 月 4 日
3 件のコメント
Walter Roberson
2014 年 2 月 5 日
If, hypothetically, the code had something like,
if ~any(ColIdx) && ~any(RowIdx)
then that would work for vectors because the any() would reduce the vectors to scalars, but it would fail for 2D arrays because you would be left with vectors connected by &&
You would need to look at codistributed/sparse>iCallSparseImpl (line 122) to see what the actual code is; I do not have that toolbox. The documentation for sparse() does say "vectors" in the positions.
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!