gpt4 book ai didi

java - java Matlab 的可序列化性

转载 作者:行者123 更新时间:2023-12-01 10:27:19 25 4
gpt4 key购买 nike

我使用用 Java javaplex 编写的工具箱 [ https://github.com/javaplex/javaplex.github.io][1]

输入矩阵 mat 的链接 [ https://drive.google.com/file/d/0B3uM9Np2kJYoTmtkRHV2WU5JeGc/view?usp=sharing][3]第一个运行良好的循环是 for

cd C:\ProjetBCodesMatlab\Jplex
javaaddpath('./lib/javaplex.jar');
import edu.stanford.math.plex4.*;

javaaddpath('./lib/plex-viewer.jar');
import edu.stanford.math.plex_viewer.*;

cd './utility';
addpath(pwd);
cd '..';

max_dimension = 3;
max_filtration_value = 1000;
num_divisions = 10000;
options.max_filtration_value = max_filtration_value;
options.max_dimension = max_dimension - 1;

%------------------------------------------------------------
for i=1:10
maColonne = mat(i,:);
intervals= Calcul_interval(maColonne,options,max_dimension, max_filtration_value, num_divisions)
intervals
multinterval{i}= intervals;
end

执行函数 feature('numCores') 时,我使用 I7;

MATLAB detected: 4 physical cores.
MATLAB detected: 8 logical cores.
MATLAB was assigned: 8 logical cores by the OS.
MATLAB is using: 4 logical cores.
MATLAB is not using all logical cores because hyper-threading is enabled.

我使用 parfor 运行相同的代码

cd C:\ProjetBCodesMatlab\Jplex
javaaddpath('./lib/javaplex.jar');
import edu.stanford.math.plex4.*;

javaaddpath('./lib/plex-viewer.jar');
import edu.stanford.math.plex_viewer.*;

cd './utility';
addpath(pwd);
cd '..';

max_dimension = 3;
max_filtration_value = 1000;
num_divisions = 10000;
options.max_filtration_value = max_filtration_value;
options.max_dimension = max_dimension - 1;

%------------------------------------------------------------
parfor i=1:10
maColonne = mat(i,:);
intervals= Calcul_interval(maColonne,options,max_dimension, max_filtration_value, num_divisions)
intervals
multinterval{i}= intervals;
end

我有这个错误:不可序列化。

最佳答案

终于被我转载了。它无法序列化,因为您的变量 intervals 持有一个类型为 edu.stanford.math.plex4.homology.barcodes.BarcodeCollection 的对象,该对象不可序列化。您必须使其可序列化或提取有关工作人员的相关数据。并行计算工具箱只能传输可串行化的数据。

关于java - java Matlab 的可序列化性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35296554/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com