nchoosek_enum

버전 1.0.1 (1.88 KB) 작성자: Bruno Luong
nchoosek with enumerate selection. This function never build the full combination array in memory
다운로드 수: 11
업데이트 날짜: 2021/4/27

라이선스 보기

This function can be used ti process all subset of cardinal k of set of cardinal k without having them stored in the memory. Typical call would be as following

n = 10;
k = 3;
chunksize = 10;
i = 1:chunksize;
norepetition = false;
while true
if norepetition
c = nchoosek_enum(n, k, i);
else
c = nchoosek_enum(n+k-1, k, i);
c = c - (0:k-1);
end
for r=1:size(c,1)
cr = c(r,:);
endcomb = any(isnan(cr));
if endcomb
break
end
% do somthing with cr
fprintf('%s\n', mat2str(cr))
end
if endcomb
break
end
i = i + chunksize;
end

인용 양식

Bruno Luong (2024). nchoosek_enum (https://www.mathworks.com/matlabcentral/fileexchange/91060-nchoosek_enum), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2021a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.1

Optimization implementation (generate smaller rectangular Pascal triangle)

1.0.0