LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
spaceClosedSingle.m
1function SS = spaceClosedSingle(M, N)
2% SS = SPACECLOSEDSINGLE(M, N)
3
4% Copyright (c) 2012-2014, Imperial College London
5% All rights reserved.
6if M==0
7 SS = [];
8else
9 SS = multichoose(M, N);
10end
11end
12
13function [v] = multichoose(n,k)
14% [V] = MULTICHOOSE(N,K)
15
16v=[];
17% Cooperative wall-clock budget checkpoint (session-level deadline set by the
18% per-solver runAnalyzer); see matlab/util/multichoose.m for rationale.
19persistent tochk
20if isempty(tochk)
21 tochk = 0;
22end
23tochk = tochk + 1;
24if tochk >= 4096
25 tochk = 0;
26 if lineTimeoutExceeded()
27 line_error(mfilename,'Enumeration exceeded the wall-clock time budget (options.timeout).');
28 end
29end
30if n==1
31 v=k;
32 return
33elseif k==0
34 v=zeros(1,n);
35else
36 last=0;
37 for i=0:k
38 w=multichoose(n-1,k-i);
39 for j=1:size(w,1)
40 v(end+1,:)=[i w(j,:)];
41 end %for
42 end %for
43end %if
44end
Definition Station.m:245