LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getHash.m
1function hashid = getHash(sn, ind, inspace)
2% HASHID = GETHASH(QN, IND, INSPACE)
3
4% Copyright (c) 2012-2026, Imperial College London
5% All rights reserved.
6
7if isempty(inspace)
8 hashid = -1;
9 return
10end
11
12% ind: node index
13%ist = sn.nodeToStation(ind);
14isf = sn.nodeToStateful(ind);
15
16inspace = [zeros(size(inspace,1),size(sn.space{isf},2)-size(inspace,2)), inspace];
17if isempty(sn.space{isf})
18 line_error(mfilename,'Station state space is not initialized. Use setStateSpace method.\n');
19end
20
21hashid=zeros(size(inspace,1),1);
22for j=1:size(inspace,1)
23 if size(sn.space{isf},2)<size(inspace(j,:),2) % cutoff exceeded
24 hashid(j,1) = -1 ;
25 else
26 hashid(j,1) = matchrow(sn.space{isf},inspace(j,:));
27 end
28end
29end