-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Graph2D.MultiShadowedLines - ImageSci.OmeTiff. - Transcode签名修改 - Concatenate签名修改 - Lang.GetNthOutputs - Ops. - IsMember - Unique - SpecFun - LogicalExhaustion - Subsets
- Loading branch information
埃博拉酱
committed
Sep 8, 2021
1 parent
acf67b2
commit 6054675
Showing
78 changed files
with
69,438 additions
and
69,471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
function [StructPaths,Versions] = ExploreVersionStruct(Struct) | ||
import MATLAB.DataTypes.ArrayBuilder | ||
FieldNames=fieldnames(Struct); | ||
if isfield(Struct,'Me') | ||
StructPaths=""; | ||
Versions=Struct.Me; | ||
else | ||
StructPaths=ArrayBuilder; | ||
Versions=ArrayBuilder; | ||
for a=1:numel(FieldNames) | ||
FN=FieldNames{a}; | ||
[P,V]=ExploreVersionStruct(Struct.(FN)); | ||
StructPaths.Append("."+string(FN)+P); | ||
Versions.Append(V); | ||
end | ||
StructPaths=StructPaths.Harvest; | ||
Versions=Versions.Harvest; | ||
function [StructPaths,Versions] = ExploreVersionStruct(Struct) | ||
import MATLAB.DataTypes.ArrayBuilder | ||
FieldNames=fieldnames(Struct); | ||
if isfield(Struct,'Me') | ||
StructPaths=""; | ||
Versions=Struct.Me; | ||
else | ||
StructPaths=ArrayBuilder; | ||
Versions=ArrayBuilder; | ||
for a=1:numel(FieldNames) | ||
FN=FieldNames{a}; | ||
[P,V]=ExploreVersionStruct(Struct.(FN)); | ||
StructPaths.Append("."+string(FN)+P); | ||
Versions.Append(V); | ||
end | ||
StructPaths=StructPaths.Harvest; | ||
Versions=Versions.Harvest; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function [Only,All] = OnlyAll(Groups1,CRT2,Unique2) | ||
[Only,All]=deal(true); | ||
for Index=1:max(Groups1) | ||
Target=unique(CRT2(Groups1==Index,:)); | ||
Only=Only&&height(Target)==1; | ||
All=All&&isequal(Target,Unique2); | ||
end |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
classdef SpecialRelation | ||
enumeration | ||
General | ||
GroupBy | ||
Orthogonal | ||
Constant | ||
Equal | ||
Only | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,42 @@ | ||
classdef ArrayBuilder<handle | ||
%数组累加器 | ||
%将数据向内存中积累时,经常遇到需要不断累加数组的问题,MATLAB会提示预分配内存。但如果读取之前无法得知将会有多少项,预分配就会变成一个十分麻烦的动态任务。本类建立一个增长维度,在此维度上可以不断累加一个内置的数组。用户只需不断Append即可,无需考虑内存分配的问题,本类会自动进行优化的内存管理。 | ||
properties(Access=private) | ||
Storage(:,1)cell | ||
Capacity(1,1)uint32=0 | ||
end | ||
properties(SetAccess=private) | ||
%当前在累加维度上的累加数 | ||
Stock(1,1)uint32=0 | ||
end | ||
properties(SetAccess=immutable) | ||
%累加维度 | ||
BuildDimension(1,1)double | ||
end | ||
methods | ||
function obj = ArrayBuilder(BuildDimension) | ||
%输入参数:BuildDimension(1,1)uint8=1,累加维度 | ||
arguments | ||
BuildDimension(1,1)uint8=1 | ||
end | ||
obj.BuildDimension=BuildDimension; | ||
end | ||
function Append(obj,New) | ||
%输入参数:New,累加内容。所有累加内容在累加维度上尺寸可以不一致,但在其它维度上必须一致。 | ||
obj.Stock=obj.Stock+1; | ||
if obj.Capacity<obj.Stock | ||
obj.Capacity=obj.Stock*2; | ||
obj.Storage(obj.Capacity)=cell(1,1); | ||
end | ||
obj.Storage{obj.Stock}=New; | ||
end | ||
function Array=Harvest(obj) | ||
%收获累加完毕的MATLAB数组。收获后可以释放本对象,也可以继续累加。 | ||
Array=cat(obj.BuildDimension,obj.Storage{1:obj.Stock}); | ||
obj.Storage={Array}; | ||
obj.Stock=1; | ||
obj.Capacity=1; | ||
end | ||
function Clear(obj) | ||
obj.Stock=0; | ||
end | ||
end | ||
classdef ArrayBuilder<handle | ||
%数组累加器 | ||
%将数据向内存中积累时,经常遇到需要不断累加数组的问题,MATLAB会提示预分配内存。但如果读取之前无法得知将会有多少项,预分配就会变成一个十分麻烦的动态任务。本类建立一个增长维度,在此维度上可以不断累加一个内置的数组。用户只需不断Append即可,无需考虑内存分配的问题,本类会自动进行优化的内存管理。 | ||
properties(Access=private) | ||
Storage(:,1)cell | ||
Capacity(1,1)uint32=0 | ||
%当前在累加维度上的累加数 | ||
Stock(1,1)uint32=0 | ||
end | ||
properties(SetAccess=immutable) | ||
%累加维度 | ||
BuildDimension(1,1)double | ||
end | ||
methods | ||
function obj = ArrayBuilder(BuildDimension) | ||
%输入参数:BuildDimension(1,1)uint8=1,累加维度 | ||
arguments | ||
BuildDimension(1,1)uint8=1 | ||
end | ||
obj.BuildDimension=BuildDimension; | ||
end | ||
function Append(obj,New) | ||
%输入参数:New,累加内容。所有累加内容在累加维度上尺寸可以不一致,但在其它维度上必须一致。 | ||
obj.Stock=obj.Stock+1; | ||
if obj.Capacity<obj.Stock | ||
obj.Capacity=obj.Stock*2; | ||
obj.Storage(obj.Capacity)=cell(1,1); | ||
end | ||
obj.Storage{obj.Stock}=New; | ||
end | ||
function Array=Harvest(obj) | ||
%收获累加完毕的MATLAB数组。收获后可以释放本对象,也可以继续累加。 | ||
Array=cat(obj.BuildDimension,obj.Storage{1:obj.Stock}); | ||
obj.Storage={Array}; | ||
obj.Stock=1; | ||
obj.Capacity=1; | ||
end | ||
function Clear(obj) | ||
obj.Stock=0; | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
classdef CatMode | ||
enumeration | ||
%Function的返回值为标量 | ||
Scalar | ||
%SplitDimensions为标量,且Function的返回值为类型、PackDimensions维度上尺寸均相同的数组 | ||
Linear | ||
%Function的返回值为数值、逻辑、字符或字段相同的结构体数组,且尺寸完全相同 | ||
EsNlcs | ||
%Function的返回值为数组,允许尺寸不同,但最终可以拼接成一整个大数组 | ||
CanCat | ||
%不符合上述任何条件,或返回值为函数句柄 | ||
DontCat | ||
end | ||
classdef CatMode | ||
enumeration | ||
%Function的返回值为标量 | ||
Scalar | ||
%SplitDimensions为标量,且Function的返回值为类型、PackDimensions维度上尺寸均相同的数组 | ||
Linear | ||
%Function的返回值为数值、逻辑、字符或字段相同的结构体数组,且尺寸完全相同 | ||
EsNlcs | ||
%Function的返回值为数组,允许尺寸不同,但最终可以拼接成一整个大数组 | ||
CanCat | ||
%不符合上述任何条件,或返回值为函数句柄 | ||
DontCat | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
function varargout = DFSuperCat(varargout,CM,SplitDimensions) | ||
import MATLAB.DataTypes.CatMode | ||
switch CM | ||
case CatMode.Scalar | ||
varargout=cellfun(@cell2mat,varargout,"UniformOutput",false); | ||
case CatMode.Linear | ||
if isempty(SplitDimensions) | ||
%这里不能使用varargout=horzcat(varargout{:}),因为varargout元胞里有可能是空的 | ||
varargout=cellfun(@(Out)vertcat(Out{:}),varargout,"UniformOutput",false); | ||
else | ||
varargout=cellfun(@(Out)cat(SplitDimensions,Out{:}),varargout,"UniformOutput",false); | ||
end | ||
case CatMode.CanCat | ||
varargout=cellfun(@MATLAB.DataTypes.Cell2Mat,varargout,"UniformOutput",false); | ||
end | ||
function varargout = DFSuperCat(varargout,CM,SplitDimensions) | ||
import MATLAB.DataTypes.CatMode | ||
switch CM | ||
case CatMode.Scalar | ||
varargout=cellfun(@cell2mat,varargout,"UniformOutput",false); | ||
case CatMode.Linear | ||
if isempty(SplitDimensions) | ||
%这里不能使用varargout=horzcat(varargout{:}),因为varargout元胞里有可能是空的 | ||
varargout=cellfun(@(Out)vertcat(Out{:}),varargout,"UniformOutput",false); | ||
else | ||
varargout=cellfun(@(Out)cat(SplitDimensions,Out{:}),varargout,"UniformOutput",false); | ||
end | ||
case CatMode.CanCat | ||
varargout=cellfun(@MATLAB.DataTypes.Cell2Mat,varargout,"UniformOutput",false); | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
classdef FILEOP_FLAGS<uint16 | ||
enumeration | ||
%指定多个目标文件(一一对应每个源文件);而不是一个目录(存入所有源文件)。 | ||
FOF_MULTIDESTFILES(0x0001) | ||
%不要显示进度对话框。 | ||
FOF_SILENT(0x0004) | ||
%如果目标名称的文件已在目的地存在,请给移动、复制或重命名操作中的文件以新名称。 | ||
FOF_RENAMEONCOLLISION(0x0008) | ||
%对于显示的任何对话框,请以“是”响应。 | ||
FOF_NOCONFIRMATION(0x0010) | ||
%如果可能,保留撤消信息。如果源文件参数不包含完全合格的路径和文件名称,则忽略此标志。使用此旗帜可指示应将删除的文件移动到回收站,而不是彻底删除。 | ||
FOF_ALLOWUNDO(0x0040) | ||
%仅在指定通配符文件名称的文件(不在文件夹上)上执行操作。 | ||
FOF_FILESONLY(0x0080) | ||
%操作中,显示进度对话框,但不显示单独的文件名。 | ||
FOF_SIMPLEPROGRESS(0x0100) | ||
%如果操作需要创建新目录,请不要要求用户确认新目录的创建。 | ||
FOF_NOCONFIRMMKDIR(0x0200) | ||
%如果出现错误,不要向用户显示对话框。 | ||
FOF_NOERRORUI(0x0400) | ||
%不要复制文件的安全属性。目标文件接收其新文件夹的安全属性。 | ||
FOF_NOCOPYSECURITYATTRIBS(0x0800) | ||
%仅在本地目录中执行操作。不要递归到子目录(这是默认行为)。 | ||
FOF_NORECURSION(0x1000) | ||
%不要将已连接的文件作为一个组移动。仅移动指定文件。 | ||
FOF_NO_CONNECTED_ELEMENTS(0x2000) | ||
%如果文件在删除操作中永久销毁,而不是回收,请发送警告。这面旗帜部分覆盖FOF_NOCONFIRMATION。 | ||
FOF_WANTNUKEWARNING(0x4000) | ||
%默默执行操作,不向用户呈现UI。这相当于FOF_SILENT+FOF_NOCONFIRMATION+FOF_NOERRORUI+FOF_NOCONFIRMMKDIR | ||
FOF_NO_UI(0x0614) | ||
end | ||
classdef FILEOP_FLAGS<uint16 | ||
enumeration | ||
%指定多个目标文件(一一对应每个源文件);而不是一个目录(存入所有源文件)。 | ||
FOF_MULTIDESTFILES(0x0001) | ||
%不要显示进度对话框。 | ||
FOF_SILENT(0x0004) | ||
%如果目标名称的文件已在目的地存在,请给移动、复制或重命名操作中的文件以新名称。 | ||
FOF_RENAMEONCOLLISION(0x0008) | ||
%对于显示的任何对话框,请以“是”响应。 | ||
FOF_NOCONFIRMATION(0x0010) | ||
%如果可能,保留撤消信息。如果源文件参数不包含完全合格的路径和文件名称,则忽略此标志。使用此旗帜可指示应将删除的文件移动到回收站,而不是彻底删除。 | ||
FOF_ALLOWUNDO(0x0040) | ||
%仅在指定通配符文件名称的文件(不在文件夹上)上执行操作。 | ||
FOF_FILESONLY(0x0080) | ||
%操作中,显示进度对话框,但不显示单独的文件名。 | ||
FOF_SIMPLEPROGRESS(0x0100) | ||
%如果操作需要创建新目录,请不要要求用户确认新目录的创建。 | ||
FOF_NOCONFIRMMKDIR(0x0200) | ||
%如果出现错误,不要向用户显示对话框。 | ||
FOF_NOERRORUI(0x0400) | ||
%不要复制文件的安全属性。目标文件接收其新文件夹的安全属性。 | ||
FOF_NOCOPYSECURITYATTRIBS(0x0800) | ||
%仅在本地目录中执行操作。不要递归到子目录(这是默认行为)。 | ||
FOF_NORECURSION(0x1000) | ||
%不要将已连接的文件作为一个组移动。仅移动指定文件。 | ||
FOF_NO_CONNECTED_ELEMENTS(0x2000) | ||
%如果文件在删除操作中永久销毁,而不是回收,请发送警告。这面旗帜部分覆盖FOF_NOCONFIRMATION。 | ||
FOF_WANTNUKEWARNING(0x4000) | ||
%默默执行操作,不向用户呈现UI。这相当于FOF_SILENT+FOF_NOCONFIRMATION+FOF_NOERRORUI+FOF_NOCONFIRMMKDIR | ||
FOF_NO_UI(0x0614) | ||
end | ||
end |
Oops, something went wrong.